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

Extract artifacts config #480

Merged
merged 9 commits into from
Jul 3, 2024

Conversation

atanasdinov
Copy link
Contributor

@atanasdinov atanasdinov commented Jul 1, 2024

Introduces a new configuration file (artifacts.yaml) which will serve to contain all options for the artefacts deployed via EIB. The file will be shipped with each release in both upstream and downstream builds. It is possible to override these values via the newly introduced CLI args.

Listing all options:

$ podman run --rm --privileged -it -v .:/eib eib:dev build -h
NAME:
   eib build - Build new image

USAGE:
   eib build [OPTIONS]

OPTIONS:
   --build-dir value        Full path to the directory to store build artifacts
   --config-dir value       Full path to the image configuration directory (default: "/eib")
   --definition-file value  Name of the image definition file

   Artifact sources

   --elemental-register.repository value        Address of the elemental-register RPM repository
   --elemental-system-agent.repository value    Address of the elemental-system-agent RPM repository
   --endpoint-copier-operator.chart value       Name of the Endpoint Copier Operator Helm chart
   --endpoint-copier-operator.repository value  Address of the Endpoint Copier Operator Helm repository
   --endpoint-copier-operator.version value     Version of the Endpoint Copier Operator Helm chart
   --metallb.chart value                        Name of the MetalLB Helm chart
   --metallb.repository value                   Address of the MetalLB Helm repository
   --metallb.version value                      Version of the MetalLB Helm chart

Building an image with custom source values:

$ podman run --rm --privileged -it -v .:/eib eib:dev build --definition-file definition.yaml --metallb.repository oci://registry.suse.com/edge --metallb.chart metallb-chart

$ cat _build/build-Jul01_15-12-10/helm-repo-add.log
command: /usr/bin/helm repo add suse-edge-endpoint-copier-operator https://suse-edge.github.io/charts
"suse-edge-endpoint-copier-operator" has been added to your repositories

$ cat _build/build-Jul01_15-12-10/helm-pull.log
command: /usr/bin/helm pull oci://registry.suse.com/edge/metallb-chart --version 0.14.3 --destination /eib/_build/build-Jul01_15-12-10/helm/metallb-chart
Pulled: registry.suse.com/edge/metallb-chart:0.14.3
Digest: sha256:8d2987490f7321b3271c950525a203ac4c5b54520fc22c8d5e5cd17e182b2990
command: /usr/bin/helm pull suse-edge-endpoint-copier-operator/endpoint-copier-operator --version 0.2.0 --destination /eib/_build/build-Jul01_15-12-10/helm/endpoint-copier-operator

EDIT: Customising the default artifact sources will be introduced at a later point when we have more context for a better design decision.

Closes #419

@atanasdinov atanasdinov linked an issue Jul 1, 2024 that may be closed by this pull request
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
@atanasdinov atanasdinov marked this pull request as ready for review July 1, 2024 16:50
@atanasdinov atanasdinov requested review from jdob and dbw7 July 1, 2024 16:51
@jdob
Copy link
Contributor

jdob commented Jul 1, 2024

I worry about adding each override as an individual flag. I think it has the potential to get out of control, and the flags chosen are pretty verbose (though I totally see why you chose them).

I think we'd be better served with a single flag, something like --artifacts-override-file (not wed to that name, but come with me on the concept). In that, the user can use the same structure as the default artifacts.yaml file. We can merge the two in a pre-processing step, with any user-specified value taking priority over the defaults.

That has a few effects:

  • It makes it simpler for people using overrides. Yes, it means more files, but I think that is a better option -- and less error prone -- than an extremely verbose series of command arguments.
  • It puts the configuration into a file which can be version controlled, instead of it existing ephemerally at build time.
  • I suspect we're going to need the option to override more things in the future. We've talked about resisting the idea of .eibrc or eib-config.yaml as long as we can, but if we have that need in the future, if we start that model with the artifacts, it'll be consistent if we end up adding the general EIB config file. Admittedly, this is too speculative to use as a rationale in and of itself, but since I think the previous points are justification enough, I'm mentioning this as well.

artifacts.yaml Outdated Show resolved Hide resolved
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
@atanasdinov atanasdinov merged commit 550260a into suse-edge:main Jul 3, 2024
3 checks passed
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.

Make component Helm charts configurable at build time
2 participants