Linux-SGX 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. pipeline {
  2. agent {
  3. dockerfile { filename 'Jenkinsfiles/ubuntu-16.04.dockerfile'
  4. label 'sgx_slave'
  5. 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"
  6. }
  7. }
  8. stages {
  9. stage('Build') {
  10. steps {
  11. sh '''
  12. ./Scripts/clean-check-prepare
  13. '''
  14. sh '''
  15. cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
  16. '''
  17. sh '''
  18. cd /opt/intel
  19. git clone https://github.com/01org/linux-sgx-driver.git
  20. cd linux-sgx-driver
  21. git checkout sgx_driver_1.9
  22. make
  23. '''
  24. sh '''
  25. cd Pal/src/host/Linux-SGX/sgx-driver
  26. ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
  27. '''
  28. sh '''
  29. make -j 8 SGX=1 WERROR=1
  30. make -j 8 SGX=1 WERROR=1 test
  31. '''
  32. sh '''
  33. make SGX=1 sgx-tokens
  34. '''
  35. }
  36. }
  37. stage('Test') {
  38. steps {
  39. timeout(time: 15, unit: 'MINUTES') {
  40. sh '''
  41. cd Pal/regression
  42. if [ "${ra_client_spid}" != "" ]; then \
  43. make clean SGX=1; \
  44. make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
  45. RA_CLIENT_KEY=${ra_client_key}; \
  46. else \
  47. make SGX=1; \
  48. fi
  49. make SGX=1 all sgx-tokens
  50. make SGX=1 KEEP_LOG=1 regression
  51. '''
  52. }
  53. timeout(time: 15, unit: 'MINUTES') {
  54. sh '''
  55. cd LibOS/shim/test/regression
  56. make SGX=1 all sgx-tokens
  57. make SGX=1 regression
  58. '''
  59. }
  60. timeout(time: 5, unit: 'MINUTES') {
  61. sh '''
  62. cd LibOS/shim/test/apps/python
  63. make SGX=1 all sgx-tokens
  64. make SGX=1 regression
  65. '''
  66. }
  67. timeout(time: 5, unit: 'MINUTES') {
  68. sh '''
  69. cd LibOS/shim/test/apps/bash
  70. make SGX=1 all sgx-tokens
  71. make SGX=1 regression
  72. '''
  73. }
  74. timeout(time: 10, unit: 'MINUTES') {
  75. sh '''
  76. cd LibOS/shim/test/apps/gcc
  77. make SGX=1 all sgx-tokens
  78. make SGX=1 regression
  79. '''
  80. }
  81. timeout(time: 15, unit: 'MINUTES') {
  82. sh '''
  83. cd LibOS/shim/test/apps/lmbench
  84. make SGX=1 all sgx-tokens
  85. make SGX=1 regression N_RUNS=1 ENOUGH=100
  86. '''
  87. }
  88. sh '''
  89. cd LibOS/shim/test/apps/lighttpd
  90. make SGX=1 all sgx-tokens
  91. make SGX=1 start-graphene-server &
  92. sleep 10
  93. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8000
  94. '''
  95. sh '''
  96. cd LibOS/shim/test/apps/apache
  97. make SGX=1
  98. make SGX=1 start-graphene-server &
  99. sleep 30
  100. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
  101. '''
  102. sh '''
  103. cd "$(./Scripts/clean-check-test-copy)"
  104. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  105. make -C Pal/src/host/Linux-SGX/sgx-driver clean
  106. make SGX=1 clean
  107. rm LibOS/glibc-*.tar.gz
  108. make -C LibOS/shim/test/regression SGX=1 clean
  109. make -C LibOS/shim/test/apps/python SGX=1 clean
  110. make -C LibOS/shim/test/apps/bash SGX=1 clean
  111. make -C LibOS/shim/test/apps/gcc SGX=1 clean
  112. make -C LibOS/shim/test/apps/lmbench SGX=1 clean
  113. make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
  114. make -C LibOS/shim/test/apps/apache SGX=1 distclean
  115. # LTP contains dead symlinks, which confuses the
  116. # clean-check script. Just delete them.
  117. for d in . /tmp/graphene-sgx.clean-check.clean; do
  118. rm $d/LibOS/shim/test/apps/ltp/src/utils/ffsb-6.0-rc2/config.sub
  119. rm $d/LibOS/shim/test/apps/ltp/src/utils/ffsb-6.0-rc2/config.guess
  120. done
  121. ./Scripts/clean-check
  122. '''
  123. }
  124. post {
  125. always {
  126. junit 'Pal/regression/pal-regression.xml'
  127. junit 'LibOS/shim/test/regression/libos-regression.xml'
  128. }
  129. }
  130. }
  131. stage('Deploy') {
  132. steps {
  133. sh 'echo Deploying code'
  134. }
  135. }
  136. }
  137. post {
  138. success {
  139. echo 'Deployment successful'
  140. }
  141. failure {
  142. echo 'Failure while on the pipeline'
  143. }
  144. unstable {
  145. echo 'Pipeline marked as "unstable"'
  146. }
  147. }
  148. }