Linux-SGX-apps 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. '''
  39. }
  40. }
  41. stage('Test') {
  42. steps {
  43. timeout(time: 5, unit: 'MINUTES') {
  44. sh '''
  45. cd LibOS/shim/test/apps/python-simple
  46. make SGX=1
  47. make SGX=1 check
  48. '''
  49. }
  50. timeout(time: 5, unit: 'MINUTES') {
  51. sh '''
  52. cd LibOS/shim/test/apps/python-scipy-insecure
  53. make SGX=1
  54. make SGX=1 check
  55. '''
  56. }
  57. timeout(time: 5, unit: 'MINUTES') {
  58. sh '''
  59. cd LibOS/shim/test/apps/bash
  60. make SGX=1 all
  61. make SGX=1 regression
  62. '''
  63. }
  64. timeout(time: 5, unit: 'MINUTES') {
  65. sh '''
  66. cd LibOS/shim/test/apps/curl
  67. make SGX=1 all
  68. make SGX=1 check
  69. '''
  70. }
  71. timeout(time: 10, unit: 'MINUTES') {
  72. sh '''
  73. cd LibOS/shim/test/apps/gcc
  74. make SGX=1 all
  75. make SGX=1 check
  76. '''
  77. }
  78. timeout(time: 15, unit: 'MINUTES') {
  79. sh '''
  80. cd LibOS/shim/test/apps/lmbench
  81. make SGX=1 all
  82. make SGX=1 test N_RUNS=1 ENOUGH=100
  83. '''
  84. }
  85. timeout(time: 15, unit: 'MINUTES') {
  86. sh '''
  87. cd LibOS/shim/test/apps/redis
  88. make SGX=1 USE_SELECT=1
  89. make SGX=1 start-graphene-server &
  90. sleep 30
  91. ./src/src/redis-benchmark
  92. '''
  93. }
  94. timeout(time: 15, unit: 'MINUTES') {
  95. sh '''
  96. cd LibOS/shim/test/apps/lighttpd
  97. make SGX=1
  98. make SGX=1 start-graphene-server &
  99. sleep 10
  100. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8003
  101. '''
  102. }
  103. timeout(time: 15, unit: 'MINUTES') {
  104. sh '''
  105. cd LibOS/shim/test/apps/nginx
  106. make SGX=1
  107. make SGX=1 start-graphene-server &
  108. sleep 30
  109. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8002
  110. '''
  111. }
  112. timeout(time: 25, unit: 'MINUTES') {
  113. sh '''
  114. cd LibOS/shim/test/apps/apache
  115. make SGX=1
  116. make SGX=1 start-graphene-server &
  117. sleep 30
  118. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
  119. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh https://127.0.0.1:8443
  120. '''
  121. }
  122. timeout(time: 5, unit: 'MINUTES') {
  123. sh '''
  124. cd LibOS/shim/test/apps/blender
  125. make SGX=1
  126. make SGX=1 check
  127. '''
  128. }
  129. sh '''
  130. ./Scripts/gitignore-test
  131. '''
  132. sh '''
  133. cd "$(./Scripts/clean-check-test-copy)"
  134. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  135. make SGX=1 distclean
  136. make -C LibOS/shim/test/apps/python-simple SGX=1 clean
  137. make -C LibOS/shim/test/apps/python-scipy-insecure SGX=1 clean
  138. make -C LibOS/shim/test/apps/bash SGX=1 clean
  139. make -C LibOS/shim/test/apps/curl SGX=1 clean
  140. make -C LibOS/shim/test/apps/gcc SGX=1 clean
  141. make -C LibOS/shim/test/apps/lmbench SGX=1 distclean
  142. make -C LibOS/shim/test/apps/redis SGX=1 distclean
  143. make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
  144. make -C LibOS/shim/test/apps/nginx SGX=1 distclean
  145. make -C LibOS/shim/test/apps/apache SGX=1 distclean
  146. make -C LibOS/shim/test/apps/blender SGX=1 distclean
  147. # Currently used release of LTP contains broken symlinks under
  148. # utils/ffsb-6.0-rc2/ (config.guess and config.sub); without explicit
  149. # rm of these symlinks, the clean-check utility fails. We should
  150. # update to newer release of LTP where this issue will be fixed.
  151. rm -rf /tmp/graphene-sgx-apps.clean-check.clean/LibOS/shim/test/apps/ltp/src
  152. rm -rf LibOS/shim/test/apps/ltp/src
  153. ./Scripts/clean-check
  154. '''
  155. }
  156. }
  157. stage('Deploy') {
  158. steps {
  159. sh 'echo Deploying code'
  160. }
  161. }
  162. }
  163. post {
  164. success {
  165. echo 'Deployment successful'
  166. }
  167. failure {
  168. echo 'Failure while on the pipeline'
  169. }
  170. unstable {
  171. echo 'Pipeline marked as "unstable"'
  172. }
  173. }
  174. }