coreos / coreos/coreos-assembler

Move variant setup from `cosa init` to `cosa build`

Open
#3,276 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design enhancement jira
Dominant language
Go
Stars
393
Forks
193
Avg merge
17h 6m
Merged PRs (30d)
5

Description

Feature Request

Currently, the variant to build is specified at cosa init time and then stored in src/config.json and then read by all other cosa commands: https://github.com/coreos/coreos-assembler/blob/main/src/cmdlib.sh#L177

The variant is also stored in the meta.json after a cosa build but this is apparently not working right now for an uknown reason: https://github.com/coreos/coreos-assembler/blob/main/src/cmd-build#L467

As suggested by @jlebon, we could remove the duplication here by passing the variant as an argument to cosa build only instead and have all later steps & kola read the variant value from the meta.json value.

See:

We'll also have to change RHCOS CI to adapt to it: https://github.com/openshift/os/blob/master/ci/prow-entrypoint.sh
As well as the pipeline: https://github.com/coreos/fedora-coreos-pipeline

Proposed UX:

cosa init
cosa fetch --variant="rhel-9.0"
cosa build --variant="rhel-9.0"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/cmdlib.sh and src/cmd-build, tracing how the variant is stored in src/config.json and meta.json. Review the linked coreos-assembler and pipeline changes, plus RHCOS CI at ci/prow-entrypoint.sh. Done means the proposed init, fetch, and build workflow works and later commands and kola use the build metadata without the old init-time setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, shell
Domain
build-system, cli, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.