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

Add aws-ecs-2 variants #3273

Merged
merged 4 commits into from
Jul 26, 2023
Merged
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
1 change: 0 additions & 1 deletion packages/docker-engine/daemon-json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"live-restore": true,
"max-concurrent-downloads": 10,
"storage-driver": "overlay2",
"exec-opts": ["native.cgroupdriver=cgroupfs"],
"data-root": "/var/lib/docker",
"default-runtime": "shimpei",
"runtimes": { "shimpei": { "path": "shimpei" } },
Expand Down
1 change: 0 additions & 1 deletion packages/docker-engine/daemon-nvidia-json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"live-restore": true,
"max-concurrent-downloads": 10,
"storage-driver": "overlay2",
"exec-opts": ["native.cgroupdriver=cgroupfs"],
"data-root": "/var/lib/docker",
"default-runtime": "shimpei",
"runtimes": { "shimpei": { "path": "shimpei" }, "nvidia": { "path": "nvidia-oci" } },
Expand Down
1 change: 1 addition & 0 deletions sources/logdog/conf/logdog.aws-ecs-2-nvidia.conf
1 change: 1 addition & 0 deletions sources/logdog/conf/logdog.aws-ecs-2.conf
15 changes: 15 additions & 0 deletions sources/models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ The `#[model]` attribute on Settings and its sub-structs reduces duplication and
* [Model](src/aws-ecs-1/mod.rs)
* [Default settings](src/aws-ecs-1/defaults.d/)

### aws-ecs-1-nvidia: Amazon ECS NVIDIA

* [Model](src/aws-ecs-1-nvidia/mod.rs)
* [Default settings](src/aws-ecs-1-nvidia/defaults.d/)

### aws-ecs-2: Amazon ECS

* [Model](src/aws-ecs-1/mod.rs)
* [Default settings](src/aws-ecs-1/defaults.d/)

### aws-ecs-2-nvidia: Amazon ECS NVIDIA

* [Model](src/aws-ecs-1-nvidia/mod.rs)
* [Default settings](src/aws-ecs-1-nvidia/defaults.d/)

### aws-dev: AWS development build

* [Model](src/aws-dev/mod.rs)
Expand Down
33 changes: 33 additions & 0 deletions sources/models/src/aws-ecs-2-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use model_derive::model;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

use crate::modeled_types::Identifier;
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, ECSSettings, HostContainer, KernelSettings, MetricsSettings, NetworkSettings,
NtpSettings, OciHooks, PemCertificate, RegistrySettings, UpdatesSettings,
};

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
// that uses its name in serialization; internal structures use the field name that points to it
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: String,
updates: UpdatesSettings,
host_containers: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: NtpSettings,
network: NetworkSettings,
kernel: KernelSettings,
boot: BootSettings,
aws: AwsSettings,
ecs: ECSSettings,
metrics: MetricsSettings,
pki: HashMap<Identifier, PemCertificate>,
container_registry: RegistrySettings,
oci_hooks: OciHooks,
cloudformation: CloudFormationSettings,
autoscaling: AutoScalingSettings,
dns: DnsSettings,
}
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/10-defaults.toml
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/15-aws-tuf.toml
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/25-cf-signal.toml
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/30-metrics.toml
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/52-aws-ecs-1.toml
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/53-docker-pki.toml
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/70-oci-hooks.toml
1 change: 1 addition & 0 deletions sources/models/src/aws-ecs-2/defaults.d/80-boot.toml
33 changes: 33 additions & 0 deletions sources/models/src/aws-ecs-2/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use model_derive::model;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

use crate::modeled_types::Identifier;
use crate::{
AutoScalingSettings, AwsSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
DnsSettings, ECSSettings, HostContainer, KernelSettings, MetricsSettings, NetworkSettings,
NtpSettings, OciHooks, PemCertificate, RegistrySettings, UpdatesSettings,
};

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
// that uses its name in serialization; internal structures use the field name that points to it
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: String,
updates: UpdatesSettings,
host_containers: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
ntp: NtpSettings,
network: NetworkSettings,
kernel: KernelSettings,
boot: BootSettings,
aws: AwsSettings,
ecs: ECSSettings,
metrics: MetricsSettings,
pki: HashMap<Identifier, PemCertificate>,
container_registry: RegistrySettings,
oci_hooks: OciHooks,
cloudformation: CloudFormationSettings,
autoscaling: AutoScalingSettings,
dns: DnsSettings,
}
15 changes: 15 additions & 0 deletions sources/models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ The `#[model]` attribute on Settings and its sub-structs reduces duplication and
* [Model](src/aws-ecs-1/mod.rs)
* [Default settings](src/aws-ecs-1/defaults.d/)

## aws-ecs-1-nvidia: Amazon ECS NVIDIA

* [Model](src/aws-ecs-1-nvidia/mod.rs)
* [Default settings](src/aws-ecs-1-nvidia/defaults.d/)

## aws-ecs-2: Amazon ECS

* [Model](src/aws-ecs-1/mod.rs)
* [Default settings](src/aws-ecs-1/defaults.d/)

## aws-ecs-2-nvidia: Amazon ECS NVIDIA

* [Model](src/aws-ecs-1-nvidia/mod.rs)
* [Default settings](src/aws-ecs-1-nvidia/defaults.d/)

## aws-dev: AWS development build

* [Model](src/aws-dev/mod.rs)
Expand Down
37 changes: 37 additions & 0 deletions variants/Cargo.lock

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

2 changes: 2 additions & 0 deletions variants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
members = [
"aws-dev",
"aws-ecs-1",
"aws-ecs-2",
"aws-ecs-1-nvidia",
"aws-ecs-2-nvidia",
"aws-k8s-1.23",
"aws-k8s-1.23-nvidia",
"aws-k8s-1.24",
Expand Down
11 changes: 11 additions & 0 deletions variants/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ The [aws-ecs-1-nvidia](aws-ecs-1-nvidia/Cargo.toml) variant includes the package
container instance in AWS.
It also includes the required packages to configure containers to leverage NVIDIA GPUs.

### aws-ecs-2: Amazon ECS container instance

The [aws-ecs-2](aws-ecs-2/Cargo.toml) variant includes the packages needed to run an [Amazon ECS](https://ecs.aws)
container instance in AWS.

### aws-ecs-2-nvidia: Amazon ECS container instance

The [aws-ecs-2-nvidia](aws-ecs-2-nvidia/Cargo.toml) variant includes the packages needed to run an [Amazon ECS](https://ecs.aws)
container instance in AWS.
It also includes the required packages to configure containers to leverage NVIDIA GPUs.

### aws-dev: AWS development build

The [aws-dev](aws-dev/Cargo.toml) variant has useful packages for local development of the OS.
Expand Down
60 changes: 60 additions & 0 deletions variants/aws-ecs-2-nvidia/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[package]
name = "aws-ecs-2-nvidia"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[package.metadata.build-variant.image-features]
grub-set-private-var = true
unified-cgroup-hierarchy = true
uefi-secure-boot = true
xfs-data-partition = true

[package.metadata.build-variant.image-layout]
os-image-size-gib = 4

[package.metadata.build-variant]
included-packages = [
# core
"release",
"kernel-6.1",
# docker
"docker-cli",
"docker-engine",
"docker-init",
"docker-proxy",
# ecs
"ecs-agent",
# NVIDIA support
"ecs-gpu-init",
"nvidia-container-toolkit",
"kmod-6.1-nvidia-tesla-535",
]

kernel-parameters = [
"console=tty0",
"console=ttyS0,115200n8",
"net.ifnames=0",
"netdog.default-interface=eth0:dhcp4,dhcp6?",
"quiet",
]

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

[build-dependencies]
# core
release = { path = "../../packages/release" }
kernel-6_1 = { path = "../../packages/kernel-6.1" }
# docker
docker-cli = { path = "../../packages/docker-cli" }
docker-engine = { path = "../../packages/docker-engine" }
docker-init = { path = "../../packages/docker-init" }
docker-proxy = { path = "../../packages/docker-proxy" }
# ecs
ecs-agent = { path = "../../packages/ecs-agent" }
# NVIDIA
ecs-gpu-init = { path = "../../packages/ecs-gpu-init" }
nvidia-container-toolkit = { path = "../../packages/nvidia-container-toolkit" }
kmod-6_1-nvidia = { path = "../../packages/kmod-6.1-nvidia" }
Loading