Linux-SGX 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. sh '''
  61. cd LibOS/shim/test/apps/ltp
  62. make SGX=1 all sgx-tokens
  63. make SGX=1 ltp-sgx.xml
  64. '''
  65. timeout(time: 5, unit: 'MINUTES') {
  66. sh '''
  67. cd LibOS/shim/test/apps/python
  68. make SGX=1 all sgx-tokens
  69. make SGX=1 regression
  70. '''
  71. }
  72. timeout(time: 5, unit: 'MINUTES') {
  73. sh '''
  74. cd LibOS/shim/test/apps/bash
  75. make SGX=1 all
  76. make SGX=1 regression
  77. '''
  78. }
  79. timeout(time: 10, unit: 'MINUTES') {
  80. sh '''
  81. cd LibOS/shim/test/apps/gcc
  82. make SGX=1 all sgx-tokens
  83. make SGX=1 regression
  84. '''
  85. }
  86. timeout(time: 15, unit: 'MINUTES') {
  87. sh '''
  88. cd LibOS/shim/test/apps/lmbench
  89. make SGX=1 all sgx-tokens
  90. make SGX=1 regression N_RUNS=1 ENOUGH=100
  91. '''
  92. }
  93. sh '''
  94. cd LibOS/shim/test/apps/lighttpd
  95. make SGX=1
  96. make SGX=1 start-graphene-server &
  97. sleep 10
  98. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8003
  99. '''
  100. sh '''
  101. cd LibOS/shim/test/apps/apache
  102. make SGX=1
  103. make SGX=1 start-graphene-server &
  104. sleep 30
  105. LOOP=1 CONCURRENCY_LIST="1 32" ./benchmark-http.sh 127.0.0.1:8001
  106. '''
  107. sh '''
  108. cd "$(./Scripts/clean-check-test-copy)"
  109. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  110. make -C Pal/src/host/Linux-SGX/sgx-driver clean
  111. make SGX=1 clean
  112. rm LibOS/glibc-*.tar.gz
  113. make -C LibOS/shim/test/regression SGX=1 clean
  114. make -C LibOS/shim/test/apps/ltp clean
  115. # LTP's make clean is broken, see https://github.com/linux-test-project/ltp/issues/559
  116. rm -rf /tmp/graphene-sgx.clean-check.clean/LibOS/shim/test/apps/ltp/src
  117. rm -rf LibOS/shim/test/apps/ltp/src
  118. make -C LibOS/shim/test/apps/python SGX=1 clean
  119. make -C LibOS/shim/test/apps/bash SGX=1 clean
  120. make -C LibOS/shim/test/apps/gcc SGX=1 clean
  121. make -C LibOS/shim/test/apps/lmbench SGX=1 clean
  122. make -C LibOS/shim/test/apps/lighttpd SGX=1 distclean
  123. make -C LibOS/shim/test/apps/apache SGX=1 distclean
  124. ./Scripts/clean-check
  125. '''
  126. }
  127. post {
  128. always {
  129. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  130. junit 'Pal/regression/pal-regression.xml'
  131. junit 'LibOS/shim/test/regression/libos-regression.xml'
  132. junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  133. }
  134. }
  135. }
  136. stage('Deploy') {
  137. steps {
  138. sh 'echo Deploying code'
  139. }
  140. }
  141. }
  142. post {
  143. success {
  144. echo 'Deployment successful'
  145. }
  146. failure {
  147. echo 'Failure while on the pipeline'
  148. }
  149. unstable {
  150. echo 'Pipeline marked as "unstable"'
  151. }
  152. }
  153. }