Linux-SGX-18.04 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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('Lint') {
  10. steps {
  11. sh '''
  12. ./.ci/run-pylint -f text || :
  13. ./.ci/run-pylint -f json | ./.ci/prfilter
  14. ./.ci/run-shellcheck || :
  15. ./.ci/run-shellcheck -f json | ./.ci/prfilter
  16. '''
  17. }
  18. }
  19. stage('Build') {
  20. steps {
  21. sh '''
  22. ./Scripts/clean-check-prepare
  23. '''
  24. sh '''
  25. cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
  26. '''
  27. sh '''
  28. cd /opt/intel
  29. git clone https://github.com/01org/linux-sgx-driver.git
  30. cd linux-sgx-driver
  31. git checkout sgx_driver_1.9
  32. make
  33. '''
  34. sh '''
  35. cd Pal/src/host/Linux-SGX/sgx-driver
  36. ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
  37. '''
  38. sh '''
  39. make -j 8 SGX=1 WERROR=1
  40. make -j 8 SGX=1 WERROR=1 test
  41. '''
  42. sh '''
  43. make SGX=1 sgx-tokens
  44. '''
  45. }
  46. }
  47. stage('Test') {
  48. steps {
  49. timeout(time: 15, unit: 'MINUTES') {
  50. sh '''
  51. cd Pal/regression
  52. if [ "${ra_client_spid}" != "" ]; then \
  53. make clean SGX=1; \
  54. make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
  55. RA_CLIENT_KEY=${ra_client_key}; \
  56. else \
  57. make SGX=1; \
  58. fi
  59. make SGX=1 all sgx-tokens
  60. make SGX=1 KEEP_LOG=1 regression
  61. '''
  62. }
  63. timeout(time: 15, unit: 'MINUTES') {
  64. sh '''
  65. cd LibOS/shim/test/regression
  66. make SGX=1 all sgx-tokens
  67. make SGX=1 regression
  68. '''
  69. }
  70. timeout(time: 5, unit: 'MINUTES') {
  71. sh '''
  72. cd LibOS/shim/test/fs
  73. make SGX=1 all sgx-tokens
  74. make SGX=1 test
  75. '''
  76. }
  77. // LTP is ignored under SGX because of random segfaults
  78. sh '''
  79. cd LibOS/shim/test/apps/ltp
  80. make SGX=1 all sgx-tokens
  81. make SGX=1 ltp-sgx.xml || :
  82. '''
  83. sh '''
  84. # Workaround LTP bug (see https://github.com/linux-test-project/ltp/issues/560 for upstream fix):
  85. git -C LibOS/shim/test/apps/ltp/src checkout -- utils/ffsb-6.0-rc2/config.h.in utils/ffsb-6.0-rc2/configure
  86. ./Scripts/gitignore-test
  87. '''
  88. sh '''
  89. cd "$(./Scripts/clean-check-test-copy)"
  90. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  91. make SGX=1 distclean
  92. make -C LibOS/shim/test/regression SGX=1 clean
  93. make -C LibOS/shim/test/apps/ltp clean
  94. # LTP's make clean is broken, see https://github.com/linux-test-project/ltp/issues/559
  95. rm -rf /tmp/graphene-sgx-18.04.clean-check.clean/LibOS/shim/test/apps/ltp/src
  96. rm -rf LibOS/shim/test/apps/ltp/src
  97. ./Scripts/clean-check
  98. '''
  99. }
  100. post {
  101. always {
  102. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  103. junit 'Pal/regression/pal-regression.xml'
  104. junit 'LibOS/shim/test/regression/libos-regression.xml'
  105. // LTP is ignored under SGX because of random segfaults
  106. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  107. }
  108. }
  109. }
  110. stage('Deploy') {
  111. steps {
  112. sh 'echo Deploying code'
  113. }
  114. }
  115. }
  116. post {
  117. success {
  118. echo 'Deployment successful'
  119. }
  120. failure {
  121. echo 'Failure while on the pipeline'
  122. }
  123. unstable {
  124. echo 'Pipeline marked as "unstable"'
  125. }
  126. }
  127. }