diff --git a/cdk/orchestrator-job.Dockerfile b/cdk/orchestrator-job.Dockerfile index de9a76a..d26f1e3 100644 --- a/cdk/orchestrator-job.Dockerfile +++ b/cdk/orchestrator-job.Dockerfile @@ -1,4 +1,4 @@ -from amazonlinux:2023 +FROM amazonlinux:2023 RUN dnf install -y python3-pip \ && python3 -m pip install boto3 diff --git a/cdk/per-instance-job.Dockerfile b/cdk/per-instance-job.Dockerfile index cd8a7a3..548d74f 100644 --- a/cdk/per-instance-job.Dockerfile +++ b/cdk/per-instance-job.Dockerfile @@ -1,7 +1,12 @@ -from amazonlinux:2023 +FROM amazonlinux:2023 RUN dnf install -y git +# Installing rustup is a pain, because you need to modify the shell afterwards. +# Easier to just do it here, vs later via install-tools-AL2023.py +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + # s3_benchmarks/__init__.py is shared by CDK Stack and Batch jobs COPY s3_benchmarks/__init__.py /s3_benchmarks/ diff --git a/runners/s3-benchrunner-rust/Cargo.toml b/runners/s3-benchrunner-rust/Cargo.toml index d945483..e229bf8 100644 --- a/runners/s3-benchrunner-rust/Cargo.toml +++ b/runners/s3-benchrunner-rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] # Swap which line is commented-out to use GitHub or local aws-s3-transfer-manager -aws-s3-transfer-manager = { git = "https://github.com/awslabs/aws-s3-transfer-manager-rs.git", rev = "9f16242e5a2a0c9d1fcc2b4d1006fb01c9c551f2" } +aws-s3-transfer-manager = { git = "https://github.com/awslabs/aws-s3-transfer-manager-rs.git", rev = "3dd20c8aa0872352100cf456beee02bfc53c73d1" } # aws-s3-transfer-manager = { path = "../../../aws-s3-transfer-manager-rs/aws-s3-transfer-manager" } # tracing-opentelemetry 0.26.0 is a bit broken (see https://github.com/tokio-rs/tracing-opentelemetry/issues/159) diff --git a/scripts/install-tools-AL2023.py b/scripts/install-tools-AL2023.py index 1032f09..fb379e4 100755 --- a/scripts/install-tools-AL2023.py +++ b/scripts/install-tools-AL2023.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 import argparse -import os -import os.path import shutil import urllib.request @@ -31,16 +29,12 @@ 'python3-devel', # for building aws-crt-python ]) -# install rust via rustup.sh -# (the version in dnf is too old, in July 2024 it was the 1+ year old rust 1.68) -# do NOT use sudo with rustup -rustup_url = 'https://sh.rustup.rs' -rustup_filepath = '/tmp/rustup.sh' -print(f'downloading: {rustup_url} -> {rustup_filepath} ...') -urllib.request.urlretrieve(rustup_url, rustup_filepath) -run(['sh', rustup_filepath, '-y']) - -# add rust to path, so current process can run it without reloading shell -PATH = os.environ['PATH'] -if '.cargo/bin' not in PATH: - os.environ['PATH'] = f"{PATH}:{os.path.expanduser('~/.cargo/bin')}" +if not shutil.which('cargo'): + # install rust via rustup.sh + # (the version in dnf is too old, in July 2024 it was the 1+ year old rust 1.68) + # do NOT use sudo with rustup + rustup_url = 'https://sh.rustup.rs' + rustup_filepath = '/tmp/rustup.sh' + print(f'downloading: {rustup_url} -> {rustup_filepath} ...') + urllib.request.urlretrieve(rustup_url, rustup_filepath) + run(['sh', rustup_filepath, '-y'])