581 Commits
Author SHA1 Message Date
Tudor Marcu 04c713623a Release v5.1.2
This release fixes mixer to force the runc runtime on docker runs, which
supports host networking.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.1.2
2018-08-21 02:06:38 -07:00
Tudor Marcu 26fe8cec93 Force runc runtime in docker
The default runtime in upstream Clear will be set to the kata runtime,
which does not support host networking. This is needed for mixer, so we
must force --runtime=runc during all docker runs.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-21 02:01:54 -07:00
Tudor Marcu 5225ad0da8 Release v5.1.1
This release fixes a data race which cause concurrent map read/writes
when resolving packages and bundles. Versioning is also moved into the
Makefile so it does not have to be updated in the source code anymore,
and added at compile time.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.1.1
2018-08-16 23:33:13 -07:00
Matthew Johnson 3f03e34bb4 bundles: fix data race in building bundles
Two issues, first is resolved by renaming the error variable so a
goroutine isn't sharing err from outer scope with all other goroutines.

The second issue is resolved by using a sync.Map to safely read and
write to a map via the Range function.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-08-16 12:29:46 -07:00
Alex Jaramillo 03dc57ba32 Using ldflags for mixer version string
This change moves the setting of mixer version string from source code
to a variable defined during compilation. This approach is preferable
because:

1- builder.go does not need to change just to change version though
   functionally is the same.
2- simplifies logic in Makefile, no need to retrieve value from source.
2018-08-15 14:50:07 -07:00
Tudor Marcu 9d39305586 Release v5.1.0
This release adds more customizability of the DNF conf through the mixer
command line, adds a --clean option and does not wipe the outputdir by default
when re-running a 'build' command for the same build number, switches to zstd
compression for delta packs, and adds misc fixes to internal code structure.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.1.0
2018-08-12 13:28:17 -07:00
Matthew Johnson bed2e36a3c repo: add use-case to exclude long text
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-08-09 17:31:09 -07:00
Tudor Marcu d2e466446c Add excludepkgs option to repo command
This features may help users guarantee correctness of bundles built by mixer in
lieu of some shortcomings with dnf where dnf produces an unexpected dependency
solution. This mainly happens when a user is intending to fully substitute
a package from upstream's repo with one from their own. If anything is wrong
with the substitution, a feature like this would expose the issue early on.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-09 16:50:26 -07:00
Tudor Marcu 9024eb61fd Don't wipe output dirs on build bundles
By default, build bundles removes image/ver and www/ver, so that builds
of the same number start with a clean slate. There are specific use cases
where this is not desirable, and the statedir already has a version folder
populated/mounted which shouldn't be wiped. This allows mixer to write
the full chroot into an actual mounted file system for example that is
attached to update/image/VER/full.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-09 16:09:54 -07:00
Tudor Marcu 9e421237c4 Add zstd to reader
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-09 15:43:26 -07:00
Tudor Marcu b114ee237b Update validate-swupd.sh script to use --native
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-09 15:43:26 -07:00
Tudor Marcu 57984ec946 Switch to zstd compression in pack creation
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-09 15:43:26 -07:00
Matthew Johnson 7b1b61b2e9 swupd: also export GetBundleInfo
Export the GetBundleInfo file so other packages can use it. Simplify
function signature so it doesn't need a swupd config file.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-08-09 15:26:36 -07:00
Matthew Johnson 17261fdeab swupd: export BundleInfo struct
This is useful for other projects trying to use the *-info file.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-08-09 15:26:36 -07:00
Tudor Marcu 6be6db5f2c Fix divide by zero when no previous manifests
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-09 15:25:56 -07:00
Matthew Johnson d67f98fba1 swupd: export IndexBundle for external use
Other packages want to use the IndexBundle const to skip processing this
manifest for some validation cases.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-08-08 18:15:06 -07:00
Tudor Marcu f54811ae46 Use cobra for exact args limits
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-08-07 11:59:47 -07:00
Patrick McCarty 72ac332ae5 Remove hardlink dependency check
Mixer does not use the hardlink binary anymore, so these dependency
checks can be removed.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-08-03 17:03:52 -07:00
Tudor Marcu 4b2e640ddc Release v5.0.2
This release fixes several bugs dealing with running in a docker
container, and provides better warnings/error messages when the
environment and conf are not setup correctly.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-31 10:57:39 -07:00
Tudor Marcu 03626db926 Update man pages with --native
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-31 10:57:39 -07:00
Rodrigo Chiossi 99eed0a84c docker: Pull image before running
If the docker image for a given format is updated, users with cached
version of the image may keep running in the older version.
This patch makes sure mixer tries to pull an updated version before
running. If the pull fails, mixer will print a warning instead of
failing to allow users with cached images to keep building offline.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-31 10:26:24 -07:00
Rodrigo Chiossi f403a7f200 docker: Fail on missing image name
If DOCKER_IMAGE_PATH is not set, the docker command will be malformed
and the user will receive a cryptic message.
This patch makes sure mixer fails early and provides the user an
informative error.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-31 10:26:24 -07:00
Rodrigo Chiossi 08e447cb08 config: Add missing default value for docker
The default value for DOCKER_IMAGE_PATH was only set for the old INI
config. As a result, TOML configs would have an empty path that would
generate an invalid docker command to be issued.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-31 10:01:15 -07:00
Rodrigo Chiossi 0784623cdb cmd: Add --format flag to mixer init
The --format flag allows a custom format to be provided to a mix on
initialization

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-27 16:45:47 -07:00
Tudor Marcu 68274c4257 Release v5.0.1
This release fixes issues with setting up the new mixer.state file. The
file now correctly transfers over the FORMAT version from the builder.conf,
falling back to the system /usr/share/defaults/swupd/format, and only then
defaulting to "1".
Deletes now persist in manifests over minversions. The only time they should
be removed is when performing a format bump.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.0.1
2018-07-26 10:51:45 -07:00
Tudor Marcu a3b75315e0 Remove LD_PRELOAD
The new dnf release in Clear now does this by default, so we do not have to
load the nosync library anymore.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-26 10:45:41 -07:00
Rodrigo Chiossi d25ce44708 config: Add default values on conversion
When config is created during mixer init, default values are set for
all variables. To mimic this behavior, LoadDefaults must be called on
conversion as well.
There is also no need to perform a conversion if the parsed version
number is the same as the current version number.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-26 10:28:22 -07:00
Rodrigo Chiossi a5099994ed config: Set config version on conversion
The old INI config does not have versioning, so when performing a
conversion, it needs to be set.
Also, since now the config format is identified on parsing, there is no
need to force Old Config when starting the conversion. This allows the
convert command to also convert between different TOML versions

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-26 10:28:22 -07:00
Rodrigo Chiossi 82513c2ed5 bats: Properly check for format version bump
The default value for FORMAT is not always 1 anymore, so instead of
checking if the bumped format is 2, we need to check if it is 1 more
than the initial format.

Temp commit - DO NOT MERGE

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-26 10:24:16 -07:00
Rodrigo Chiossi f8522e5731 state: Better default values for FORMAT
Instead of always using '1' as the default FORMAT value, check first if
the value was available in a legacy config. If not, try using the system
format instead. If both fail, fallback to the hardcoded value as it was
previously done.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-26 10:24:16 -07:00
Matthew Johnson 930a12be14 swupd: do not persist deletes over format bumps
Format bumps ensure clients will get the proper delete record before
continuing to the new format. Trim the records so our manifests stay a
reasonable size.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-26 10:23:42 -07:00
Matthew Johnson ccaf3d8f67 swupd: add test for trimmed deletes over format bump
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-26 10:23:42 -07:00
Matthew Johnson 5efb5e52f4 swupd: persist deletes over minversion
It is important for deletes to persist over minversions because
minversions are not necessarily tied to format bumps (which force
clients to get the deletes before cleaning them up).

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-26 10:23:42 -07:00
Matthew Johnson 23a263a0fb swupd: add test for persistent deletes over minversions
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-26 10:23:42 -07:00
Tudor Marcu 66b2f6ff6d Release v5.0.0
This release introduces major changes to the way Mixer is called and
run. Previously, mixer gained support for automatically building format
bumps, but was disabled by default (with --native=true always turned
on). The flag forces mixer to run natively on the system, and not
perform format bump builds automatically. With this release, the default
becomes --native=false, meaning all mixer 'build' commands will run in a
docker container. Running in a container ensures the proper version of
the tooling is run for specific build versions, because one version of
tooling cannot build for 2 different formats.

Mixer will automatically pull the appoproriate container that can create
builds for a given format, so the format bump process can truly be
automated and correct. It will still use a container for regular,
non-format bump builds for consistency.

Note that aside from the initial docker pull,
creating a mix will not be any slower than running natively, and allows
users to build versions that require tooling outside of their
host system version.

Another significant change involves the configuration for Mixer. The
builder.conf is now updated to be a stable, relatively unchanging
config to describe your workspace. The stateful items (versions, format,
etc) are moved into a mixer.state file which holds ephemeral values that
are changed build-to-build. This keeps all stateless and stateful items
centralized and follows a single format (TOML). The new format is used
by default, but can be overridden by setting --new-config=false during
the init phase. Both configs are versioned so mixer can easily detect
format changes and config errors.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.0.0
2018-07-23 14:40:13 -07:00
Tudor Marcu a8a0573a51 Set native to false for 5.0.0 release
With native false, mixer will run in a container by default, so update
the bat tests to run native since they already will run in a container.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-23 14:39:43 -07:00
Tudor Marcu 967a29f6a6 Use -stable- URL for 3rd party RPM
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-23 11:38:26 -07:00
Rodrigo Chiossi 165da8f44e config: Set new config as default
Use TOML format as the default mixer format. The INI format can still be
used by setting the --new-config flag to false during init.

This change also makes TOML the default format for the bat tests.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-20 15:39:27 -07:00
Rodrigo Chiossi 069ac66370 config: Add config type detection
Instead of relying on a user provided parameter, try to parse the
builder conf in all formats that mixer understands and assume the format
from there. Currently it can be "TOML with version", "TOML without
version" or "INI".

With this change, once the mix is initialized with 'mixer init', there
is no need to pass the --new-config flag around anymore.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-20 15:39:27 -07:00
Rodrigo Chiossi 0761530742 config: Add versioning to new config
This patch adds a new comment line on top of new config to specify the
current file format for that config.

With this change, new config files are expected to start with
\#VERSION X.X
where X are integer values.

This patch also change the encoding and decoding of toml to use the
io.Reader and io.Writer interfaces instead of a filename. This allows
the version to be read/write before the toml is processed.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-20 15:39:27 -07:00
Rodrigo Chiossi d2f562dae6 config: Add mixer.state file
The mixer.state file holds the temporary values used or produced between
mixes or mixes steps. The format variable was the only transient
variable in builder.conf so it was moved to this new state file.
This file should hold all transient values. All the temporary files
should be centralized on this new state file.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-20 15:39:27 -07:00
Tudor Marcu 9a57b01b86 Release v4.7.0
This release enables parallel manifest creation in parts of swupd during
build update.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v4.7.0
2018-07-20 13:14:11 -07:00
Matthew Johnson 0a8b67e498 swupd: remove format decrement test
The test was only passing because err != nil for a reason other than the
expected reason. The test is no longer even relevant because format
changes are now required for automated format bump.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-18 12:36:32 -07:00
Matthew Johnson 8d285c8eb0 swupd: handle full last and lock tmpManifests
Solve a race issue by locking tmpManifests before appending to it.

Process the full manifest last in case the rsync fallback (bundle
chroots provided instead of bundle-info files) is used. Obviously all
this rsyncing must be done before handling the full chroot.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-18 12:36:32 -07:00
Matthew Johnson cf96713bd0 builder: parallelize manifest compression step
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-18 12:36:32 -07:00
Matthew Johnson 1ad591eac9 swupd: parallelize part of manifest creation
Parallelize the manifest initiation step which reads in all file
information from the full chroot.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-18 12:36:32 -07:00
Matthew Johnson 9864ed4c7c swupd: add status prints for manifest creation
The output for 'build update' cuts off after initial manifest processing
and leaves no status messages for a very long time. Put in a few
messages so users don't think it is hanging after it says all manifests
are done being processed.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-18 12:36:32 -07:00
Matthew Johnson 58f82e73d3 builder: fix capitalization of deprecated commands
MarkDeprecated constructs a deprecation message as follows:

<flag> has been deprecated, <message>

So message should not have leading capitalization.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-07-18 12:32:41 -07:00
Tudor Marcu e4d4d3ba86 Release v4.6.7
This release updates mixer to build slim packs across minversions, reducing the
pack download size for clients and saving space on our infrastructure. Mixer
also properly avoids making a network connection except for commands that
absolutely need it.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v4.6.7
2018-07-06 16:10:20 -07:00
Tudor Marcu c0e7a72b76 Do not hit the network for some commands
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-06 16:03:51 -07:00