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

[4/n] [omicron-package] add and use target presets #7288

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Dec 20, 2024

The overall goal of this change is to ensure that all release-related
configuration is present in package-manifest.toml. This will allow linting and SBOM
generation based on this config, rather than the knowledge being scattered
across omicron-package and the releng tool.

This depends on several other pieces of work:

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
sunshowers added a commit to oxidecomputer/omicron-package that referenced this pull request Dec 21, 2024
Add a `target.preset` table which can be used to define presets for target
configuration. This will be used within omicron-package.

For how this will eventually be used, see
oxidecomputer/omicron#7288.
@sunshowers sunshowers changed the title [3/n draft] [omicron-package] add and use target presets [4/n draft] [omicron-package] add and use target presets Dec 21, 2024
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers marked this pull request as ready for review January 6, 2025 23:15
@sunshowers sunshowers changed the title [4/n draft] [omicron-package] add and use target presets [4/n] [omicron-package] add and use target presets Jan 6, 2025
@sunshowers sunshowers requested review from iliana and smklein January 6, 2025 23:17
Comment on lines 460 to 462
// Note: Do not override the preset here! All release targets
// must be configured entirely via the `target.preset` table
// in `package-manifest.toml`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is about the --preset arg value above, not the env_remove call, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I'll try making this clearer.

Comment on lines +949 to +971
[target.preset.host]
image = "standard"
machine = "gimlet"
switch = "asic"
rack-topology = "multi-sled"
clickhouse-topology = "single-node"

# A preset for the recovery image built during release.
[target.preset.recovery]
image = "trampoline"
# The trampoline image doesn't execute sled-agent and doesn't contain the switch
# zone, so neither "machine" nor "switch" are defined.
rack-topology = "single-sled"
clickhouse-topology = "single-node"

# A preset for development.
[target.preset.dev]
image = "standard"
machine = "non-gimlet"
switch = "softnpu"
rack-topology = "single-sled"
clickhouse-topology = "single-node"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is great, I think it's very straightforward to see these defined here!

@sunshowers sunshowers changed the base branch from sunshowers/spr/main.3n-draft-omicron-package-add-and-use-target-presets to main January 7, 2025 00:35
Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) January 7, 2025 00:36
Comment on lines +938 to +971
# Target configuration
# --------------------
#
# This section defines "targets" built by Omicron. A target is a map of keys and
# values that are used to filter out packages (via `only_for_targets`) and for
# other purposes.
#
# For what the individual keys mean, see the definition for `TargetCommand` in
# `package/src/lib.rs`.

# A preset for the host image built during release.
[target.preset.host]
image = "standard"
machine = "gimlet"
switch = "asic"
rack-topology = "multi-sled"
clickhouse-topology = "single-node"

# A preset for the recovery image built during release.
[target.preset.recovery]
image = "trampoline"
# The trampoline image doesn't execute sled-agent and doesn't contain the switch
# zone, so neither "machine" nor "switch" are defined.
rack-topology = "single-sled"
clickhouse-topology = "single-node"

# A preset for development.
[target.preset.dev]
image = "standard"
machine = "non-gimlet"
switch = "softnpu"
rack-topology = "single-sled"
clickhouse-topology = "single-node"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the presets are defined here.

@sunshowers sunshowers merged commit 390ac60 into main Jan 7, 2025
17 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/3n-draft-omicron-package-add-and-use-target-presets branch January 7, 2025 02:26
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.

2 participants