From 2092727fe8f4ee17f175ef2a9f4d9dd8bdcfb936 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Thu, 25 Jan 2024 15:38:54 +1100 Subject: [PATCH] Update aws-throwaway (fix build times) --- Cargo.lock | 59 ++------------------ Cargo.toml | 2 +- shotover-proxy/benches/windsock/cloud/mod.rs | 1 + windsock-cloud-docker/src/container.rs | 10 +++- 4 files changed, 15 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7781b83fb..fd93fd33f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,55 +316,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "aws-sdk-ec2" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9752c052b0f3eb82d11f58425398cfe4cf0e85eb2261db8698b5cd97408417fe" -dependencies = [ - "aws-credential-types", - "aws-http", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-query", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "fastrand", - "http 0.2.11", - "once_cell", - "regex-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-iam" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c661229980f88aeee4624e2defb0458e8fc7ea3c6aea66df45d0387e91cba8" -dependencies = [ - "aws-credential-types", - "aws-http", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-query", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "http 0.2.11", - "once_cell", - "regex-lite", - "tracing", -] - [[package]] name = "aws-sdk-kms" version = "1.10.0" @@ -606,17 +557,15 @@ dependencies = [ [[package]] name = "aws-throwaway" version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3feb00694010c9969f97e8a106ba72efd1f132b6e4bc0db351f9adf92b375b7a" +source = "git+https://github.com/shotover/aws-throwaway#79a8e0723a297c47f3f209d8e3d598e1d41e5b9d" dependencies = [ "anyhow", "async-trait", - "aws-config", - "aws-sdk-ec2", - "aws-sdk-iam", "base64", "russh", "russh-keys", + "serde", + "serde_json", "ssh-key", "tokio", "tracing", @@ -2320,7 +2269,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.4.10", "tokio", "tower-service", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 2947e82a4..850292117 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ rand_distr = "0.4.1" clap = { version = "4.0.4", features = ["cargo", "derive"] } async-trait = "0.1.30" typetag = "0.2.5" -aws-throwaway = "0.5.0" +aws-throwaway = { version = "0.5.0", default-features = false, git = "https://github.com/shotover/aws-throwaway" } tokio-bin-process = "0.4.0" ordered-float = { version = "4.0.0", features = ["serde"] } hyper = { version = "0.14.14", features = ["server"] } diff --git a/shotover-proxy/benches/windsock/cloud/mod.rs b/shotover-proxy/benches/windsock/cloud/mod.rs index 815d7b065..8d6b34899 100644 --- a/shotover-proxy/benches/windsock/cloud/mod.rs +++ b/shotover-proxy/benches/windsock/cloud/mod.rs @@ -34,6 +34,7 @@ impl Cloud for AwsCloud { // AWS is not initialized, it'll be faster to cleanup resources skipping initialization None => AwsInstances::cleanup().await, } + println!("All AWS throwaway resources have been deleted"); } async fn create_resources(&mut self, required: Vec) -> CloudResources { diff --git a/windsock-cloud-docker/src/container.rs b/windsock-cloud-docker/src/container.rs index 929c797d1..1f69668e3 100644 --- a/windsock-cloud-docker/src/container.rs +++ b/windsock-cloud-docker/src/container.rs @@ -28,12 +28,20 @@ impl Container { .await; container_bash("apt-get update").await; container_bash( - "DEBIAN_FRONTEND=noninteractive apt-get install -y curl git cmake pkg-config g++ libssl-dev librdkafka-dev uidmap psmisc", + "DEBIAN_FRONTEND=noninteractive apt-get install -y curl git cmake pkg-config g++ libssl-dev librdkafka-dev uidmap psmisc unzip", ).await; container_bash( "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y", ) .await; + container_bash( + r#" +curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +unzip awscliv2.zip +./aws/install + "#, + ) + .await; } else { cleanup().await; }