Linux-SGX-18.04 6.9 KB

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