Skip to content

Commit

Permalink
Update aws-throwaway (fix build times)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Jan 29, 2024
1 parent 2d5da0a commit 1e68519
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 65 deletions.
76 changes: 14 additions & 62 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.0", default-features = false }
tokio-bin-process = "0.4.0"
ordered-float = { version = "4.0.0", features = ["serde"] }
hyper = { version = "0.14.14", features = ["server"] }
Expand Down
6 changes: 5 additions & 1 deletion ec2-cargo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ until sudo apt-get update -qq
do
sleep 1
done
sudo apt-get install -y cmake pkg-config g++ libssl-dev librdkafka-dev uidmap
sudo apt-get install -y cmake pkg-config g++ libssl-dev librdkafka-dev uidmap unzip
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
curl -sSL https://get.docker.com/ | sudo sh
Expand All @@ -73,6 +73,10 @@ sudo /bin/docker1 "$@"
' | sudo dd of=/bin/docker
sudo chmod +x /bin/docker
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
echo "export RUST_BACKTRACE=1" >> .profile
echo "export CARGO_TERM_COLOR=always" >> .profile
echo 'source "$HOME/.cargo/env"' >> .profile
Expand Down
1 change: 1 addition & 0 deletions shotover-proxy/benches/windsock/cloud/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CloudResourcesRequired>) -> CloudResources {
Expand Down
2 changes: 2 additions & 0 deletions shotover-proxy/benches/windsock/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Refer to the windsock docs and `cargo windsock --help` for more flags.

## Running in AWS

First ensure you have the [AWS CLI V2 installed locally](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

### Aws credentials

Refer to the [aws-sdk docs](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/credentials.html) for full information on credentials.
Expand Down
10 changes: 9 additions & 1 deletion windsock-cloud-docker/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1e68519

Please sign in to comment.