diff --git a/.github/workflows/espresso-enclave.yaml b/.github/workflows/espresso-enclave.yaml index 16b1cfd51bc7a..b1bccfec5fa42 100644 --- a/.github/workflows/espresso-enclave.yaml +++ b/.github/workflows/espresso-enclave.yaml @@ -71,7 +71,7 @@ jobs: - name: Launch EC2 Instance id: ec2 run: | - AMI_ID=ami-0ff5662328e9bbc2f + AMI_ID=ami-088107b1b9cba4cbf INSTANCE_ID=$(aws ec2 run-instances \ --image-id "$AMI_ID" \ --count 1 \ diff --git a/README_ESPRESSO.md b/README_ESPRESSO.md index 5c5003ad574d7..bfdc049e4dac6 100644 --- a/README_ESPRESSO.md +++ b/README_ESPRESSO.md @@ -401,7 +401,7 @@ In order to run the tests for the enclave in EC2 via github actions one must cre } ``` -Currently, the github workflow in `.github/workflows/enclave.yaml` relies on a custom AWS AMI with id `ami-0ff5662328e9bbc2f`. +Currently, the github workflow in `.github/workflows/enclave.yaml` relies on a custom AWS AMI with id `ami-088107b1b9cba4cbf`. In order to refresh this AMI one needs to: 1. Create an AWS EC2 instance with the characteristics described in (see `.github/workflows/enclave.yaml` *Launch EC2 Instance* job). 2. Copy the script `espresso/scrips/enclave-prepare-ami.sh` in the EC2 instance (e.g. using scp) and run it. diff --git a/espresso/scripts/enclave-prepare-ami.sh b/espresso/scripts/enclave-prepare-ami.sh index 26ec0a3d06ae9..72432655d030f 100644 --- a/espresso/scripts/enclave-prepare-ami.sh +++ b/espresso/scripts/enclave-prepare-ami.sh @@ -3,24 +3,26 @@ set -euo pipefail set -x echo "[*] Setting up Nix" -sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --no-confirm +sh <(curl --proto '=https' --tlsv1.2 -sSfL https://nixos.org/nix/install) --daemon --yes source /etc/profile.d/nix.sh nix-env -iA cachix -f https://cachix.org/api/v1/install mkdir -p ~/.config/nix echo "trusted-users = root ec2-user" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon - echo "[*] Installing dependencies..." -sudo yum update -y -sudo yum install -y git docker -sudo amazon-linux-extras enable aws-nitro-enclaves-cli -sudo yum install -y aws-nitro-enclaves-cli-1.4.2 +sudo dnf update -y +sudo dnf install -y git docker gcc +# Nitro Enclaves CLI for Amazon Linux 2023 +sudo dnf install -y aws-nitro-enclaves-cli aws-nitro-enclaves-cli-devel +sudo systemctl enable docker +sudo systemctl start docker +sudo usermod -aG ne ec2-user || true +sudo usermod -aG docker ec2-user || true -# Workaround due to https://github.com/foundry-rs/foundry/issues/4736 -sudo yum install -y gcc +# Rust + svm workaround curl https://sh.rustup.rs -sSf | sh -s -- -y -. $HOME/.cargo/env +. "$HOME/.cargo/env" cargo install svm-rs svm install 0.8.15 svm install 0.8.19