Files
Simon Gaiser 2d29f7aaeb [Makefile] Drop SGX_RUN
For detection of SGX/non-SGX (for example in regression tests) always
use the SGX environment variable. To generate launch/EINIT tokens use
the new 'sgx-tokens' Make target.
2019-09-27 12:38:14 +02:00

152 lines
6.8 KiB
Plaintext

pipeline {
agent {
dockerfile { filename 'Jenkinsfiles/ubuntu-16.04.dockerfile'
label 'sgx_slave'
args "-v /lib/modules:/lib/modules:ro -v /usr/src:/usr/src:ro -v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket --device=/dev/gsgx:/dev/gsgx --device=/dev/isgx:/dev/isgx"
}
}
stages {
stage('Build') {
steps {
sh '''
./Scripts/clean-check-prepare
'''
sh '''
cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
'''
sh '''
cd /opt/intel
git clone https://github.com/01org/linux-sgx-driver.git
cd linux-sgx-driver
git checkout sgx_driver_1.9
make
'''
sh '''
cd Pal/src/host/Linux-SGX/sgx-driver
ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
'''
sh '''
make -j 8 SGX=1 WERROR=1
make -j 8 SGX=1 WERROR=1 test
'''
sh '''
make SGX=1 sgx-tokens
'''
}
}
stage('Test') {
steps {
timeout(time: 15, unit: 'MINUTES') {
sh '''
cd Pal/regression
if [ "${ra_client_spid}" != "" ]; then \
make clean SGX=1; \
make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
RA_CLIENT_KEY=${ra_client_key}; \
else \
make SGX=1; \
fi
make SGX=1 all sgx-tokens
make SGX=1 KEEP_LOG=1 regression
'''
}
timeout(time: 15, unit: 'MINUTES') {
sh '''
cd LibOS/shim/test/regression
make SGX=1 all sgx-tokens
make SGX=1 regression
'''
}
timeout(time: 5, unit: 'MINUTES') {
sh '''
cd LibOS/shim/test/apps/python
make SGX=1 all sgx-tokens
make SGX=1 regression
'''
}
timeout(time: 5, unit: 'MINUTES') {
sh '''
cd LibOS/shim/test/apps/bash
make SGX=1 all sgx-tokens
make SGX=1 regression
'''
}
timeout(time: 10, unit: 'MINUTES') {
sh '''
cd LibOS/shim/test/apps/gcc
make SGX=1 all sgx-tokens
make SGX=1 regression
'''
}
timeout(time: 15, unit: 'MINUTES') {
sh '''
cd LibOS/shim/test/apps/lmbench
make SGX=1 all sgx-tokens
make SGX=1 regression N_RUNS=1 ENOUGH=100
'''
}
sh '''
cd LibOS/shim/test/apps/lighttpd
make SGX=1 all sgx-tokens
make SGX=1 start-graphene-server &
sleep 10
LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8000
'''
sh '''
cd LibOS/shim/test/apps/apache
make SGX=1
make SGX=1 start-graphene-server &
sleep 30
LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
'''
sh '''
cd "$(./Scripts/clean-check-test-copy)"
rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
make -C Pal/src/host/Linux-SGX/sgx-driver clean
make SGX=1 clean
rm LibOS/glibc-*.tar.gz
make -C LibOS/shim/test/regression SGX=1 clean
make -C LibOS/shim/test/apps/python SGX=1 clean
make -C LibOS/shim/test/apps/bash SGX=1 clean
make -C LibOS/shim/test/apps/gcc SGX=1 clean
make -C LibOS/shim/test/apps/lmbench SGX=1 clean
make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
make -C LibOS/shim/test/apps/apache SGX=1 distclean
# LTP contains dead symlinks, which confuses the
# clean-check script. Just delete them.
for d in . /tmp/graphene-sgx.clean-check.clean; do
rm $d/LibOS/shim/test/apps/ltp/src/utils/ffsb-6.0-rc2/config.sub
rm $d/LibOS/shim/test/apps/ltp/src/utils/ffsb-6.0-rc2/config.guess
done
./Scripts/clean-check
'''
}
post {
always {
junit 'Pal/regression/pal-regression.xml'
junit 'LibOS/shim/test/regression/libos-regression.xml'
}
}
}
stage('Deploy') {
steps {
sh 'echo Deploying code'
}
}
}
post {
success {
echo 'Deployment successful'
}
failure {
echo 'Failure while on the pipeline'
}
unstable {
echo 'Pipeline marked as "unstable"'
}
}
}