Linux-SGX 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. cd "$(./Scripts/clean-check-test-copy)"
  83. rm Pal/src/host/Linux-SGX/signer/enclave-key.pem
  84. make -C Pal/src/host/Linux-SGX/sgx-driver distclean
  85. make SGX=1 clean
  86. make -C Pal/lib distclean
  87. rm LibOS/glibc-*.tar.gz
  88. make -C LibOS/shim/test/regression SGX=1 clean
  89. make -C LibOS/shim/test/apps/ltp clean
  90. # LTP's make clean is broken, see https://github.com/linux-test-project/ltp/issues/559
  91. rm -rf /tmp/graphene-sgx.clean-check.clean/LibOS/shim/test/apps/ltp/src
  92. rm -rf LibOS/shim/test/apps/ltp/src
  93. ./Scripts/clean-check
  94. '''
  95. }
  96. post {
  97. always {
  98. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  99. junit 'Pal/regression/pal-regression.xml'
  100. junit 'LibOS/shim/test/regression/libos-regression.xml'
  101. // LTP is ignored under SGX because of random segfaults
  102. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  103. }
  104. }
  105. }
  106. stage('Deploy') {
  107. steps {
  108. sh 'echo Deploying code'
  109. }
  110. }
  111. }
  112. post {
  113. success {
  114. echo 'Deployment successful'
  115. }
  116. failure {
  117. echo 'Failure while on the pipeline'
  118. }
  119. unstable {
  120. echo 'Pipeline marked as "unstable"'
  121. }
  122. }
  123. }