Linux-SGX-18.04-apps 7.9 KB

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