Linux-SGX-apps 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. sh '''
  95. cd LibOS/shim/test/apps/lighttpd
  96. make SGX=1
  97. make SGX=1 start-graphene-server &
  98. sleep 10
  99. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8003
  100. '''
  101. sh '''
  102. cd LibOS/shim/test/apps/nginx
  103. make SGX=1
  104. make SGX=1 start-graphene-server &
  105. sleep 30
  106. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8002
  107. '''
  108. sh '''
  109. cd LibOS/shim/test/apps/apache
  110. make SGX=1
  111. make SGX=1 start-graphene-server &
  112. sleep 30
  113. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
  114. '''
  115. sh '''
  116. cd "$(./Scripts/clean-check-test-copy)"
  117. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  118. make -C Pal/src/host/Linux-SGX/sgx-driver distclean
  119. make SGX=1 clean
  120. make -C Pal/lib distclean
  121. rm LibOS/glibc-*.tar.gz
  122. make -C LibOS/shim/test/apps/python-simple SGX=1 clean
  123. make -C LibOS/shim/test/apps/python-scipy-insecure SGX=1 clean
  124. make -C LibOS/shim/test/apps/bash SGX=1 clean
  125. make -C LibOS/shim/test/apps/curl SGX=1 clean
  126. make -C LibOS/shim/test/apps/gcc SGX=1 clean
  127. make -C LibOS/shim/test/apps/lmbench SGX=1 distclean
  128. make -C LibOS/shim/test/apps/redis SGX=1 distclean
  129. make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
  130. make -C LibOS/shim/test/apps/nginx SGX=1 distclean
  131. make -C LibOS/shim/test/apps/apache SGX=1 distclean
  132. # Currently used release of LTP contains broken symlinks under
  133. # utils/ffsb-6.0-rc2/ (config.guess and config.sub); without explicit
  134. # rm of these symlinks, the clean-check utility fails. We should
  135. # update to newer release of LTP where this issue will be fixed.
  136. rm -rf /tmp/graphene-sgx-apps.clean-check.clean/LibOS/shim/test/apps/ltp/src
  137. rm -rf LibOS/shim/test/apps/ltp/src
  138. ./Scripts/clean-check
  139. '''
  140. }
  141. }
  142. stage('Deploy') {
  143. steps {
  144. sh 'echo Deploying code'
  145. }
  146. }
  147. }
  148. post {
  149. success {
  150. echo 'Deployment successful'
  151. }
  152. failure {
  153. echo 'Failure while on the pipeline'
  154. }
  155. unstable {
  156. echo 'Pipeline marked as "unstable"'
  157. }
  158. }
  159. }