Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend support for variant builds #578

Merged
merged 6 commits into from
Dec 13, 2019
Merged

extend support for variant builds #578

merged 6 commits into from
Dec 13, 2019

Conversation

bcressey
Copy link
Contributor

@bcressey bcressey commented Dec 9, 2019

Issue #, if available:
N/A

Description of changes:
This standardizes on the "variant" term (vs "image" or "flavor") and adds a developer variant that includes debugging tools (and a shell).

Testing done:

  • Built the default image with cargo make.
  • Built the developer image with cargo make world -e BUILDSYS_VARIANT=aws-dev
  • Ran both under KVM.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bcressey bcressey requested a review from tjkirch December 9, 2019 16:47
@bcressey bcressey mentioned this pull request Dec 9, 2019
Copy link
Contributor

@tjkirch tjkirch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other docs with "flavor" references:

  • workspaces/updater/README.md
  • workspaces/updater/updog/README.md

packages/release/release.spec Show resolved Hide resolved
packages/release/release.spec Show resolved Hide resolved
tools/rpm2img Show resolved Hide resolved
@@ -1,5 +1,5 @@
/*!
This tool carries out a package or image build using Docker.
This tool carries out a package or variant build using Docker.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I have to admit I'm hesitant about a s/image/variant/g in prose. It's not clear whether "variant" refers to a variant of a package, or what; it's clearer as an adjective. (I guess not just prose; for example, VariantBuilder is confusing to me.) I would lean toward using "image" when there's no confusion, "image variant" when there's potential confusion of image types, "OS image variant" when there's potential confusion with containers, and "variant" alone only when it's clear we're already talking about image types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel like this is a perfect approach by any means. I tend to err on the side of terseness if I'm not confident that verbosity would be better.

I expect "image" is always going to be ambiguous; even when it's clear we're talking about the OS, we create three images as well as a combined one, and arguably it's the set of three that's most essential.

"OS variant" seems best to me as it avoids the "image" term. But it's a bit pretentious to talk about building an OS when we're building a Linux distribution, and neither "distribution variant" or "distro variant" resonated with me.

Hence I ended up with "variant" as a singular noun to describe the composite output of each invocation of the build system.

I admit I didn't have "package variants" in mind as a concept, but I would just call that "multiple major versions of a package" and not assign it a specific term.

@sam-aws
Copy link
Contributor

sam-aws commented Dec 10, 2019

workspaces/updater/update_metadata/src/lib.rs

This shouldn't be changed until we're ready for a change in manifest format.

Previously we referred to custom OS builds as "images" or "flavors".
Images as a term isn't accurate - we produce multiple filesystem and
disk images for each build. Flavors is better, but is arguably a
project-specific term for a more general concept.

This introduces the term "variant" for our custom builds, which aligns
with the corresponding field in the os-release file, and fixes up the
build logic to match.

Signed-off-by: Ben Cressey <[email protected]>
This lets us omit the getty units in variants that do not include a
shell and do not support console login.

Signed-off-by: Ben Cressey <[email protected]>
@bcressey bcressey merged commit 5305a41 into develop Dec 13, 2019
@bcressey bcressey deleted the variants branch December 13, 2019 21:04
tjkirch added a commit that referenced this pull request Dec 16, 2019
Pull #578 added support for build variants to support different features and
use cases, starting with aws-k8s and aws-dev.  These variants use different
software, and therefore need different configuration.  This change allows for
having a different API model (and default values) per variant.

The model was moved to workspaces/models.  This crate actually contains the
model for each variant in separate subdirectories.  Cargo's `build.rs` is used
to symlink in the proper source code before build.

The "proper" source code is chosen using the VARIANT environment variable.  The
build system passes this through using the value of BUILDSYS_VARIANT, which is
set in the top-level Makefile.toml and can be overridden on the command-line.
For local cargo builds, the developer must set the VARIANT environment
variable; we don't currently want to choose a default model.

To start out, the aws-k8s and aws-dev models (and related default values) are
copies, with aws-dev having the Kubernetes-related values removed.  The next
step is to figure out an appropriate method for sharing structure; until then,
we'll need to duplicate most changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants