15 Commits
Author SHA1 Message Date
Reagan Lopez 0c913eec00 Refactor logging for consistent messages
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2020-05-01 16:48:19 -07:00
Ashlesha Atrey f6dcd44f21 Implement logging for mixer
Implement the logging package for mixer.

A common log file can be set for all the mixer commands in the
builder.conf. E.g. `mixer config set Mixer.LOG <filepath>`

The log file and level can also be set for individual mixer
commands using the `--log` and `--log-level` flags respectively.

The various log levels are:
ERROR (1), WARNING (2), INFO (3), DEBUG (4) and VERBOSE (5).
Default log level is 4.

Fixes #666

Signed-off-by: Ashlesha Atrey ashlesha.atrey@intel.com
2020-04-30 13:57:58 -07:00
Ashlesha Atrey 5c6afffa1d Refactor error handling in channels
Currently while catching errors using channels and select
statements, when the error is caught in select statements, it
is not breaking from the outside loop.
The correct approach is to let the existing go routines finish
executing and return one of the errors caught by the error channel.
It should also close the channel in order to stop executing new go
routines.
fixes #673

Signed-off-by: Ashlesha Atrey <ashlesha.atrey@intel.com>
2020-01-13 15:22:16 -08:00
Reagan Lopez 0a213ae98c Remove shared variable in zero pack goroutine
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-12-02 16:09:21 -08:00
Reagan Lopez 88014f5f0e Add more logs for zero pack creation
Add more zero pack logs for debugging in case of missing zero
packs.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-11-25 21:27:26 +00:00
Reagan Lopez 468effedff Improve performance of zero pack creation
Improve performance of zero pack creation by generating them in
parallel. Fixes #629

Although zero pack is technically a delta pack, the parallel code for
delta pack creation has not been reused because of the following:
- For zero packs, processing is stopped immediately in case of error.
  Whereas for delta packs, processing is continued even in case of error
  because delta packs are optional.
- The report and print statements are different for zero packs and delta
  packs.

The delta-workers flag is used as the numWorker for zero packs.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-11-08 18:11:10 +01:00
Reagan Lopez b0450cc9d3 Remove unused numWorker param from functions
Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-11-08 18:11:10 +01:00
Rodrigo Chiossi e9909408a1 fullfiles: Add user configured compression list
This patch allows users to configure the compression methods that will
be used for fullfiles creation. The compression method can be set in the
Swupd.COMPRESSION property in builder.conf. Instead of enabling all
methods as previosly, xz is the only method that comes enabled by
default.

Note: internal gzip is still used for Link and Directory fullfile
creation.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2019-11-05 15:23:22 +00:00
Otavio Pontes f654378e58 Revert partially "Introducing the Iterative to-Manifest"
Reverting commit to remove Iterative Manifests from mixer

This reverts commit 8a35392a76.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-10-23 23:30:03 +02:00
Ashlesha Atrey 4e764821d9 Signing the latest file in version/formatXX dir and version/latest_version file
The latest file in version/formatXX and version/latest_version isn't signed by mixer.
Mixer signs the these files so clients could check the signature of that file too.

Signed-off-by: Ashlesha Atrey ashlesha.atrey@intel.com
2019-09-04 14:45:54 +02:00
John Akre da2da4cfd4 update.go: Use bundle-workers for compression goroutines
Spawning a goroutine for each bundle when compressing files can cause the
system to reach the open file limit. This change allows the number of
goroutines used when compressing files to be configured by the adjusting the
bundle-workers argument.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-05-09 19:40:55 +02:00
John Akre 2f8202d30d update.go: Prevent race condition for err variable
The scope of the err variable was not limited to its local function, so
it was possible for outside errors from other goroutines to set it. This
change limits the scope of the err variable to the local function which
prevents this type of race condition.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-04-26 15:07:06 +02:00
John Akre ff334851e7 Use PREVIOUS_MIX_VERSION for previous manifest header field
The PREVIOUS_MIX_VERSION value from mixer.state has replaced LAST_VER
for setting the previous manifest header field. The LAST_VER value was
unable to properly set the previous header field when rebuilding a mix
with the clean flag. This change resolves the issue with the clean flag.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-04-25 18:23:40 +02:00
Otavio Pontes 8a35392a76 Introducing the Iterative to-Manifest
When creating manifests for a new build, also create to-Manifests
for each bundle that has changes in this version.

The goal on publishing to-Manifests is to reduce the download size
on updates, according to what was discussed on
clearlinux/swupd-client#498

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Matthew Johnson ef52b7339e builder: break functions out into smaller files
Fixes #391
This patch greatly improves code readability by breaking up the goliath
builder.go into several new files containing similar functionality. Now
builder.go only contains the top-level build functions, constructors,
and types.

This patch contains no code functionality changes, the code is simply
moved around.

The builder.go file has been split out as follows:
* builder.go: contains all the top-level commands accessible via the
  commandline, such as BuildBundles, BuildUpdate, BuildImage etc. along
  with the type and const definitions.
* bundle_control.go: contains the mixer bundle * top-level commands and
  all the helpers that are used only by this functionality.
* bundle_validate.go: contains the bundle validation functions.
* bundles.go: added getClosestAncestorOwner to this file as it was the
  only file using this function (plus one reference in builder.go by the
  top-level BuildBundles).
* deltapacks.go: contains the internal function createDeltaPacks used by
  exported function in builder.go.
* repo_control.go: contains the dnf configuration controlling functions
  such as AddRepo, SetURLRepo, etc. Ideally this will eventually be
  moved to the config package.
* helpers.go: contains generic helper functions used by several files in
  the builder package.
* init.go: contains the functions to initialize the mix via mixer
  init.
* metadata.go: contains various metadata getters and setters for reading
  and updating versions, formats, and metadata files.
* update.go: contains the internal functions used by mixer build update.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-10-23 13:32:05 -07:00