Linux-SGX 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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('Build') {
  10. steps {
  11. sh '''
  12. ./Scripts/clean-check-prepare
  13. '''
  14. sh '''
  15. cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
  16. '''
  17. sh '''
  18. cd /opt/intel
  19. git clone https://github.com/01org/linux-sgx-driver.git
  20. cd linux-sgx-driver
  21. git checkout sgx_driver_1.9
  22. make
  23. '''
  24. sh '''
  25. cd Pal/src/host/Linux-SGX/sgx-driver
  26. ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
  27. '''
  28. sh '''
  29. make -j 8 SGX=1 WERROR=1
  30. make -j 8 SGX=1 WERROR=1 test
  31. '''
  32. sh '''
  33. make SGX=1 sgx-tokens
  34. '''
  35. }
  36. }
  37. stage('Test') {
  38. steps {
  39. timeout(time: 15, unit: 'MINUTES') {
  40. sh '''
  41. cd Pal/regression
  42. if [ "${ra_client_spid}" != "" ]; then \
  43. make clean SGX=1; \
  44. make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
  45. RA_CLIENT_KEY=${ra_client_key}; \
  46. else \
  47. make SGX=1; \
  48. fi
  49. make SGX=1 all sgx-tokens
  50. make SGX=1 KEEP_LOG=1 regression
  51. '''
  52. }
  53. timeout(time: 15, unit: 'MINUTES') {
  54. sh '''
  55. cd LibOS/shim/test/regression
  56. make SGX=1 all sgx-tokens
  57. make SGX=1 regression
  58. '''
  59. }
  60. // LTP is ignored under SGX because of random segfaults
  61. sh '''
  62. cd LibOS/shim/test/apps/ltp
  63. make SGX=1 all sgx-tokens
  64. make SGX=1 ltp-sgx.xml || :
  65. '''
  66. timeout(time: 5, unit: 'MINUTES') {
  67. sh '''
  68. cd LibOS/shim/test/apps/python
  69. make SGX=1 all sgx-tokens
  70. make SGX=1 regression
  71. '''
  72. }
  73. timeout(time: 5, unit: 'MINUTES') {
  74. sh '''
  75. cd LibOS/shim/test/apps/bash
  76. make SGX=1 all
  77. make SGX=1 regression
  78. '''
  79. }
  80. timeout(time: 10, unit: 'MINUTES') {
  81. sh '''
  82. cd LibOS/shim/test/apps/gcc
  83. make SGX=1 all
  84. make SGX=1 check
  85. '''
  86. }
  87. timeout(time: 15, unit: 'MINUTES') {
  88. sh '''
  89. cd LibOS/shim/test/apps/lmbench
  90. make SGX=1 all sgx-tokens
  91. make SGX=1 regression N_RUNS=1 ENOUGH=100
  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/apache
  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:8001
  107. '''
  108. sh '''
  109. cd "$(./Scripts/clean-check-test-copy)"
  110. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  111. make -C Pal/src/host/Linux-SGX/sgx-driver distclean
  112. make SGX=1 clean
  113. rm LibOS/glibc-*.tar.gz
  114. make -C LibOS/shim/test/regression SGX=1 clean
  115. make -C LibOS/shim/test/apps/ltp clean
  116. # LTP's make clean is broken, see https://github.com/linux-test-project/ltp/issues/559
  117. rm -rf /tmp/graphene-sgx.clean-check.clean/LibOS/shim/test/apps/ltp/src
  118. rm -rf LibOS/shim/test/apps/ltp/src
  119. make -C LibOS/shim/test/apps/python SGX=1 clean
  120. make -C LibOS/shim/test/apps/bash SGX=1 clean
  121. make -C LibOS/shim/test/apps/gcc SGX=1 clean
  122. make -C LibOS/shim/test/apps/lmbench SGX=1 clean
  123. make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
  124. make -C LibOS/shim/test/apps/apache SGX=1 distclean
  125. ./Scripts/clean-check
  126. '''
  127. }
  128. post {
  129. always {
  130. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  131. junit 'Pal/regression/pal-regression.xml'
  132. junit 'LibOS/shim/test/regression/libos-regression.xml'
  133. // LTP is ignored under SGX because of random segfaults
  134. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  135. }
  136. }
  137. }
  138. stage('Deploy') {
  139. steps {
  140. sh 'echo Deploying code'
  141. }
  142. }
  143. }
  144. post {
  145. success {
  146. echo 'Deployment successful'
  147. }
  148. failure {
  149. echo 'Failure while on the pipeline'
  150. }
  151. unstable {
  152. echo 'Pipeline marked as "unstable"'
  153. }
  154. }
  155. }