Skip to content

Commit

Permalink
Don't expire ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Jun 13, 2024
2 parents 6e1dfd9 + 306b767 commit e008c8c
Show file tree
Hide file tree
Showing 138 changed files with 4,679 additions and 1,173 deletions.
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/a4x2-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "a4x2-prepare"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.78.0"
#: rust_toolchain = true
#: output_rules = [
#: "=/out/cargo-bay-ce.tgz",
#: "=/out/cargo-bay-cr1.tgz",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/build-and-test-helios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "build-and-test (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.78.0"
#: rust_toolchain = true
#: output_rules = [
#: "%/work/*",
#: "%/var/tmp/omicron_tmp/*",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/build-and-test-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "build-and-test (ubuntu-22.04)"
#: variety = "basic"
#: target = "ubuntu-22.04"
#: rust_toolchain = "1.78.0"
#: rust_toolchain = true
#: output_rules = [
#: "%/work/*",
#: "%/var/tmp/omicron_tmp/*",
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "clippy (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.78.0"
#: rust_toolchain = true
#: output_rules = []

# Run clippy on illumos (not just other systems) because a bunch of our code
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ infra_ip_last = \"$UPLINK_IP\"
/^routes/c\\
routes = \\[{nexthop = \"$GATEWAY_IP\", destination = \"0.0.0.0/0\"}\\]
/^addresses/c\\
addresses = \\[\"$UPLINK_IP/24\"\\]
addresses = \\[{address = \"$UPLINK_IP/24\"} \\]
}
" pkg/config-rss.toml
diff -u pkg/config-rss.toml{~,} || true
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/omicron-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "omicron-common (helios)"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.78.0"
#: rust_toolchain = true
#: output_rules = []

# Verify that omicron-common builds successfully when used as a dependency
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "helios / package"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.78.0"
#: rust_toolchain = true
#: output_rules = [
#: "=/work/package.tar.gz",
#: ]
Expand Down
2 changes: 1 addition & 1 deletion .github/buildomat/jobs/tuf-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#: name = "helios / build TUF repo"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "1.78.0"
#: rust_toolchain = true
#: output_rules = [
#: "=/work/manifest.toml",
#: "=/work/repo.zip",
Expand Down
25 changes: 25 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"bootstore",
"certificates",
"clients/bootstrap-agent-client",
"clients/cockroach-admin-client",
"clients/ddm-admin-client",
"clients/dns-service-client",
"clients/dpd-client",
Expand Down Expand Up @@ -89,6 +90,7 @@ default-members = [
"bootstore",
"certificates",
"clients/bootstrap-agent-client",
"clients/cockroach-admin-client",
"clients/ddm-admin-client",
"clients/dns-service-client",
"clients/dpd-client",
Expand Down Expand Up @@ -239,6 +241,7 @@ ciborium = "0.2.2"
cfg-if = "1.0"
chrono = { version = "0.4", features = [ "serde" ] }
clap = { version = "4.5", features = ["cargo", "derive", "env", "wrap_help"] }
cockroach-admin-client = { path = "clients/cockroach-admin-client" }
colored = "2.1"
const_format = "0.2.32"
cookie = "0.18"
Expand Down
18 changes: 18 additions & 0 deletions clients/cockroach-admin-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "cockroach-admin-client"
version = "0.1.0"
edition = "2021"
license = "MPL-2.0"

[lints]
workspace = true

[dependencies]
chrono.workspace = true
omicron-uuid-kinds.workspace = true
progenitor.workspace = true
reqwest = { workspace = true, features = [ "json", "rustls-tls", "stream" ] }
schemars.workspace = true
serde.workspace = true
slog.workspace = true
omicron-workspace-hack.workspace = true
24 changes: 24 additions & 0 deletions clients/cockroach-admin-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Interface for making API requests to an Omicron CockroachDB admin server

progenitor::generate_api!(
spec = "../../openapi/cockroach-admin.json",
inner_type = slog::Logger,
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
slog::debug!(log, "client request";
"method" => %request.method(),
"uri" => %request.url(),
"body" => ?&request.body(),
);
}),
post_hook = (|log: &slog::Logger, result: &Result<_, _>| {
slog::debug!(log, "client response"; "result" => ?result);
}),
derives = [schemars::JsonSchema],
replace = {
TypedUuidForOmicronZoneKind = omicron_uuid_kinds::OmicronZoneUuid,
}
);
43 changes: 43 additions & 0 deletions clients/nexus-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,49 @@ impl From<omicron_common::api::internal::nexus::SledInstanceState>
instance_state: s.instance_state.into(),
propolis_id: s.propolis_id,
vmm_state: s.vmm_state.into(),
migration_state: s.migration_state.map(Into::into),
}
}
}

impl From<omicron_common::api::internal::nexus::MigrationRuntimeState>
for types::MigrationRuntimeState
{
fn from(
s: omicron_common::api::internal::nexus::MigrationRuntimeState,
) -> Self {
Self {
migration_id: s.migration_id,
role: s.role.into(),
state: s.state.into(),
gen: s.gen,
time_updated: s.time_updated,
}
}
}

impl From<omicron_common::api::internal::nexus::MigrationRole>
for types::MigrationRole
{
fn from(s: omicron_common::api::internal::nexus::MigrationRole) -> Self {
use omicron_common::api::internal::nexus::MigrationRole as Input;
match s {
Input::Source => Self::Source,
Input::Target => Self::Target,
}
}
}

impl From<omicron_common::api::internal::nexus::MigrationState>
for types::MigrationState
{
fn from(s: omicron_common::api::internal::nexus::MigrationState) -> Self {
use omicron_common::api::internal::nexus::MigrationState as Input;
match s {
Input::Pending => Self::Pending,
Input::InProgress => Self::InProgress,
Input::Completed => Self::Completed,
Input::Failed => Self::Failed,
}
}
}
Expand Down
44 changes: 43 additions & 1 deletion clients/sled-agent-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ progenitor::generate_api!(
BgpConfig = { derives = [Eq, Hash] },
BgpPeerConfig = { derives = [Eq, Hash] },
OmicronPhysicalDiskConfig = { derives = [Eq, Hash, PartialOrd, Ord] },
PortConfigV1 = { derives = [Eq, Hash] },
PortConfigV2 = { derives = [Eq, Hash] },
RouteConfig = { derives = [Eq, Hash] },
UplinkAddressConfig = { derives = [Eq, Hash] },
VirtualNetworkInterfaceHost = { derives = [Eq, Hash] },
},
crates = {
Expand Down Expand Up @@ -327,6 +328,47 @@ impl From<types::SledInstanceState>
instance_state: s.instance_state.into(),
propolis_id: s.propolis_id,
vmm_state: s.vmm_state.into(),
migration_state: s.migration_state.map(Into::into),
}
}
}

impl From<types::MigrationRuntimeState>
for omicron_common::api::internal::nexus::MigrationRuntimeState
{
fn from(s: types::MigrationRuntimeState) -> Self {
Self {
migration_id: s.migration_id,
state: s.state.into(),
role: s.role.into(),
gen: s.gen,
time_updated: s.time_updated,
}
}
}

impl From<types::MigrationRole>
for omicron_common::api::internal::nexus::MigrationRole
{
fn from(r: types::MigrationRole) -> Self {
use omicron_common::api::internal::nexus::MigrationRole as Output;
match r {
types::MigrationRole::Source => Output::Source,
types::MigrationRole::Target => Output::Target,
}
}
}

impl From<types::MigrationState>
for omicron_common::api::internal::nexus::MigrationState
{
fn from(s: types::MigrationState) -> Self {
use omicron_common::api::internal::nexus::MigrationState as Output;
match s {
types::MigrationState::Pending => Output::Pending,
types::MigrationState::InProgress => Output::InProgress,
types::MigrationState::Failed => Output::Failed,
types::MigrationState::Completed => Output::Completed,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions clients/wicketd-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ progenitor::generate_api!(
GetLocationResponse = { derives = [PartialEq, Eq, PartialOrd, Ord] },
ImageVersion = { derives = [PartialEq, Eq, PartialOrd, Ord]},
RackInitId = { derives = [PartialEq, Eq, PartialOrd, Ord] },
RackNetworkConfigV1 = { derives = [PartialEq, Eq, PartialOrd, Ord] },
RackNetworkConfigV2 = { derives = [PartialEq, Eq, PartialOrd, Ord] },
RackOperationStatus = { derives = [PartialEq, Eq, PartialOrd, Ord] },
RackResetId = { derives = [PartialEq, Eq, PartialOrd, Ord] },
RackV1Inventory = { derives = [PartialEq, Eq, PartialOrd, Ord]},
Expand Down Expand Up @@ -62,7 +62,7 @@ progenitor::generate_api!(
Ipv4Range = omicron_common::address::Ipv4Range,
Ipv6Range = omicron_common::address::Ipv6Range,
M2Slot = installinator_common::M2Slot,
PortConfigV1 = omicron_common::api::internal::shared::PortConfigV1,
PortConfigV2 = omicron_common::api::internal::shared::PortConfigV2,
PortFec = omicron_common::api::internal::shared::PortFec,
PortSpeed = omicron_common::api::internal::shared::PortSpeed,
ProgressEventForGenericSpec = update_engine::events::ProgressEvent<update_engine::NestedSpec>,
Expand Down
8 changes: 8 additions & 0 deletions cockroach-admin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ dropshot.workspace = true
http.workspace = true
illumos-utils.workspace = true
omicron-common.workspace = true
omicron-uuid-kinds.workspace = true
once_cell.workspace = true
# See omicron-rpaths for more about the "pq-sys" dependency.
pq-sys = "*"
schemars.workspace = true
Expand All @@ -27,13 +29,19 @@ slog-error-chain.workspace = true
serde.workspace = true
thiserror.workspace = true
tokio.workspace = true
tokio-postgres.workspace = true
toml.workspace = true

omicron-workspace-hack.workspace = true

[dev-dependencies]
expectorate.workspace = true
nexus-test-utils.workspace = true
omicron-test-utils.workspace = true
openapi-lint.workspace = true
openapiv3.workspace = true
serde_json.workspace = true
subprocess.workspace = true
url.workspace = true

[lints]
Expand Down
Loading

0 comments on commit e008c8c

Please sign in to comment.