Linux-SGX 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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/fs
  63. make SGX=1 all sgx-tokens
  64. make SGX=1 test
  65. '''
  66. }
  67. // LTP is ignored under SGX because of random segfaults
  68. sh '''
  69. cd LibOS/shim/test/apps/ltp
  70. make SGX=1 all sgx-tokens
  71. make SGX=1 ltp-sgx.xml || :
  72. '''
  73. timeout(time: 5, unit: 'MINUTES') {
  74. sh '''
  75. cd LibOS/shim/test/apps/python-simple
  76. make SGX=1
  77. make SGX=1 check
  78. '''
  79. }
  80. timeout(time: 5, unit: 'MINUTES') {
  81. sh '''
  82. cd LibOS/shim/test/apps/python-scipy-insecure
  83. make SGX=1
  84. make SGX=1 check
  85. '''
  86. }
  87. timeout(time: 5, unit: 'MINUTES') {
  88. sh '''
  89. cd LibOS/shim/test/apps/bash
  90. make SGX=1 all
  91. make SGX=1 regression
  92. '''
  93. }
  94. timeout(time: 5, unit: 'MINUTES') {
  95. sh '''
  96. cd LibOS/shim/test/apps/curl
  97. make SGX=1 all
  98. make SGX=1 check
  99. '''
  100. }
  101. timeout(time: 10, unit: 'MINUTES') {
  102. sh '''
  103. cd LibOS/shim/test/apps/gcc
  104. make SGX=1 all
  105. make SGX=1 check
  106. '''
  107. }
  108. timeout(time: 15, unit: 'MINUTES') {
  109. sh '''
  110. cd LibOS/shim/test/apps/lmbench
  111. make SGX=1 all
  112. make SGX=1 test N_RUNS=1 ENOUGH=100
  113. '''
  114. }
  115. sh '''
  116. cd LibOS/shim/test/apps/lighttpd
  117. make SGX=1
  118. make SGX=1 start-graphene-server &
  119. sleep 10
  120. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8003
  121. '''
  122. sh '''
  123. cd LibOS/shim/test/apps/nginx
  124. make SGX=1
  125. make SGX=1 start-graphene-server &
  126. sleep 30
  127. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8002
  128. '''
  129. sh '''
  130. cd LibOS/shim/test/apps/apache
  131. make SGX=1
  132. make SGX=1 start-graphene-server &
  133. sleep 30
  134. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
  135. '''
  136. sh '''
  137. cd "$(./Scripts/clean-check-test-copy)"
  138. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  139. make -C Pal/src/host/Linux-SGX/sgx-driver distclean
  140. make SGX=1 clean
  141. rm LibOS/glibc-*.tar.gz
  142. make -C LibOS/shim/test/regression SGX=1 clean
  143. make -C LibOS/shim/test/apps/ltp clean
  144. # LTP's make clean is broken, see https://github.com/linux-test-project/ltp/issues/559
  145. rm -rf /tmp/graphene-sgx.clean-check.clean/LibOS/shim/test/apps/ltp/src
  146. rm -rf LibOS/shim/test/apps/ltp/src
  147. make -C LibOS/shim/test/apps/python-simple SGX=1 clean
  148. make -C LibOS/shim/test/apps/python-scipy-insecure SGX=1 clean
  149. make -C LibOS/shim/test/apps/bash SGX=1 clean
  150. make -C LibOS/shim/test/apps/curl SGX=1 clean
  151. make -C LibOS/shim/test/apps/gcc SGX=1 clean
  152. make -C LibOS/shim/test/apps/lmbench SGX=1 distclean
  153. make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
  154. make -C LibOS/shim/test/apps/nginx SGX=1 distclean
  155. make -C LibOS/shim/test/apps/apache SGX=1 distclean
  156. ./Scripts/clean-check
  157. '''
  158. }
  159. post {
  160. always {
  161. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  162. junit 'Pal/regression/pal-regression.xml'
  163. junit 'LibOS/shim/test/regression/libos-regression.xml'
  164. // LTP is ignored under SGX because of random segfaults
  165. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  166. }
  167. }
  168. }
  169. stage('Deploy') {
  170. steps {
  171. sh 'echo Deploying code'
  172. }
  173. }
  174. }
  175. post {
  176. success {
  177. echo 'Deployment successful'
  178. }
  179. failure {
  180. echo 'Failure while on the pipeline'
  181. }
  182. unstable {
  183. echo 'Pipeline marked as "unstable"'
  184. }
  185. }
  186. }