Linux-SGX 8.4 KB

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