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

Rename aws-k8s to aws-k8s-1.15 #785

Merged
merged 2 commits into from
Feb 27, 2020
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
10 changes: 5 additions & 5 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ The script has some assumptions about your setup, in particular that you:
* have a few other common tools installed, like `jq`, `du`, and `rsync`

First, decompress the images.
(Note: these filenames assume an `x86_64` architecture and `aws-k8s` [variant](README.md).)
(Note: these filenames assume an `x86_64` architecture and `aws-k8s-1.15` [variant](README.md).)

```
lz4 -d build/latest/bottlerocket-aws-k8s-x86_64.img.lz4 && \
lz4 -d build/latest/bottlerocket-aws-k8s-x86_64-data.img.lz4
lz4 -d build/latest/bottlerocket-aws-k8s-1.15-x86_64.img.lz4 && \
lz4 -d build/latest/bottlerocket-aws-k8s-1.15-x86_64-data.img.lz4
```

Next, register an AMI:

```
bin/amiize.sh --name YOUR-AMI-NAME-HERE \
--ssh-keypair YOUR-EC2-SSH-KEYPAIR-NAME-HERE \
--root-image build/latest/bottlerocket-aws-k8s-x86_64.img \
--data-image build/latest/bottlerocket-aws-k8s-x86_64-data.img \
--root-image build/latest/bottlerocket-aws-k8s-1.15-x86_64.img \
--data-image build/latest/bottlerocket-aws-k8s-1.15-x86_64-data.img \
--region us-west-2 \
--instance-type m3.xlarge \
--arch x86_64 \
Expand Down
11 changes: 6 additions & 5 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BUILDSYS_SOURCES_DIR = "${BUILDSYS_ROOT_DIR}/sources"
BUILDSYS_TIMESTAMP = { script = ["date +%s"] }
BUILDSYS_VERSION_BUILD = { script = ["git describe --always --dirty --exclude '*' || echo 00000000"] }
BUILDSYS_VERSION_IMAGE = { script = ["awk -F '[ =\"]+' '$1 == \"version\" {print $2}' Release.toml"] }
BUILDSYS_VARIANT = "aws-k8s"
BUILDSYS_VARIANT = "aws-k8s-1.15"
# Disallow pulling directly Upstream URLs when lookaside cache results in MISSes as a fallback.
# To use the upstream source as fallback, override this on the command line and set it to 'true'
BUILDSYS_UPSTREAM_SOURCE_FALLBACK = "false"
Expand Down Expand Up @@ -79,7 +79,8 @@ fi
dependencies = ["setup"]
script = [
'''
for ws in sources packages variants tools/buildsys ; do
for ws in sources packages variants/* tools/buildsys ; do
[ -d "${ws}" ] || continue
cargo fetch --locked --manifest-path ${ws}/Cargo.toml
done
chmod o+r -R ${CARGO_HOME}
Expand Down Expand Up @@ -151,8 +152,7 @@ export PATH="${BUILDSYS_TOOLS_DIR}/bin:${PATH}"
cargo build \
${CARGO_BUILD_ARGS} \
${CARGO_MAKE_CARGO_ARGS} \
--manifest-path variants/Cargo.toml \
--package ${BUILDSYS_VARIANT}
--manifest-path variants/${BUILDSYS_VARIANT}/Cargo.toml
'''
]

Expand Down Expand Up @@ -225,7 +225,8 @@ script = ['tools/gen-docs.sh']
[tasks.clean]
script = [
'''
for ws in sources packages variants tools/buildsys ; do
for ws in sources packages variants/* tools/buildsys ; do
[ -d "${ws}" ] || continue
cargo clean --manifest-path ${ws}/Cargo.toml
done
rm -f ${BUILDSYS_TOOLS_DIR}/bin/buildsys
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ We’re excited to get early feedback and to continue working on more use cases!
Bottlerocket is architected such that different cloud environments and container orchestrators can be supported in the future.
A build of Bottlerocket that supports different features or integration characteristics is known as a 'variant'.
The artifacts of a build will include the architecture and variant name.
For example, an `x86_64` build of the `aws-k8s` variant will produce an image named `bottlerocket-aws-k8s-x86_64-<version>-<commit>.img`.
For example, an `x86_64` build of the `aws-k8s-1.15` variant will produce an image named `bottlerocket-aws-k8s-1.15-x86_64-<version>-<commit>.img`.

Our first supported variant, `aws-k8s`, supports EKS as described above.
Our first supported variant, `aws-k8s-1.15`, supports EKS as described above.

## Setup

Expand Down
8 changes: 4 additions & 4 deletions bin/amiize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
# Tested with the Amazon Linux AMI as worker AMI.
# Example call:
# bin/amiize.sh --region us-west-2 \
# --root-image build/latest/bottlerocket-aws-k8s-x86_64.img \
# --data-image build/latest/bottlerocket-aws-k8s-x86_64-data.img \
# --root-image build/latest/bottlerocket-aws-k8s-1.15-x86_64.img \
# --data-image build/latest/bottlerocket-aws-k8s-1.15-x86_64-data.img \
# --worker-ami ami-0f2176987ee50226e --ssh-keypair tjk \
# --instance-type m3.xlarge --name bottlerocket-20190918-01 --arch x86_64 \
# --user-data 'I2Nsb3VkLWNvbmZpZwpyZXBvX3VwZ3JhZGU6IG5vbmUK'
Expand Down Expand Up @@ -356,8 +356,8 @@ if [ -n "${registered_ami}" ]; then
fi

# Determine the size of the images (in G, for EBS)
# 2G bottlerocket-aws-k8s-x86_64.img
# 8G bottlerocket-aws-k8s-x86_64-data.img
# 2G bottlerocket-aws-k8s-1.15-x86_64.img
# 8G bottlerocket-aws-k8s-1.15-x86_64-data.img
# This is overridden by --root-volume-size and --data-volume-size if you pass those options.
root_image_size=$(du --apparent-size --block-size=G "${ROOT_IMAGE}" | sed -r 's,^([0-9]+)G\t.*,\1,')
if [ ! "${root_image_size}" -gt 0 ]; then
Expand Down
6 changes: 3 additions & 3 deletions sources/models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Default values are specified in [defaults.toml](defaults.toml) and can be overri

The `#[model]` attribute on Settings and its sub-structs reduces duplication and adds some required metadata; see [its docs](model-derive/) for details.

### aws-k8s: Kubernetes
### aws-k8s-1.15: Kubernetes 1.15

* [Model](src/aws-k8s/mod.rs)
* [Overridden defaults](src/aws-k8s/override-defaults.toml)
* [Model](src/aws-k8s-1.15/mod.rs)
* [Overridden defaults](src/aws-k8s-1.15/override-defaults.toml)

### aws-dev: Development build

Expand Down
2 changes: 1 addition & 1 deletion sources/models/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn link_current_variant() {
let var = "VARIANT";
println!("cargo:rerun-if-env-changed={}", var);
let variant = env::var(var).unwrap_or_else(|_| {
eprintln!("For local builds, you must set the {} environment variable so we know which API model to build against. Valid values are the directories in sources/models, for example \"aws-k8s\".", var);
eprintln!("For local builds, you must set the {} environment variable so we know which API model to build against. Valid values are the directories in sources/models, for example \"aws-k8s-1.15\".", var);
process::exit(1);
});

Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Default values are specified in [defaults.toml](defaults.toml) and can be overri

The `#[model]` attribute on Settings and its sub-structs reduces duplication and adds some required metadata; see [its docs](model-derive/) for details.

## aws-k8s: Kubernetes
## aws-k8s-1.15: Kubernetes 1.15

* [Model](src/aws-k8s/mod.rs)
* [Overridden defaults](src/aws-k8s/override-defaults.toml)
* [Model](src/aws-k8s-1.15/mod.rs)
* [Overridden defaults](src/aws-k8s-1.15/override-defaults.toml)

## aws-dev: Development build

Expand Down
14 changes: 7 additions & 7 deletions sources/updater/updog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ The Updog client provides an interface to a TUF repository and prepares for, dow
### Check for the most recent update
```
# updog check-update
aws-k8s-0.1.4 (v0.0)
aws-k8s-1.15 0.1.4 (v0.0)
```

### List all available updates, including older versions
```
# updog check-update --all
aws-k8s-0.1.4 (v0.0)
aws-k8s-0.1.2 (v0.0)
aws-k8s-0.1.1 (v0.0)
aws-k8s-1.15 0.1.4 (v0.0)
aws-k8s-1.15 0.1.2 (v0.0)
aws-k8s-1.15 0.1.1 (v0.0)
```

### Specify JSON output
```
# updog check-update --json
[{"variant":"aws-k8s","arch":"x86_64","version":"0.1.4","max_version":"0.1.4","waves":{"512":"2019-10-03T20:45:52Z","1024":"2019-10-03T21:00:52Z","1536":"2019-10-03T22:00:52Z","2048":"2019-10-03T23:00:52Z"},"images":{"boot":"bottlerocket-x86_64-aws-k8s-v0.1.4-boot.ext4.lz4","root":"bottlerocket-x86_64-aws-k8s-v0.1.4-root.ext4.lz4","hash":"bottlerocket-x86_64-aws-k8s-v0.1.4-root.verity.lz4"}}]
[{"variant":"aws-k8s-1.15","arch":"x86_64","version":"0.1.4","max_version":"0.1.4","waves":{"512":"2019-10-03T20:45:52Z","1024":"2019-10-03T21:00:52Z","1536":"2019-10-03T22:00:52Z","2048":"2019-10-03T23:00:52Z"},"images":{"boot":"bottlerocket-x86_64-aws-k8s-1.15-v0.1.4-boot.ext4.lz4","root":"bottlerocket-x86_64-aws-k8s-1.15-v0.1.4-root.ext4.lz4","hash":"bottlerocket-x86_64-aws-k8s-1.15-v0.1.4-root.verity.lz4"}}]
```

### Try to update with wave information
Expand All @@ -37,13 +37,13 @@ Once timestamp has passed:
```
# updog update --timestamp 2019-10-03T21:24:00+00:00
Starting update to 0.1.4
Update applied: aws-k8s-0.1.4
Update applied: aws-k8s-1.15 0.1.4
```

### Force an immediate update, ignoring wave limits
```
# updog update --now
Starting update to 0.1.4
** Updating immediately **
Update applied: aws-k8s-0.1.4
Update applied: aws-k8s-1.15 0.1.4
```
6 changes: 3 additions & 3 deletions sources/updater/updog/src/bin/updata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct AddUpdateArgs {
// metadata file to create/modify
file: PathBuf,

// image 'variant', eg. 'aws-k8s'
// image 'variant', eg. 'aws-k8s-1.15'
#[structopt(short = "f", long = "variant")]
variant: String,

Expand Down Expand Up @@ -85,7 +85,7 @@ struct RemoveUpdateArgs {
// metadata file to create/modify
file: PathBuf,

// image 'variant', eg. 'aws-k8s'
// image 'variant', eg. 'aws-k8s-1.15'
#[structopt(short = "l", long = "variant")]
variant: String,

Expand Down Expand Up @@ -129,7 +129,7 @@ struct WaveArgs {
// metadata file to create/modify
file: PathBuf,

// image 'variant', eg. 'aws-k8s'
// image 'variant', eg. 'aws-k8s-1.15'
#[structopt(short = "l", long = "variant")]
variant: String,

Expand Down
10 changes: 5 additions & 5 deletions sources/updater/updog/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn parse_args(args: std::env::Args) -> Arguments {
}

fn fmt_full_version(update: &Update) -> String {
format!("{}-{}", update.variant, update.version)
format!("{} {}", update.variant, update.version)
}

fn output<T: Serialize>(json: bool, object: T, string: &str) -> Result<()> {
Expand Down Expand Up @@ -532,7 +532,7 @@ fn main_inner() -> Result<()> {
output(
arguments.json,
&u,
&format!("Update applied: {}-{}", u.variant, u.version),
&format!("Update applied: {}", fmt_full_version(&u)),
)?;
} else if let Some(wave) = u.jitter(config.seed) {
// return the jittered time of our wave in the update
Expand Down Expand Up @@ -725,7 +725,7 @@ mod tests {
};

let version = Version::parse("0.1.3").unwrap();
let variant = String::from("aws-k8s");
let variant = String::from("aws-k8s-1.15");
let update = update_required(&config, &manifest, &version, &variant, None);

assert!(update.is_some(), "Updog ignored max version");
Expand Down Expand Up @@ -911,7 +911,7 @@ mod tests {
fn check_update_waves() {
let mut manifest = Manifest::default();
let mut update = Update {
variant: String::from("aws-k8s"),
variant: String::from("aws-k8s-1.15"),
arch: String::from(TARGET_ARCH),
version: Version::parse("1.1.1").unwrap(),
max_version: Version::parse("1.1.1").unwrap(),
Expand All @@ -924,7 +924,7 @@ mod tests {
};

let current_version = Version::parse("1.0.0").unwrap();
let variant = String::from("aws-k8s");
let variant = String::from("aws-k8s-1.15");
let config = Config {
metadata_base_url: String::from("foo"),
target_base_url: String::from("bar"),
Expand Down
4 changes: 2 additions & 2 deletions sources/updater/updog/tests/data/example_3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"updates": [
{
"variant": "aws-k8s",
"variant": "aws-k8s-1.15",
"arch": "x86_64",
"version": "0.1.1",
"max_version": "0.1.2",
Expand All @@ -16,7 +16,7 @@
}
},
{
"variant": "aws-k8s",
"variant": "aws-k8s-1.15",
"arch": "x86_64",
"version": "0.1.2",
"max_version": "0.1.2",
Expand Down
9 changes: 0 additions & 9 deletions variants/Cargo.toml

This file was deleted.

4 changes: 2 additions & 2 deletions variants/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Information about API settings for variants can be found in the [models](../sour

## Variants

### aws-k8s: Kubernetes node
### aws-k8s-1.15: Kubernetes 1.15 node

The [aws-k8s](aws-k8s/Cargo.toml) variant includes the packages needed to run a Kubernetes node in AWS.
The [aws-k8s-1.15](aws-k8s-1.15/Cargo.toml) variant includes the packages needed to run a Kubernetes node in AWS.
It supports self-hosted clusters and clusters managed by [EKS](https://aws.amazon.com/eks/).

### aws-dev: Development build
Expand Down
5 changes: 0 additions & 5 deletions variants/Cargo.lock → variants/aws-dev/Cargo.lock

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

5 changes: 5 additions & 0 deletions variants/aws-k8s-1.15/Cargo.lock

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[package]
name = "aws-k8s"
# This is the aws-k8s-1.15 variant. "." is not allowed in crate names, but we
# don't use this crate name anywhere.
name = "aws-k8s-1_15"
version = "0.1.0"
edition = "2018"
publish = false
Expand Down
File renamed without changes.
File renamed without changes.