Linux-SGX-18.04-apps 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. sh '''
  97. cd LibOS/shim/test/apps/lighttpd
  98. make SGX=1
  99. make SGX=1 start-graphene-server &
  100. sleep 10
  101. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8003
  102. '''
  103. sh '''
  104. cd LibOS/shim/test/apps/nginx
  105. make SGX=1
  106. make SGX=1 start-graphene-server &
  107. sleep 30
  108. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8002
  109. '''
  110. sh '''
  111. cd LibOS/shim/test/apps/apache
  112. make SGX=1
  113. make SGX=1 start-graphene-server &
  114. sleep 30
  115. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
  116. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh https://127.0.0.1:8443
  117. '''
  118. sh '''
  119. cd "$(./Scripts/clean-check-test-copy)"
  120. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  121. make SGX=1 distclean
  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-18.04-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. }