Linux-SGX-18.04 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. pipeline {
  2. agent {
  3. dockerfile { filename 'Jenkinsfiles/ubuntu-18.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-pylint -f text || :
  13. ./.ci/run-pylint -f json | ./.ci/prfilter
  14. ./.ci/run-shellcheck || :
  15. ./.ci/run-shellcheck -f json | ./.ci/prfilter
  16. '''
  17. }
  18. }
  19. stage('Build') {
  20. steps {
  21. sh '''
  22. cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
  23. '''
  24. sh '''
  25. cd /opt/intel
  26. git clone https://github.com/01org/linux-sgx-driver.git
  27. cd linux-sgx-driver
  28. git checkout sgx_driver_1.9
  29. make
  30. '''
  31. sh '''
  32. cd Pal/src/host/Linux-SGX/sgx-driver
  33. ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
  34. '''
  35. sh '''
  36. make -j 8 SGX=1 WERROR=1
  37. make -j 8 SGX=1 WERROR=1 test
  38. '''
  39. sh '''
  40. make SGX=1 sgx-tokens
  41. '''
  42. }
  43. }
  44. stage('Test') {
  45. steps {
  46. timeout(time: 15, unit: 'MINUTES') {
  47. sh '''
  48. cd Pal/regression
  49. if [ "${ra_client_spid}" != "" ]; then \
  50. make clean SGX=1; \
  51. make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
  52. RA_CLIENT_KEY=${ra_client_key}; \
  53. else \
  54. make SGX=1; \
  55. fi
  56. make SGX=1 all sgx-tokens
  57. make SGX=1 KEEP_LOG=1 regression
  58. '''
  59. }
  60. timeout(time: 15, unit: 'MINUTES') {
  61. sh '''
  62. cd LibOS/shim/test/regression
  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/fs
  70. make SGX=1 all sgx-tokens
  71. make SGX=1 test
  72. '''
  73. }
  74. // LTP is ignored under SGX because of random segfaults
  75. sh '''
  76. cd LibOS/shim/test/apps/ltp
  77. make SGX=1 all sgx-tokens
  78. make SGX=1 ltp-sgx.xml || :
  79. '''
  80. timeout(time: 5, unit: 'MINUTES') {
  81. sh '''
  82. cd LibOS/shim/test/apps/python-simple
  83. PYTHONVERSION=python3.6 make SGX=1
  84. PYTHONVERSION=python3.6 make SGX=1 check
  85. '''
  86. }
  87. timeout(time: 5, unit: 'MINUTES') {
  88. sh '''
  89. cd LibOS/shim/test/apps/python-scipy-insecure
  90. PYTHONVERSION=python3.6 make SGX=1
  91. PYTHONVERSION=python3.6 make SGX=1 check
  92. '''
  93. }
  94. timeout(time: 5, unit: 'MINUTES') {
  95. sh '''
  96. cd LibOS/shim/test/apps/bash
  97. make SGX=1 all
  98. make SGX=1 regression
  99. '''
  100. }
  101. timeout(time: 5, unit: 'MINUTES') {
  102. sh '''
  103. cd LibOS/shim/test/apps/curl
  104. make SGX=1 all
  105. make SGX=1 check
  106. '''
  107. }
  108. timeout(time: 10, unit: 'MINUTES') {
  109. sh '''
  110. cd LibOS/shim/test/apps/gcc
  111. make SGX=1 all
  112. make SGX=1 check
  113. '''
  114. }
  115. timeout(time: 15, unit: 'MINUTES') {
  116. sh '''
  117. cd LibOS/shim/test/apps/lmbench
  118. make SGX=1 all
  119. make SGX=1 test N_RUNS=1 ENOUGH=100
  120. '''
  121. }
  122. sh '''
  123. cd LibOS/shim/test/apps/lighttpd
  124. make SGX=1
  125. make SGX=1 start-graphene-server &
  126. sleep 10
  127. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8003
  128. '''
  129. sh '''
  130. cd LibOS/shim/test/apps/nginx
  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:8002
  135. '''
  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. */
  145. }
  146. post {
  147. always {
  148. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  149. junit 'Pal/regression/pal-regression.xml'
  150. junit 'LibOS/shim/test/regression/libos-regression.xml'
  151. // LTP is ignored under SGX because of random segfaults
  152. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  153. }
  154. }
  155. }
  156. stage('Deploy') {
  157. steps {
  158. sh 'echo Deploying code'
  159. }
  160. }
  161. }
  162. post {
  163. success {
  164. echo 'Deployment successful'
  165. }
  166. failure {
  167. echo 'Failure while on the pipeline'
  168. }
  169. unstable {
  170. echo 'Pipeline marked as "unstable"'
  171. }
  172. }
  173. }