Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,25 @@ jobs:
- name: Run Protolint
run: protolint lint -config_path=.protolint.yaml crates/rpc/proto/

migration-police:
permissions:
contents: read
needs:
- changes
if: ${{ contains(github.ref, 'pull-request/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Check new migration timestamps
run: |
git fetch --no-tags origin main:refs/remotes/origin/main
bash scripts/check-migration-filenames.sh --base origin/main

proto-breaking-changes:
name: Proto Breaking Changes Check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -2059,6 +2078,7 @@ jobs:
- build-release-artifacts-arm-host
- security-secret-scan
- lint-police
- migration-police
- check-rest-core-proto-sync
- build-machine-a-tron
- build-mat-k8s-controller
Expand Down
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ verification expectations.
See [`STYLE_GUIDE.md`](STYLE_GUIDE.md) for detailed Rust coding conventions.
Make sure to review it to ensure changes meet the expected style of the codebase.

Name new Core database migrations with the fully populated
`YYYYMMDDhhmmss_description.sql` format described in
[`STYLE_GUIDE.md`](STYLE_GUIDE.md#database-migrations). The `migration-police`
CI job checks only newly added migrations, so existing filenames remain accepted.

### Documentation

Give every fenced code block a language identifier. Use `bash` or `sh` for
Expand Down
29 changes: 17 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repository = "https://github.com/NVIDIA/infra-controller"

[workspace.dependencies]
clap = { version = "4", features = ["derive", "env"] }
libredfish = { git = "https://github.com/NVIDIA/libredfish.git", tag = "v0.45.1" }
libredfish = { git = "https://github.com/NVIDIA/libredfish.git", tag = "v0.46.1" }
librms = { git = "https://github.com/NVIDIA/nv-rms-client.git", tag = "v0.10.0" }
ansi-to-html = "0.2.2"

Expand Down
8 changes: 8 additions & 0 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ your interface `async` just so you can use the tokio Mutex. That way callers can
async themselves. Async work should generally be traceable to some I/O or timer that needs to be used, otherwise
code should typically be synchronous.

## Database migrations

Name new Core database migration files with a fully populated 14-digit timestamp:
`YYYYMMDDhhmmss_description.sql`. Use the actual hour, minute, and second values instead of a
trailing `0000` minute-and-second placeholder so independently authored migrations are less likely
to collide. Existing migration filenames remain unchanged, and migrations already on `main` are
immutable.

## Database transactions

Transactions should be used to group write operations together such that they can be rolled back on failure. But do
Expand Down
33 changes: 20 additions & 13 deletions crates/admin-cli/src/credential/force_bmc/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ Force an immediate credential rotation by machine ID:
Force a switch BMC by switch ID:
$ nico-admin-cli credential force-bmc set --id sw100nt038bg3qsho433vkg684heguv282qaggmrsh2ugn1qk096n2c6hcg

Force it by BMC MAC instead (machine or switch):
Force a power shelf BMC (PMC) by power shelf ID:
$ nico-admin-cli credential force-bmc set --id ps100ht038bg3qsho433vkg684heguv282qaggmrsh2ugn1qk096n2c6hcg

Force it by BMC MAC instead (machine, switch, or power shelf):
$ nico-admin-cli credential force-bmc set --bmc-mac 00:11:22:33:44:55

Clear a pending force-converge request:
Expand All @@ -40,13 +43,11 @@ Clear a pending force-converge request:
")]
pub enum Args {
#[clap(
about = "Request an immediate BMC credential rotation. Machines and switches are \
supported; power shelf IDs are accepted but not yet supported."
about = "Request an immediate BMC credential rotation of a machine, switch, or power shelf."
)]
Set(ForceSet),
#[clap(
about = "Clear a pending BMC force-converge request. Machines and switches are supported; \
power shelf IDs are accepted but not yet supported."
about = "Clear a pending BMC force-converge request for a machine, switch, or power shelf."
)]
Clear(ForceClear),
}
Expand All @@ -61,7 +62,10 @@ Force-converge a machine BMC now by machine ID:
Force-converge a switch BMC now by switch ID:
$ nico-admin-cli credential force-bmc set --id sw100nt038bg3qsho433vkg684heguv282qaggmrsh2ugn1qk096n2c6hcg

Force-converge a BMC now by BMC MAC (machine or switch):
Force-converge a power shelf BMC (PMC) now by power shelf ID:
$ nico-admin-cli credential force-bmc set --id ps100ht038bg3qsho433vkg684heguv282qaggmrsh2ugn1qk096n2c6hcg

Force-converge a BMC now by BMC MAC (machine, switch, or power shelf):
$ nico-admin-cli credential force-bmc set --bmc-mac 00:11:22:33:44:55

")]
Expand All @@ -71,14 +75,13 @@ pub struct ForceSet {
long,
required_unless_present_any = ["bmc_mac"],
help = "ID of the machine, DPU, switch, or power shelf that owns the BMC. \
Power shelf IDs are allowed for forward compatibility but are not yet supported. \
Provide this or --bmc-mac."
)]
pub id: Option<DeviceId>,

#[clap(
long,
help = "MAC of the BMC to target (machine or switch). Provide this \
help = "MAC of the BMC to target (machine, switch, or power shelf). Provide this \
or --id; if an id is also given they must identify the same device."
)]
pub bmc_mac: Option<MacAddress>,
Expand All @@ -104,6 +107,9 @@ Clear a pending force-converge request by machine ID:
Clear a pending force-converge request by switch ID:
$ nico-admin-cli credential force-bmc clear --id sw100nt038bg3qsho433vkg684heguv282qaggmrsh2ugn1qk096n2c6hcg

Clear a pending force-converge request by power shelf ID:
$ nico-admin-cli credential force-bmc clear --id ps100ht038bg3qsho433vkg684heguv282qaggmrsh2ugn1qk096n2c6hcg

Clear a pending force-converge request by BMC MAC:
$ nico-admin-cli credential force-bmc clear --bmc-mac 00:11:22:33:44:55

Expand All @@ -114,8 +120,7 @@ pub struct ForceClear {
long,
required_unless_present_any = ["bmc_mac"],
help = "Machine, DPU, switch, or power shelf ID whose pending BMC force-converge request \
should be cleared. Power shelf IDs are allowed for forward compatibility but are \
not yet supported. Provide this or --bmc-mac."
should be cleared. Provide this or --bmc-mac."
)]
pub id: Option<DeviceId>,

Expand Down Expand Up @@ -171,9 +176,11 @@ mod tests {
}

#[test]
fn power_shelf_limit_is_documented() {
fn power_shelf_is_a_documented_target() {
let help = ForceSet::command().render_long_help().to_string();
assert!(help.contains("Power shelf IDs are allowed for forward compatibility"));
assert!(help.contains("not yet supported"));
assert!(
help.contains("power shelf"),
"force-bmc help should document power shelf as a supported target"
);
}
}
2 changes: 2 additions & 0 deletions crates/admin-cli/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ impl ApiClient {
.create_vpc(VpcCreationRequest {
vni: None,
routing_profile_type: None,
routing_profile_overrides: None,
tenant_organization_id: "devenv_test_org".to_string(),
tenant_keyset_id: None,
network_virtualization_type: Some(
Expand Down Expand Up @@ -1296,6 +1297,7 @@ impl ApiClient {
.create_vpc(VpcCreationRequest {
vni: None,
routing_profile_type: None,
routing_profile_overrides: None,
tenant_organization_id: "devenv_test_org".to_string(),
tenant_keyset_id: None,
network_virtualization_type: Some(VpcVirtualizationType::Flat.into()),
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/vpc/create/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl From<Args> for forge::VpcCreationRequest {
default_nvlink_logical_partition_id: None,
vni: None,
routing_profile_type: None,
routing_profile_overrides: None,
}
}
}
Loading
Loading