Skip to content

Commit

Permalink
CI: add sdk installation script
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
  • Loading branch information
bluele committed Oct 19, 2024
1 parent 91e037c commit ca014fd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .github/scripts/install_sgx_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
set -eox pipefail

if [ $# -eq 0 ]; then
echo "No arguments supplied"
exit 1
fi
SDK_DIR_PREFIX=$1

DCAP_VERSION=1.21.100.3-jammy1
# create tmp dir
TMP_DIR=$(mktemp -d)
echo "Created temp dir: $TMP_DIR"
cd $TMP_DIR
# clone the repo
git clone --recursive https://github.com/intel/SGXDataCenterAttestationPrimitives -b dcap_1.21_reproducible --depth 1

wget https://download.01.org/intel-sgx/sgx-linux/2.24/as.ld.objdump.r4.tar.gz
tar xzf as.ld.objdump.r4.tar.gz
cp -r external/toolset/ubuntu20.04/* /usr/bin/
rm -rf ./external ./as.ld.objdump.r4.tar.gz

wget https://download.01.org/intel-sgx/sgx-dcap/1.21/linux/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.24.100.3.bin -O sgx_linux_x64_sdk.bin
chmod a+x sgx_linux_x64_sdk.bin
./sgx_linux_x64_sdk.bin --prefix=$SDK_DIR_PREFIX
rm -rf ./sgx_linux_x64_sdk.bin

wget https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key
cat intel-sgx-deb.key | tee /etc/apt/keyrings/intel-sgx-keyring.asc > /dev/null
echo 'deb [signed-by=/etc/apt/keyrings/intel-sgx-keyring.asc arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list

apt-get update -y
apt-get install -y libsgx-dcap-ql=$DCAP_VERSION
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
./enclave
cache-directories: |
~/.cargo/registry/src/**/librocksdb-sys-*
- run: curl -LO https://download.01.org/intel-sgx/sgx-linux/2.19/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.19.100.3.bin
- run: chmod +x ./sgx_linux_x64_sdk_2.19.100.3.bin
- run: echo -e 'no\n/opt' | ./sgx_linux_x64_sdk_2.19.100.3.bin
- run: source /opt/sgxsdk/environment && make -B
- run: source /opt/sgxsdk/environment && make test
- run: source /opt/sgxsdk/environment && make integration-test
- run: bash .github/scripts/install_sgx_sdk.sh /opt/intel
- run: source /opt/intel/sgxsdk/environment && make -B
- run: source /opt/intel/sgxsdk/environment && make test
- run: source /opt/intel/sgxsdk/environment && make integration-test

0 comments on commit ca014fd

Please sign in to comment.