Linux-SGX 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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('Lint') {
  10. steps {
  11. sh '''
  12. ./.ci/run-shellcheck || :
  13. ./.ci/run-shellcheck -f json | ./.ci/prfilter
  14. '''
  15. }
  16. }
  17. stage('Build') {
  18. steps {
  19. sh '''
  20. ./Scripts/clean-check-prepare
  21. '''
  22. sh '''
  23. cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
  24. '''
  25. sh '''
  26. cd /opt/intel
  27. git clone https://github.com/01org/linux-sgx-driver.git
  28. cd linux-sgx-driver
  29. git checkout sgx_driver_1.9
  30. make
  31. '''
  32. sh '''
  33. cd Pal/src/host/Linux-SGX/sgx-driver
  34. ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
  35. '''
  36. sh '''
  37. make -j 8 SGX=1 WERROR=1
  38. make -j 8 SGX=1 WERROR=1 test
  39. '''
  40. sh '''
  41. make SGX=1 sgx-tokens
  42. '''
  43. }
  44. }
  45. stage('Test') {
  46. steps {
  47. timeout(time: 15, unit: 'MINUTES') {
  48. sh '''
  49. cd Pal/regression
  50. if [ "${ra_client_spid}" != "" ]; then \
  51. make clean SGX=1; \
  52. make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
  53. RA_CLIENT_KEY=${ra_client_key}; \
  54. else \
  55. make SGX=1; \
  56. fi
  57. make SGX=1 all sgx-tokens
  58. make SGX=1 KEEP_LOG=1 regression
  59. '''
  60. }
  61. timeout(time: 15, unit: 'MINUTES') {
  62. sh '''
  63. cd LibOS/shim/test/regression
  64. make SGX=1 all sgx-tokens
  65. make SGX=1 regression
  66. '''
  67. }
  68. timeout(time: 5, unit: 'MINUTES') {
  69. sh '''
  70. cd LibOS/shim/test/fs
  71. make SGX=1 all sgx-tokens
  72. make SGX=1 test
  73. '''
  74. }
  75. // LTP is ignored under SGX because of random segfaults
  76. sh '''
  77. cd LibOS/shim/test/apps/ltp
  78. make SGX=1 all sgx-tokens
  79. make SGX=1 ltp-sgx.xml || :
  80. '''
  81. timeout(time: 5, unit: 'MINUTES') {
  82. sh '''
  83. cd LibOS/shim/test/apps/python-simple
  84. make SGX=1
  85. make SGX=1 check
  86. '''
  87. }
  88. timeout(time: 5, unit: 'MINUTES') {
  89. sh '''
  90. cd LibOS/shim/test/apps/python-scipy-insecure
  91. make SGX=1
  92. make SGX=1 check
  93. '''
  94. }
  95. timeout(time: 5, unit: 'MINUTES') {
  96. sh '''
  97. cd LibOS/shim/test/apps/bash
  98. make SGX=1 all
  99. make SGX=1 regression
  100. '''
  101. }
  102. timeout(time: 5, unit: 'MINUTES') {
  103. sh '''
  104. cd LibOS/shim/test/apps/curl
  105. make SGX=1 all
  106. make SGX=1 check
  107. '''
  108. }
  109. timeout(time: 10, unit: 'MINUTES') {
  110. sh '''
  111. cd LibOS/shim/test/apps/gcc
  112. make SGX=1 all
  113. make SGX=1 check
  114. '''
  115. }
  116. timeout(time: 15, unit: 'MINUTES') {
  117. sh '''
  118. cd LibOS/shim/test/apps/lmbench
  119. make SGX=1 all
  120. make SGX=1 test N_RUNS=1 ENOUGH=100
  121. '''
  122. }
  123. sh '''
  124. cd LibOS/shim/test/apps/lighttpd
  125. make SGX=1
  126. make SGX=1 start-graphene-server &
  127. sleep 10
  128. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8003
  129. '''
  130. sh '''
  131. cd LibOS/shim/test/apps/nginx
  132. make SGX=1
  133. make SGX=1 start-graphene-server &
  134. sleep 30
  135. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8002
  136. '''
  137. sh '''
  138. cd LibOS/shim/test/apps/apache
  139. make SGX=1
  140. make SGX=1 start-graphene-server &
  141. sleep 30
  142. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
  143. '''
  144. sh '''
  145. cd "$(./Scripts/clean-check-test-copy)"
  146. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  147. make -C Pal/src/host/Linux-SGX/sgx-driver distclean
  148. make SGX=1 clean
  149. rm LibOS/glibc-*.tar.gz
  150. make -C LibOS/shim/test/regression SGX=1 clean
  151. make -C LibOS/shim/test/apps/ltp clean
  152. # LTP's make clean is broken, see https://github.com/linux-test-project/ltp/issues/559
  153. rm -rf /tmp/graphene-sgx.clean-check.clean/LibOS/shim/test/apps/ltp/src
  154. rm -rf LibOS/shim/test/apps/ltp/src
  155. make -C LibOS/shim/test/apps/python-simple SGX=1 clean
  156. make -C LibOS/shim/test/apps/python-scipy-insecure SGX=1 clean
  157. make -C LibOS/shim/test/apps/bash SGX=1 clean
  158. make -C LibOS/shim/test/apps/curl SGX=1 clean
  159. make -C LibOS/shim/test/apps/gcc SGX=1 clean
  160. make -C LibOS/shim/test/apps/lmbench SGX=1 distclean
  161. make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
  162. make -C LibOS/shim/test/apps/nginx SGX=1 distclean
  163. make -C LibOS/shim/test/apps/apache SGX=1 distclean
  164. ./Scripts/clean-check
  165. '''
  166. }
  167. post {
  168. always {
  169. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  170. junit 'Pal/regression/pal-regression.xml'
  171. junit 'LibOS/shim/test/regression/libos-regression.xml'
  172. // LTP is ignored under SGX because of random segfaults
  173. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  174. }
  175. }
  176. }
  177. stage('Deploy') {
  178. steps {
  179. sh 'echo Deploying code'
  180. }
  181. }
  182. }
  183. post {
  184. success {
  185. echo 'Deployment successful'
  186. }
  187. failure {
  188. echo 'Failure while on the pipeline'
  189. }
  190. unstable {
  191. echo 'Pipeline marked as "unstable"'
  192. }
  193. }
  194. }