-
Notifications
You must be signed in to change notification settings - Fork 519
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
testsys: cargo make test
for ECS variants
#2348
Conversation
bd022af
to
cb775f0
Compare
cb775f0
to
d5eb872
Compare
TESTING.md
Outdated
@@ -137,7 +137,7 @@ If you run `cargo make test` for a variant that is not yet enabled, it will prin | |||
Check back here and follow the issues relevant to your variant of interest. | |||
|
|||
- `aws-k8s` conformance testing is working! | |||
- `aws-ecs`: https://github.com/bottlerocket-os/bottlerocket/issues/2150 | |||
- `aws-ecs`: conformance and migration testing is working! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your PR description you said that conformance
isn't supported
@@ -137,7 +137,7 @@ If you run `cargo make test` for a variant that is not yet enabled, it will prin | |||
Check back here and follow the issues relevant to your variant of interest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: for the lack of a better place
Could you please add a description in the commit message? You could just use what you used in the PR description. This is useful for the community if they want to know more about the reasoning behind the change, without having to chase down pull requests.
TESTING.md
Outdated
@@ -219,7 +248,8 @@ WORKING_BRANCH="develop" | |||
git checkout "${WORKING_BRANCH}" | |||
``` | |||
|
|||
Next, build Bottlerocket images and repos and sync TUF repos. | |||
Next, build Bottlerocket images and repos and sync TUF repos. | |||
The architecture and variant can be configured with `-e BUILDSYS_ARCH="aws-k8s-1.21"` and `-e BUILDSYS_VARIANT="x86_64"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You could just say "by setting BUILDSYS_ARCH and
BUILDSYS_VARIANT``"
tools/testsys/src/aws_resources.rs
Outdated
self.variant.replace('.', "") | ||
} | ||
|
||
/// Bottlerocket cluster naming convention. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe an example of how does that look like? Or is the convention documented somewhere?
tools/testsys/src/aws_resources.rs
Outdated
} | ||
} | ||
|
||
/// In order to easily create migration tests for `aws-k8s` variants we need to implement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not for aws-k8s
variants
tools/testsys/src/run.rs
Outdated
if let Some(name) = crd.name() { | ||
info!("Successfully added '{}'", name) | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it safe to assume that at this point name()
won't return None
and thus you can do unwrap
?
tools/testsys/src/run.rs
Outdated
@@ -252,6 +278,14 @@ pub(crate) struct TestsysImages { | |||
)] | |||
pub(crate) eks_resource: String, | |||
|
|||
/// Ecs resource agent uri. If not provided the latest released resource agent will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: s|Ecs|ECS
for all occurrences
tools/testsys/src/run.rs
Outdated
@@ -268,6 +302,14 @@ pub(crate) struct TestsysImages { | |||
)] | |||
pub(crate) sonobuoy_test: String, | |||
|
|||
/// Ecs test agent uri. If not provided the latest released test agent will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: s|uri|URI
d5eb872
to
f65173f
Compare
f65173f
to
22791d8
Compare
TESTING.md
Outdated
@@ -136,8 +136,8 @@ We haven't yet enabled `cargo make test` for every variant, though much of the u | |||
If you run `cargo make test` for a variant that is not yet enabled, it will print an error message. | |||
Check back here and follow the issues relevant to your variant of interest. | |||
|
|||
- `aws-k8s` conformance testing is working! | |||
- `aws-ecs`: https://github.com/bottlerocket-os/bottlerocket/issues/2150 | |||
- `aws-k8s` conformance and migration testing are working! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll keep updates in the readme related to the k8s variants in either a different commit, or a different PR.
tools/testsys/src/aws_resources.rs
Outdated
&get_ami_id( | ||
format!( | ||
"bottlerocket-{}-{}-{}-{}", | ||
self.variant, self.arch, self.starting_version.as_ref().context("The starting version must be provided for migration testing")?, self.migrate_starting_commit.as_ref().context("The commit for the starting version must be provided if the starting image id is not")? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this being formatted by cargo fmt
? It seems like a very long line.
tools/testsys/src/aws_resources.rs
Outdated
vpc: None, | ||
} | ||
.into_map() | ||
.context("Unable to convert ecs config to map")?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pedantic nit: s/ecs/ECS
, or if you are referring to the structure, use the whole name EcsClusterConfig
, the same applies to s/ec2/EC2
22791d8
to
f4c6d05
Compare
cargo make test
for ecs variantscargo make test
for ECS variants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once @arnaldo2792 is happy.
tools/testsys/src/run.rs
Outdated
@@ -244,31 +268,47 @@ pub(crate) struct Image { | |||
|
|||
#[derive(Debug, Parser)] | |||
pub(crate) struct TestsysImages { | |||
/// Eks resource agent uri. If not provided the latest released resource agent will be used. | |||
/// Eks resource agent URI. If not provided the latest released resource agent will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
/// Eks resource agent URI. If not provided the latest released resource agent will be used. | |
/// EKS resource agent URI. If not provided the latest released resource agent will be used. |
fn kube_arch(&self) -> String { | ||
self.arch.replace('_', "-") | ||
} | ||
|
||
fn kube_variant(&self) -> String { | ||
self.variant.replace('.', "") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename these helper functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any suggestions?
f4c6d05
to
788616f
Compare
TESTING.md
Outdated
### aws-ecs | ||
|
||
You need to [build](BUILDING.md) Bottlerocket and create an AMI before you can run a test. | ||
The instance type can be configured for nvidia variants by setting `TESTSYS_INSTANCE_TYPE="p3.2xlarge"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say something along these lines
The default instance type to be used is <blah>, but can be controlled by setting the environment variable `TESTSYS_INSTANCE_TYPE`.
This is useful while testing NVIDIA variants, since they require instance types with support for NVIDIA GPUs.
Adds support for ecs variants testing. Everything works the same way as aws-k8s variants except ECS clusters are created instead of EKS, and there is not supported conformance testing for ecs variants.
788616f
to
6adf946
Compare
Issue number:
Closes #2150
Description of changes:
Adds support for ECS variants testing. Everything works the same way as
aws-k8s
variants except ECS clusters are created instead of EKS, and there is not supported conformance testing for ECS variants.Testing done:
Tested with
quick
andmigration
tests.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.