Linux-SGX-apps 6.8 KB

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