Linux-SGX-18.04 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
  23. '''
  24. sh '''
  25. cd /opt/intel
  26. git clone https://github.com/01org/linux-sgx-driver.git
  27. cd linux-sgx-driver
  28. git checkout sgx_driver_1.9
  29. make
  30. '''
  31. sh '''
  32. cd Pal/src/host/Linux-SGX/sgx-driver
  33. ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
  34. '''
  35. sh '''
  36. make -j 8 SGX=1 WERROR=1
  37. make -j 8 SGX=1 WERROR=1 test
  38. '''
  39. sh '''
  40. make SGX=1 sgx-tokens
  41. '''
  42. }
  43. }
  44. stage('Test') {
  45. steps {
  46. timeout(time: 15, unit: 'MINUTES') {
  47. sh '''
  48. cd Pal/regression
  49. if [ "${ra_client_spid}" != "" ]; then \
  50. make clean SGX=1; \
  51. make SGX=1 RA_CLIENT_SPID=${ra_client_spid} \
  52. RA_CLIENT_KEY=${ra_client_key}; \
  53. else \
  54. make SGX=1; \
  55. fi
  56. make SGX=1 all sgx-tokens
  57. make SGX=1 KEEP_LOG=1 regression
  58. '''
  59. }
  60. timeout(time: 15, unit: 'MINUTES') {
  61. sh '''
  62. cd LibOS/shim/test/regression
  63. make SGX=1 all sgx-tokens
  64. make SGX=1 regression
  65. '''
  66. }
  67. timeout(time: 5, unit: 'MINUTES') {
  68. sh '''
  69. cd LibOS/shim/test/fs
  70. make SGX=1 all sgx-tokens
  71. make SGX=1 test
  72. '''
  73. }
  74. // LTP is ignored under SGX because of random segfaults
  75. sh '''
  76. cd LibOS/shim/test/apps/ltp
  77. make SGX=1 all sgx-tokens
  78. make SGX=1 ltp-sgx.xml || :
  79. '''
  80. }
  81. post {
  82. always {
  83. archiveArtifacts 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  84. junit 'Pal/regression/pal-regression.xml'
  85. junit 'LibOS/shim/test/regression/libos-regression.xml'
  86. // LTP is ignored under SGX because of random segfaults
  87. //junit 'LibOS/shim/test/apps/ltp/ltp-sgx.xml'
  88. }
  89. }
  90. }
  91. stage('Deploy') {
  92. steps {
  93. sh 'echo Deploying code'
  94. }
  95. }
  96. }
  97. post {
  98. success {
  99. echo 'Deployment successful'
  100. }
  101. failure {
  102. echo 'Failure while on the pipeline'
  103. }
  104. unstable {
  105. echo 'Pipeline marked as "unstable"'
  106. }
  107. }
  108. }