Linux-SGX 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. make -j 8 SGX=1 WERROR=1 test
  39. '''
  40. sh '''
  41. make SGX=1 sgx-tokens
  42. '''
  43. }
  44. }
  45. stage('Test') {
  46. steps {
  47. timeout(time: 15, unit: 'MINUTES') {
  48. sh '''
  49. cd Pal/regression
  50. if [ "${ra_client_spid}" != "" ]; then \
  51. make clean SGX=1; \
  52. make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
  53. RA_CLIENT_KEY=${ra_client_key}; \
  54. else \
  55. make SGX=1; \
  56. fi
  57. make SGX=1 all sgx-tokens
  58. make SGX=1 KEEP_LOG=1 regression
  59. '''
  60. }
  61. timeout(time: 15, unit: 'MINUTES') {
  62. sh '''
  63. cd LibOS/shim/test/regression
  64. make SGX=1 all sgx-tokens
  65. make SGX=1 regression
  66. '''
  67. }
  68. timeout(time: 5, unit: 'MINUTES') {
  69. sh '''
  70. cd LibOS/shim/test/fs
  71. make SGX=1 all sgx-tokens
  72. make SGX=1 test
  73. '''
  74. }
  75. // LTP is ignored under SGX because of random segfaults
  76. sh '''
  77. cd LibOS/shim/test/apps/ltp
  78. make SGX=1 all sgx-tokens
  79. make SGX=1 ltp-sgx.xml || :
  80. '''
  81. sh '''
  82. # Workaround LTP bug (see https://github.com/linux-test-project/ltp/issues/560 for upstream fix):
  83. git -C LibOS/shim/test/apps/ltp/src checkout -- utils/ffsb-6.0-rc2/config.h.in utils/ffsb-6.0-rc2/configure
  84. ./Scripts/gitignore-test
  85. '''
  86. sh '''
  87. cd "$(./Scripts/clean-check-test-copy)"
  88. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  89. make SGX=1 distclean
  90. make -C LibOS/shim/test/regression SGX=1 clean
  91. make -C LibOS/shim/test/apps/ltp clean
  92. # LTP's make clean is broken, see https://github.com/linux-test-project/ltp/issues/559
  93. rm -rf /tmp/graphene-sgx.clean-check.clean/LibOS/shim/test/apps/ltp/src
  94. rm -rf LibOS/shim/test/apps/ltp/src
  95. ./Scripts/clean-check
  96. '''
  97. }
  98. post {
  99. always {
  100. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  101. junit 'Pal/regression/pal-regression.xml'
  102. junit 'LibOS/shim/test/regression/libos-regression.xml'
  103. // LTP is ignored under SGX because of random segfaults
  104. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  105. }
  106. }
  107. }
  108. stage('Deploy') {
  109. steps {
  110. sh 'echo Deploying code'
  111. }
  112. }
  113. }
  114. post {
  115. success {
  116. echo 'Deployment successful'
  117. }
  118. failure {
  119. echo 'Failure while on the pipeline'
  120. }
  121. unstable {
  122. echo 'Pipeline marked as "unstable"'
  123. }
  124. }
  125. }