Skip to content

Commit

Permalink
Merge pull request bottlerocket-os#3963 from sumukhballal/metrics-set…
Browse files Browse the repository at this point in the history
…tings-extension

settings: add metrics settings extension
  • Loading branch information
sumukhballal authored May 21, 2024
2 parents f7a5677 + 10f4df0 commit 1353ea1
Show file tree
Hide file tree
Showing 26 changed files with 249 additions and 44 deletions.
22 changes: 22 additions & 0 deletions packages/settings-metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "settings-metrics"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
source-groups = [
"settings-extensions/metrics"
]

# RPM BuildRequires
[build-dependencies]
glibc = { path = "../glibc" }

# RPM Requires
[dependencies]

39 changes: 39 additions & 0 deletions packages/settings-metrics/settings-metrics.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
%global _cross_first_party 1
%undefine _debugsource_packages

%global extension_name metrics

Name: %{_cross_os}settings-%{extension_name}
Version: 0.0
Release: 0%{?dist}
Summary: settings-%{extension_name}
License: Apache-2.0 OR MIT
URL: https://github.com/bottlerocket-os/bottlerocket

BuildRequires: %{_cross_os}glibc-devel

%description
%{summary}.

%prep
%setup -T -c
%cargo_prep

%build
%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \
-p settings-extension-%{extension_name}

%install
install -d %{buildroot}%{_cross_libexecdir}
install -p -m 0755 \
${HOME}/.cache/%{__cargo_target}/release/settings-extension-%{extension_name} \
%{buildroot}%{_cross_libexecdir}

install -d %{buildroot}%{_cross_libexecdir}/settings
ln -sf \
../settings-extension-%{extension_name} \
%{buildroot}%{_cross_libexecdir}/settings/%{extension_name}

%files
%{_cross_libexecdir}/settings-extension-%{extension_name}
%{_cross_libexecdir}/settings/%{extension_name}
13 changes: 13 additions & 0 deletions sources/Cargo.lock

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

1 change: 1 addition & 0 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ members = [
"settings-extensions/aws",
"settings-extensions/container-registry",
"settings-extensions/kernel",
"settings-extensions/metrics",
"settings-extensions/motd",
"settings-extensions/ntp",
"settings-extensions/pki",
Expand Down
1 change: 1 addition & 0 deletions sources/models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ toml = "0.8"
settings-extension-aws = { path = "../settings-extensions/aws", version = "0.1" }
settings-extension-container-registry = { path = "../settings-extensions/container-registry", version = "0.1" }
settings-extension-kernel = { path = "../settings-extensions/kernel", version = "0.1" }
settings-extension-metrics = { path = "../settings-extensions/metrics", version = "0.1" }
settings-extension-motd = { path = "../settings-extensions/motd", version = "0.1" }
settings-extension-ntp = { path = "../settings-extensions/ntp", version = "0.1" }
settings-extension-pki = { path = "../settings-extensions/pki", version = "0.1" }
Expand Down
4 changes: 2 additions & 2 deletions sources/models/src/aws-dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;

use crate::{
BootSettings, BootstrapContainer, CloudFormationSettings, DnsSettings, HostContainer,
MetricsSettings, NetworkSettings, OciHooks,
NetworkSettings, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -20,7 +20,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_hooks: OciHooks,
Expand Down
4 changes: 2 additions & 2 deletions sources/models/src/aws-ecs-1-nvidia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootstrapContainer, CloudFormationSettings, DnsSettings, ECSSettings,
HostContainer, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
HostContainer, NetworkSettings, OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -20,7 +20,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
aws: settings_extension_aws::AwsSettingsV1,
ecs: ECSSettings,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
4 changes: 2 additions & 2 deletions sources/models/src/aws-ecs-1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootstrapContainer, CloudFormationSettings, DnsSettings, ECSSettings,
HostContainer, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
HostContainer, NetworkSettings, OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -20,7 +20,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
aws: settings_extension_aws::AwsSettingsV1,
ecs: ECSSettings,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
4 changes: 2 additions & 2 deletions sources/models/src/aws-ecs-2-nvidia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings, DnsSettings,
ECSSettings, HostContainer, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
ECSSettings, HostContainer, NetworkSettings, OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -21,7 +21,7 @@ struct Settings {
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
ecs: ECSSettings,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
4 changes: 2 additions & 2 deletions sources/models/src/aws-ecs-2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings, DnsSettings,
ECSSettings, HostContainer, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
ECSSettings, HostContainer, NetworkSettings, OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -21,7 +21,7 @@ struct Settings {
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
ecs: ECSSettings,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.24-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.24/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.25-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.25/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.26-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.26/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.30-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.30/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, MetricsSettings,
NetworkSettings, OciDefaults, OciHooks,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -22,7 +22,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
5 changes: 2 additions & 3 deletions sources/models/src/metal-dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use model_derive::model;
use std::collections::HashMap;

use crate::{
BootSettings, BootstrapContainer, DnsSettings, HostContainer, MetricsSettings, NetworkSettings,
OciHooks,
BootSettings, BootstrapContainer, DnsSettings, HostContainer, NetworkSettings, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -19,7 +18,7 @@ struct Settings {
network: NetworkSettings,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_hooks: OciHooks,
Expand Down
4 changes: 2 additions & 2 deletions sources/models/src/metal-k8s-1.29/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;

use crate::{
BootSettings, BootstrapContainer, ContainerRuntimeSettings, DnsSettings, HostContainer,
KubernetesSettings, MetricsSettings, NetworkSettings, OciDefaults, OciHooks,
KubernetesSettings, NetworkSettings, OciDefaults, OciHooks,
};
use modeled_types::Identifier;

Expand All @@ -21,7 +21,7 @@ struct Settings {
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
metrics: MetricsSettings,
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
Expand Down
Loading

0 comments on commit 1353ea1

Please sign in to comment.