Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
0fb827d
pubsys: split pubsys-config into new library crate
zmrow Sep 24, 2020
f155a19
Add pubsys-setup to ease creation of root role and signing key
zmrow Sep 24, 2020
79993e6
pubsys-config: disallow unknown fields
zmrow Sep 24, 2020
a8ae308
pubsys: don't require Infra.toml to get started
tjkirch Oct 16, 2020
184f08f
pubsys-config: Add VMware support
zmrow Jun 1, 2021
0d8afa7
infrasys: create TUF infra in AWS using `cargo make create-infra`
aashnasheth Jul 20, 2021
9a816a4
pubsys: add lock file integration
aashnasheth Aug 27, 2021
92b74a5
sources,tools: cargo fmt
etungsten Oct 18, 2021
6aa5dfe
build: run new cargo deny checks
bcressey Oct 15, 2021
e26a690
tools: update snafu to 0.7
webern Feb 3, 2022
050fd21
test: Add `cargo make` targets for `testsys` tests
webern Apr 30, 2022
d03723d
testsys: migration support for aws-k8s variants
ecpullen Jul 21, 2022
05c54e9
pubsys: fix clippy warnings
bcressey Aug 12, 2022
6c23495
infrasys: fix clippy warnings
bcressey Aug 12, 2022
2febf45
Remove redundant closure
stmcginnis Aug 15, 2022
e3ceb23
testsys: `cargo make test` for ecs variants
ecpullen Jul 14, 2022
c09ed26
testsys: Update testsys to checkout `07b9ae8`
ecpullen Aug 26, 2022
240376a
testsys: Update status to match `watch` size
ecpullen Aug 26, 2022
50b426a
testsys: add `conflicts_with` field to resources
ecpullen Aug 26, 2022
4473194
Merge pull request #2378 from jpmcb/buildsys-go-modules
jpmcb Sep 6, 2022
bca543d
lint: Remove unnecessary return
stmcginnis Sep 20, 2022
8e9fc5d
pubsys: update to AWS SDK Rust
jpculp Sep 20, 2022
5cd4075
tools: update AWS SDK for Rust to 0.18.0
jpculp Oct 3, 2022
5849798
testsys: Update to v0.0.2
ecpullen Sep 20, 2022
42e78f4
testsys: Introduce `Test.toml` for test configs
ecpullen Sep 20, 2022
bdbbd5a
testsys: Introduce `Test.toml` for test configs
ecpullen Sep 20, 2022
d7a724a
testsys: Accept `TESTSYS_STARTING_IMAGE_ID`
ecpullen Oct 27, 2022
65dd550
testsys: Enable multiple tests on a cluster
ecpullen Sep 6, 2022
0263454
testsys: Update to v0.0.3
ecpullen Oct 31, 2022
7465f74
testsys: Update to v0.0.3
ecpullen Oct 31, 2022
79a7532
testsys: added comment on how to use k8s secret
mjsterckx Nov 9, 2022
d1375bc
testsys: Refactor code base
ecpullen Oct 31, 2022
46f5dab
testsys: Refactor code base
ecpullen Oct 31, 2022
d057a7f
Merge pull request #2560 from ecpullen/refactor
ecpullen Nov 18, 2022
58c1655
testsys: Support external tests
ecpullen Nov 14, 2022
d384c90
testsys: Support external tests
ecpullen Nov 14, 2022
d57daba
Fix various minor formatting issues, mostly in the documentation.
stefansundin Nov 12, 2022
fb71cfe
Merge pull request #2592 from ecpullen/external-test
ecpullen Nov 28, 2022
28edb34
testsys: Integrate vmware variants
ecpullen Nov 18, 2022
416f778
testsys: Integrate vmware variants
ecpullen Nov 18, 2022
622dbb9
testsys: fix example test.toml, 'testsys-image-repository'
etungsten Dec 9, 2022
288107b
testsys: Change `tuf_metadata` to `tuf_repo_config`
ecpullen Dec 1, 2022
af14398
testsys: Use library for image version
ecpullen Dec 1, 2022
7e92acd
testsys: move documention for configurable fields in example config
etungsten Dec 9, 2022
f12fb58
testsys: Add `testsys-image-tag` to `Test.toml`
ecpullen Dec 12, 2022
9e42778
testsys: Add `testsys-image-tag` to `Test.toml`
ecpullen Dec 12, 2022
971bbfa
Merge pull request #2646 from etungsten/testsys-test-toml-example-fix
etungsten Dec 12, 2022
3821d64
Merge pull request #2653 from ecpullen/testsys-image-tag
ecpullen Dec 13, 2022
8bbab5c
pubsys-config: fix clippy warnings
cbgbt Dec 16, 2022
8efe393
testsys: Update to v0.0.4
ecpullen Dec 15, 2022
2a9e287
testsys: Update to v0.0.4
ecpullen Dec 15, 2022
614b177
testsys: Automatically create vSphere secret
ecpullen Dec 14, 2022
1a4601e
tools: remove testsys from deny.toml
etungsten Dec 20, 2022
bb10219
testsys: update to v0.0.5
etungsten Dec 20, 2022
3457e15
testsys: update to v0.0.5
etungsten Dec 20, 2022
b7445a6
tools: update rust dependencies
jpculp Dec 20, 2022
23032c2
pubsys: disallow private AMIs in public SSM params
cbgbt Dec 21, 2022
7157460
testsys: set labels on vSphere VM resource CRDs to avoid conflicts
etungsten Dec 21, 2022
fdf8efa
testsys: refactor and allow aws region override in 'migration_crd'
etungsten Dec 21, 2022
7058807
testsys: add param to 'migration_crd' to specify instance id field name
etungsten Dec 21, 2022
472d525
Merge pull request #2673 from jpculp/bump-rust-deps
jpculp Dec 29, 2022
5bc99f1
Merge pull request #2683 from etungsten/migration-crd-plsss
etungsten Jan 3, 2023
5457a78
testsys: Add label for build id
ecpullen Dec 16, 2022
5dc6f3b
testsys: Add `BUILD ID` to status output.
ecpullen Dec 16, 2022
16f3a69
testsys: Add `testsys/test-type` label
ecpullen Dec 16, 2022
348bacf
testsys: Add unique suffix to ec2 instances
ecpullen Dec 16, 2022
1eb9f23
testsys: Add unique suffix to vm resource
ecpullen Dec 16, 2022
44e5a55
testsys: Improve filtering of `watch-test`
ecpullen Dec 16, 2022
5d36ace
testsys: Improve delete filtering control
ecpullen Dec 20, 2022
861cd66
testsys: Provide status output options
ecpullen Dec 20, 2022
ef67f6f
testsys: Use `Test.toml` for controller install
ecpullen Jan 10, 2023
90c8a25
testsys: Use `Test.toml` for controller install
ecpullen Jan 10, 2023
be4b152
testsys: Use `builder` for EKS CRD creation
ecpullen Jan 10, 2023
24a74a4
testsys: Accept custom userdata
ecpullen Jan 10, 2023
2af0ccb
testsys: Accept custom userdata
ecpullen Jan 10, 2023
89603de
Merge pull request #2724 from ecpullen/testsys-builder-eks
ecpullen Jan 12, 2023
4cff153
Merge pull request #2725 from ecpullen/testsys-userdata
ecpullen Jan 13, 2023
20f7a41
Merge pull request #2725 from ecpullen/testsys-userdata
ecpullen Jan 13, 2023
dc985fc
testsys: Support custom tests from `tests` dir
ecpullen Jan 11, 2023
f584c97
testsys: Eksctl config file support
ecpullen Jan 11, 2023
16691d7
testsys: Allow configs in `test` table
ecpullen Jan 11, 2023
671a27f
testsys: Enable test-type dependencies
ecpullen Jan 11, 2023
d4d4504
testsys: Enable test-type dependencies
ecpullen Jan 11, 2023
3e475df
testsys: Add userdata files to `tests`
ecpullen Jan 17, 2023
83fcb04
testsys: Fix incorrect env for `TESTSYS_TESTS_DIR`
ecpullen Feb 3, 2023
d7a9a6a
testsys: Provide more config control
ecpullen Feb 10, 2023
73116e7
testsys: Provide more config control
ecpullen Feb 10, 2023
554584a
testsys: Fix incorrect migration starting image
ecpullen Feb 14, 2023
a89ae6e
tools: Update rust dependencies
jpculp Feb 18, 2023
37cdce9
tools: Update rust dependencies
jpculp Feb 18, 2023
cfdc270
tools: Update rust dependencies
jpculp Feb 18, 2023
3625b14
tools: fixed clippy lint warnings
mjsterckx Feb 28, 2023
c1a2e60
tools: fixed clippy lint warnings
mjsterckx Feb 28, 2023
feca78a
testsys: Addd support for k8s workloads
ecpullen Jan 5, 2023
70482c6
testsys: Addd support for k8s workloads
ecpullen Jan 5, 2023
bc35cf2
Remove kubernetes 1.21 variants
stmcginnis Jan 5, 2023
27f9b14
Merge pull request #2830 from ecpullen/workload
ecpullen Mar 1, 2023
a639570
Merge pull request #2830 from ecpullen/workload
ecpullen Mar 1, 2023
bd545e3
Update rust edition to 2021
stmcginnis Feb 27, 2023
edbd4a0
Merge pull request #2793 from mjsterckx/sdk-clippy-lint
mjsterckx Mar 2, 2023
8273434
Merge pull request #2793 from mjsterckx/sdk-clippy-lint
mjsterckx Mar 2, 2023
ce29f56
tools: Remove unnecessary time 0.1.x dependency
jpculp Feb 28, 2023
a4ac994
tools: Update aws-sdk-rust, coldsnap, and tough
jpculp Mar 3, 2023
5061d90
testsys: Update to TestSys v0.0.6
ecpullen Mar 6, 2023
fe8a19e
testsys: Update to TestSys v0.0.6
ecpullen Mar 6, 2023
7a7a5d3
testsys: Add support for metal-k8s testing
ecpullen Mar 7, 2023
abe142e
testsys: Add support for metal-k8s testing
ecpullen Mar 7, 2023
0842624
testsys: Update testsys to v0.0.7
ecpullen May 1, 2023
7fb1701
testsys: Update testsys to v0.0.7
ecpullen May 1, 2023
936ea33
testsys: Add support for `sonobuoy-image`
ecpullen May 2, 2023
d0c7aa8
testsys: Add support for `sonobuoy-image`
ecpullen May 2, 2023
3d9d482
testsys: Support ecs workload testing
ecpullen Mar 14, 2023
a49e8ad
testsys: Support ecs workload testing
ecpullen Mar 14, 2023
7767524
Merge pull request #3068 from ecpullen/testsys-sonobuoy-image
ecpullen May 4, 2023
caf572a
Merge pull request #3068 from ecpullen/testsys-sonobuoy-image
ecpullen May 4, 2023
aed452b
testsys: Add support for karpenter testing
ecpullen May 1, 2023
b60c7ef
testsys: Add support for karpenter testing
ecpullen May 1, 2023
fab5e6f
Merge pull request #3067 from ecpullen/karpenter
bcressey May 5, 2023
7d66eae
Merge pull request #3067 from ecpullen/karpenter
bcressey May 5, 2023
1be5144
trivial: Various spelling typos
stmcginnis Jun 12, 2023
5c69548
testsys: Upgrade to v0.0.8
ecpullen Jun 16, 2023
a406300
testsys: Upgrade to v0.0.8
ecpullen Jun 16, 2023
0187cf6
Bump clap to 4.3.5 in tools/testsys
stmcginnis Jun 23, 2023
cda22b4
testsys-config: Remove indirect dependencies
stmcginnis Jul 21, 2023
795019c
testsys: Add support for gpu based ecs workloads
ecpullen Aug 17, 2023
a778d18
testsys: Add labels to ecs clluster crds
ecpullen Aug 21, 2023
41499b4
tools: update aws-sdk-rust, coldsnap, and tough
jpculp Aug 22, 2023
f18aeea
build(deps): bump serde_yaml from 0.8.26 to 0.9.21 in /tools
dependabot[bot] Aug 30, 2023
95663eb
build(deps): bump serde_yaml from 0.8.26 to 0.9.21 in /tools
dependabot[bot] Aug 30, 2023
191f071
build(deps): bump serde_yaml from 0.8.26 to 0.9.21 in /tools
dependabot[bot] Aug 30, 2023
c555ceb
tools: fix clippy warnings
webern Sep 1, 2023
f280d2e
Merge pull request #3403 from webern/tools-clippy
webern Sep 6, 2023
c9e86e9
testsys: Fix support for metal migration testing
ecpullen Aug 8, 2023
6d4da3a
testsys: Update testsys to v0.0.9
ecpullen Sep 13, 2023
9543c73
testsys: Update testsys to v0.0.9
ecpullen Sep 13, 2023
22c9a6c
testsys: support for overriding EKS service endpoint
etungsten Sep 9, 2023
99f0370
testsys: launch nodes in public subnets by default
etungsten Sep 11, 2023
6d34db8
testsys: support for overriding EKS service endpoint
etungsten Sep 9, 2023
b1bdec5
testsys: Add support for eksa release manifest
ecpullen Sep 12, 2023
8a2ddf5
testsys: Add support for eksa release manifest
ecpullen Sep 12, 2023
c8d6599
move imported tools into desired directories
webern Sep 13, 2023
139e383
move imported tools into desired directories
webern Sep 13, 2023
1f23631
add tools to twoliter workspace
webern Sep 13, 2023
255d011
add tools to twoliter workspace
webern Sep 13, 2023
bd890e1
add tools to twoliter workspace
webern Sep 13, 2023
1f6b3b4
updates and cargo deny
webern Sep 14, 2023
749b902
updates and cargo deny
webern Sep 14, 2023
08346d1
testsys: change clustersharedSg to clusterSg in templated var
etungsten Sep 18, 2023
5142859
remove generate-readme
webern Sep 18, 2023
33cc442
remove generate-readme
webern Sep 18, 2023
20d6cce
pubsys-setup: fix repo expiration deserialization bug
webern Sep 20, 2023
6163089
testsys: add image_id label at metal cluster crd
gthao313 Sep 27, 2023
a632dce
Merge pull request #67 from etungsten/karpenter-clustersg
etungsten Sep 28, 2023
0747575
testsys: update to 0.0.10
gthao313 Oct 4, 2023
f462ac4
testsys: update to 0.0.10
gthao313 Oct 4, 2023
4c77392
testsys: update toml to 0.8
webern Oct 4, 2023
e755d66
testsys: Add test type for cluster templating
ecpullen Jan 23, 2024
05524c5
testsys: Update to 0.0.11
ecpullen Jan 30, 2024
8046f69
testsys: Update to 0.0.11
ecpullen Jan 30, 2024
bc8056b
testsys: provide assume agent role to workload crd
gthao313 Mar 15, 2024
de173fe
testsys: update to 0.0.12
gthao313 Mar 18, 2024
34114fe
testsys: update to 0.0.12
gthao313 Mar 18, 2024
a376de9
update cargo dependencies
webern Mar 16, 2024
6d6bc40
update cargo dependencies
webern Mar 16, 2024
dd06e87
update cargo dependencies
webern Mar 16, 2024
5572c87
update cargo dependencies
webern Mar 16, 2024
aea43d0
update cargo dependencies
webern Mar 16, 2024
e462aec
eliminate unused errors
webern May 15, 2024
2a1e797
twoliter: adjust Twoliter.toml, Infra.toml and define structure for T…
jmt-lab May 22, 2024
2561594
testsys: bump to 0.0.14 version
gthao313 Aug 1, 2024
ecb9407
testsys: bump to 0.0.14 version
gthao313 Aug 1, 2024
707296d
testsys: update log reader to use AsyncBufRead
cbgbt Aug 1, 2024
10efb47
workspace: homogenize dependencies
cbgbt Aug 19, 2024
9c1c62a
workspace: move to workspace dependencies
cbgbt Aug 19, 2024
d7e9409
workspace: move to workspace dependencies
cbgbt Aug 19, 2024
cb8d0f9
workspace: move to workspace dependencies
cbgbt Aug 19, 2024
5e6cbd9
workspace: move to workspace dependencies
cbgbt Aug 19, 2024
94f883e
workspace: move to workspace dependencies
cbgbt Aug 19, 2024
b334130
tools: remove k8s 1.24 variants
koooosh Jan 29, 2025
5bcc908
tools: remove k8s 1.24 variants
koooosh Jan 29, 2025
cd45cab
fix: add minutes to parse-datetime for waves
mikn Mar 5, 2025
e1db4ad
update rust toolchain to latest nightly
ginglis13 Feb 26, 2025
5468fff
fix: cargo fmt
mikn Mar 6, 2025
fecebcd
testsys: request gpu if nvidia
jpculp Mar 6, 2025
71159d3
testsys: support custom block mappings for ec2 instance launch
gthao313 Mar 10, 2025
4c1ecc3
testsys: support custom block mappings for ec2 instance launch
gthao313 Mar 10, 2025
7e48978
testsys: add new field assume_role to VSphereK8sClusterConfig
gthao313 Mar 6, 2025
1c33a4c
update dependencies and migrate to terminal_size
jmt-lab Apr 16, 2025
4b4937c
feat: allow keys from env
mikn May 12, 2025
3ef5835
testsys: add support to delete individual tests
koooosh Jun 20, 2025
3c36af6
fix clippy warnings
cbgbt Jul 15, 2025
fbf68c3
fix clippy warnings
cbgbt Jul 15, 2025
1d74be7
fix clippy warnings
cbgbt Jul 15, 2025
4814718
fix clippy warnings
cbgbt Jul 15, 2025
a226633
Add 'testsys-launcher/testsys/' from commit '3c36af691793e2a41a98d95c…
gthao313 Aug 21, 2025
89d4cc8
Add 'testsys-launcher/testsys-config/' from commit 'fbf68c3db8803891d…
gthao313 Aug 21, 2025
daa85fb
Add 'testsys-launcher/parse-datetime/' from commit '5468fff2b68ed8b37…
gthao313 Aug 21, 2025
5174559
Add 'testsys-launcher/pubsys-config/' from commit '1d74be7152fc5d1f8b…
gthao313 Aug 21, 2025
7a8283a
Add 'testsys-launcher/bottlerocket-variant/' from commit '4814718748e…
gthao313 Aug 21, 2025
e123c61
fix: resolve testsys interface compatibility issues
gthao313 Aug 21, 2025
7e54006
bump: update SDK to v0.62.0 and fix compatibility issues
gthao313 Aug 21, 2025
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,336 changes: 857 additions & 479 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ members = [
"controller",
"model",
"selftest",
"testsys-launcher/parse-datetime",
"testsys-launcher/pubsys-config",
"testsys-launcher/bottlerocket-variant",
"testsys-launcher/testsys-config",
"testsys-launcher/testsys",
]

resolver = "2"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SHELL = /bin/bash
TOP := $(dir $(firstword $(MAKEFILE_LIST)))

# Variables we update as newer versions are released
BOTTLEROCKET_SDK_VERSION = v0.50.1
BOTTLEROCKET_SDK_VERSION = v0.62.0
BOTTLEROCKET_SDK_ARCH = $(TESTSYS_BUILD_HOST_UNAME_ARCH)
BOTTLEROCKET_TOOLS_VERSION ?= v0.10.0

Expand Down
2 changes: 1 addition & 1 deletion agent/builder-derive/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub(crate) fn build_struct(ast: &syn::DeriveInput) -> TokenStream {
None
}
})
.last()
.next_back()
.expect("`crd` is a required attribute (Test, Resource)")
.value();

Expand Down
7 changes: 5 additions & 2 deletions agent/utils/src/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub async fn aws_config(
region
);

let mut config_loader = aws_config::defaults(BehaviorVersion::v2025_01_17()).retry_config(
let mut config_loader = aws_config::defaults(BehaviorVersion::v2025_08_07()).retry_config(
RetryConfig::standard()
.with_retry_mode(RetryMode::Adaptive)
.with_max_attempts(15),
Expand Down Expand Up @@ -95,7 +95,10 @@ pub async fn aws_config(
.set_duration_seconds(*assume_role_session_duration)
.send()
.await
.context(error::AssumeRoleSnafu { role_arn })?
.map_err(|source| Error::AssumeRole {
role_arn: role_arn.to_string(),
source: Box::new(source),
})?
.credentials()
.context(error::CredentialsMissingSnafu { role_arn })?
.clone();
Expand Down
12 changes: 6 additions & 6 deletions agent/utils/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::string::FromUtf8Error;
pub enum Error {
AssumeRole {
role_arn: String,
source: StsSdkError<AssumeRoleError>,
source: Box<StsSdkError<AssumeRoleError>>,
},

#[snafu(display(
Expand All @@ -27,7 +27,7 @@ pub enum Error {
AttachRolePolicy {
role_name: String,
policy_arn: String,
source: IamSdkError<aws_sdk_iam::operation::attach_role_policy::AttachRolePolicyError>,
source: Box<IamSdkError<aws_sdk_iam::operation::attach_role_policy::AttachRolePolicyError>>,
},

#[snafu(display("Failed to decode base64 blob: {}", source))]
Expand All @@ -48,7 +48,7 @@ pub enum Error {

#[snafu(display("Failed to send create SSM command: {}", source))]
CreateSsmActivation {
source: aws_sdk_ssm::error::SdkError<CreateActivationError>,
source: Box<aws_sdk_ssm::error::SdkError<CreateActivationError>>,
},

#[snafu(display(
Expand All @@ -60,7 +60,7 @@ pub enum Error {
CreateRole {
role_name: String,
role_policy: String,
source: IamSdkError<CreateRoleError>,
source: Box<IamSdkError<CreateRoleError>>,
},

#[snafu(display("Credentials were missing for assumed role '{}'", role_arn))]
Expand All @@ -71,13 +71,13 @@ pub enum Error {

#[snafu(display("Unable to get managed instance information: {}", source))]
GetManagedInstanceInfo {
source: SsmSdkError<DescribeInstanceInformationError>,
source: Box<SsmSdkError<DescribeInstanceInformationError>>,
},

#[snafu(display("Unable to get SSM role '{}': {}", role_name, source))]
GetSSMRole {
role_name: String,
source: IamSdkError<GetRoleError>,
source: Box<IamSdkError<GetRoleError>>,
},

#[snafu(display("{} was missing from {}", what, from))]
Expand Down
26 changes: 16 additions & 10 deletions agent/utils/src/ssm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::error::{self, Result};
use crate::error::{self, Error, Result};
use aws_sdk_iam::error::SdkError as IamSdkError;
use aws_sdk_ssm::types::{InstanceInformation, InstanceInformationStringFilter, Tag};
use log::info;
Expand Down Expand Up @@ -40,15 +40,16 @@ pub async fn ensure_ssm_service_role(iam_client: &aws_sdk_iam::Client) -> Result
.assume_role_policy_document(&assume_role_doc)
.send()
.await
.context(error::CreateRoleSnafu {
role_name: SSM_MANAGED_INSTANCE_SERVICE_ROLE_NAME,
.map_err(|source| Error::CreateRole {
source: Box::new(source),
role_name: SSM_MANAGED_INSTANCE_SERVICE_ROLE_NAME.to_string(),
role_policy: assume_role_doc,
})?;
}
e => {
return Err(error::Error::GetSSMRole {
return Err(Error::GetSSMRole {
role_name: SSM_MANAGED_INSTANCE_SERVICE_ROLE_NAME.to_string(),
source: e,
source: Box::new(e),
});
}
}
Expand All @@ -61,9 +62,10 @@ pub async fn ensure_ssm_service_role(iam_client: &aws_sdk_iam::Client) -> Result
.policy_arn(SSM_MANAGED_INSTANCE_POLICY_ARN)
.send()
.await
.context(error::AttachRolePolicySnafu {
role_name: SSM_MANAGED_INSTANCE_SERVICE_ROLE_NAME,
policy_arn: SSM_MANAGED_INSTANCE_POLICY_ARN,
.map_err(|source| Error::AttachRolePolicy {
source: Box::new(source),
role_name: SSM_MANAGED_INSTANCE_SERVICE_ROLE_NAME.to_string(),
policy_arn: SSM_MANAGED_INSTANCE_POLICY_ARN.to_string(),
})?;

Ok(())
Expand All @@ -87,7 +89,9 @@ pub async fn create_ssm_activation(
)
.send()
.await
.context(error::CreateSsmActivationSnafu {})?;
.map_err(|source| Error::CreateSsmActivation {
source: Box::new(source),
})?;
let activation_id = activations.activation_id.context(error::MissingSnafu {
what: "activation id",
from: "activations",
Expand Down Expand Up @@ -118,7 +122,9 @@ pub async fn wait_for_ssm_ready(
)
.send()
.await
.context(error::GetManagedInstanceInfoSnafu {})?;
.map_err(|source| Error::GetManagedInstanceInfo {
source: Box::new(source),
})?;
if let Some(info) = instance_info
.instance_information_list()
.iter()
Expand Down
20 changes: 15 additions & 5 deletions bottlerocket/agents/src/bin/ecs-test-agent/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ where
.launch_type(LaunchType::Ec2)
.send()
.await
.context(error::TaskRunCreationSnafu)?;
.map_err(|source| Error::TaskRunCreation {
source: Box::new(source),
})?;
let task_arns: Vec<String> = run_task_output
.tasks()
.iter()
Expand Down Expand Up @@ -146,7 +148,9 @@ async fn test_results(
.set_tasks(Some(task_arns.to_vec()))
.send()
.await
.context(error::TaskDescribeSnafu)?
.map_err(|source| Error::TaskDescribe {
source: Box::new(source),
})?
.tasks()
.to_owned();
let running_count = tasks
Expand Down Expand Up @@ -184,7 +188,9 @@ async fn wait_for_registered_containers(
.clusters(cluster)
.send()
.await
.context(error::ClusterDescribeSnafu)?
.map_err(|source| Error::ClusterDescribe {
source: Box::new(source),
})?
.clusters()
.first()
.context(error::NoTaskSnafu)?
Expand Down Expand Up @@ -234,7 +240,9 @@ async fn create_task_definition(ecs_client: &aws_sdk_ecs::Client) -> Result<Stri
.memory("512")
.send()
.await
.context(error::TaskDefinitionCreationSnafu)?;
.map_err(|source| Error::TaskDefinitionCreation {
source: Box::new(source),
})?;
let revision = task_info
.task_definition()
.context(error::TaskDefinitionMissingSnafu)?
Expand All @@ -249,7 +257,9 @@ async fn latest_task_revision(ecs_client: &aws_sdk_ecs::Client) -> Result<String
.task_definition(DEFAULT_TASK_DEFINITION)
.send()
.await
.context(error::TaskDefinitionDescribeSnafu)?;
.map_err(|source| Error::TaskDefinitionDescribe {
source: Box::new(source),
})?;
let revision = task_info
.task_definition()
.context(error::TaskDefinitionMissingSnafu)?
Expand Down
20 changes: 15 additions & 5 deletions bottlerocket/agents/src/bin/ecs-workload-agent/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ where
.launch_type(LaunchType::Ec2)
.send()
.await
.context(error::TaskRunCreationSnafu)?;
.map_err(|source| Error::TaskRunCreation {
source: Box::new(source),
})?;
let run_task_arns: Vec<String> = run_task_output
.tasks()
.iter()
Expand Down Expand Up @@ -243,7 +245,9 @@ async fn test_results(
.set_tasks(Some(task_arns.to_vec()))
.send()
.await
.context(error::TaskDescribeSnafu)?
.map_err(|source| Error::TaskDescribe {
source: Box::new(source),
})?
.tasks()
.to_owned();
let passed_count = tasks
Expand Down Expand Up @@ -300,7 +304,9 @@ async fn wait_for_cluster_ready(
.clusters(cluster)
.send()
.await
.context(error::ClusterDescribeSnafu)?
.map_err(|source| Error::ClusterDescribe {
source: Box::new(source),
})?
.clusters()
.first()
.context(error::NoTaskSnafu)?
Expand Down Expand Up @@ -363,7 +369,9 @@ async fn find_task_rev(
.family_prefix(task_def_name)
.send()
.await
.context(error::TaskDefinitionListSnafu)?;
.map_err(|source| Error::TaskDefinitionList {
source: Box::new(source),
})?;
let task_revisions = task_revisions.task_definition_arns();

for task_rev_arn in task_revisions {
Expand Down Expand Up @@ -454,7 +462,9 @@ async fn create_task_definition(
.container_definitions(create_container_definition(test_def)?)
.send()
.await
.context(error::TaskDefinitionCreationSnafu)?;
.map_err(|source| Error::TaskDefinitionCreation {
source: Box::new(source),
})?;
if let Some(task_arn) = task_info
.task_definition()
.context(error::TaskDefinitionMissingSnafu)?
Expand Down
22 changes: 16 additions & 6 deletions bottlerocket/agents/src/bin/migration-test-agent/ssm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use aws_sdk_ssm::types::{
CommandInvocation, CommandInvocationStatus, DocumentFormat, DocumentType,
InstanceInformationStringFilter,
};
use bottlerocket_agents::error;
use bottlerocket_agents::error::{self, Error};
use log::{debug, info};
use maplit::hashmap;
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -34,7 +34,9 @@ pub(crate) async fn wait_for_ssm_ready(
)
.send()
.await
.context(error::SsmDescribeInstanceInfoSnafu)?;
.map_err(|source| Error::SsmDescribeInstanceInfo {
source: Box::new(source),
})?;
num_ready = instance_info.instance_information_list().len();
sleep(sec_between_checks);
}
Expand Down Expand Up @@ -73,7 +75,9 @@ pub(crate) async fn create_or_update_ssm_document(
.document_format(DocumentFormat::Yaml)
.send()
.await
.context(error::SsmCreateDocumentSnafu)?;
.map_err(|source| Error::SsmCreateDocument {
source: Box::new(source),
})?;
Ok(())
}
_ => error::SsmDescribeDocumentSnafu {
Expand Down Expand Up @@ -120,7 +124,9 @@ pub(crate) async fn create_or_update_ssm_document(
.document_format(DocumentFormat::Yaml)
.send()
.await
.context(error::SsmUpdateDocumentSnafu)?;
.map_err(|source| Error::SsmUpdateDocument {
source: Box::new(source),
})?;
Ok(())
}

Expand All @@ -135,7 +141,9 @@ async fn wait_command_finish(
.command_id(cmd_id.to_owned())
.send()
.await
.context(error::SsmListCommandInvocationsSnafu)?;
.map_err(|source| Error::SsmListCommandInvocations {
source: Box::new(source),
})?;
if let Some(invocations) = cmd_status.command_invocations {
if invocations.is_empty()
|| invocations.iter().any(|i| {
Expand Down Expand Up @@ -171,7 +179,9 @@ pub(crate) async fn ssm_run_command(
.timeout_seconds(30)
.send()
.await
.context(error::SsmSendCommandSnafu)?
.map_err(|source| Error::SsmSendCommand {
source: Box::new(source),
})?
.command()
.and_then(|c| c.command_id().map(|s| s.to_string()))
.context(error::SsmCommandIdSnafu)?;
Expand Down
Loading
Loading