#!/bin/bash set -e script_dir=$(dirname "$0") cd "$script_dir/.." prerequisites=$1 if [ "$prerequisites" == "--prep" ]; then echo "Preparing the packager environment" apt update && apt install -y openssh-client rustup install stable-x86_64-unknown-linux-gnu rustup default stable rustup target add x86_64-unknown-linux-musl mkdir -p /root/.ssh echo echo "docker cp deploy_ed25519 packager:/root/.ssh/id_ed25519" echo echo "Run above commands in another terminal" while true; do echo -n "." && sleep 1 if [ -e ~/.ssh/id_ed25519 ]; then echo && break fi done chown -R root:root /root/.ssh chmod 600 /root/.ssh/id_ed25519 ssh-keyscan -H gitea.detee.cloud > ~/.ssh/known_hosts echo "Building the occlum fork" git clone git@gitea.detee.cloud:SGX/occlum.git (cd occlum && make submodule) (cd occlum/tools/toolchains/utils_lib && ./build.sh) fi echo "Building the hacker-challenge signed bundle" occlum-cargo build --release strip target/x86_64-unknown-linux-musl/release/hacker-challenge cat > challenge.yaml <