Browse Source

[Jenkins] Set up 18.04 CI jobs, fix one unit PAL unit test

Don Porter 5 years ago
parent
commit
27ca6f0700

+ 83 - 0
Jenkinsfiles/Linux-18.04

@@ -0,0 +1,83 @@
+pipeline {
+        agent {
+              dockerfile { filename 'Jenkinsfiles/ubuntu-18.04.dockerfile' }
+        }
+        stages {
+                stage('Build') {
+                    steps {
+                        sh '''
+                            make -j 8 WERROR=1
+                           '''
+                    }
+                }
+                stage('Test') {
+                    steps {
+                        sh '''
+                            cd Pal/regression
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/regression
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/ltp
+                            make
+                            ./syscalls.sh
+                            '''
+                        timeout(time: 5, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/python
+                                make regression
+                            '''
+                        }
+                        sh '''
+                            cd LibOS/shim/test/apps/bash
+                            make regression
+                            '''
+                        timeout(time: 5, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/gcc
+                                make regression
+                           '''
+                        }
+                        timeout(time: 15, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/lmbench
+                                make regression
+                            '''
+                        }
+                        sh '''
+                            cd LibOS/shim/test/apps/lighttpd
+                            make
+                            make start-graphene-server &
+                            sleep 1
+                            ./benchmark-http.sh `hostname -I|tr -d '[:space:]'`:8000
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/apache
+                            make
+                            make start-graphene-server &
+                            sleep 1
+                            ./benchmark-http.sh `hostname -I|tr -d '[:space:]'`:8001
+                            '''
+                    }
+                }
+                stage('Deploy') {
+                    steps {
+                        sh 'echo Deploying code'
+                    }
+                }
+        }
+        post {
+                success {
+                        echo 'Deployment successful'
+                }
+                failure {
+                        echo 'Failure while on the pipeline'
+                }
+                unstable {
+                        echo 'Pipeline marked as "unstable"'
+                }
+        }
+}

+ 83 - 0
Jenkinsfiles/Linux-Debug-18.04

@@ -0,0 +1,83 @@
+pipeline {
+        agent {
+              dockerfile { filename 'Jenkinsfiles/ubuntu-18.04.dockerfile' }
+        }
+        stages {
+                stage('Build') {
+                    steps {
+                        sh '''
+                            make -j 8 DEBUG=1 WERROR=1
+                           '''
+                    }
+                }
+                stage('Test') {
+                    steps {
+                        sh '''
+                            cd Pal/regression
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/regression
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/ltp
+                            make
+                            ./syscalls.sh
+                            '''
+                        timeout(time: 5, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/python
+                                make regression
+                            '''
+                        }
+                        sh '''
+                            cd LibOS/shim/test/apps/bash
+                            make regression
+                            '''
+                        timeout(time: 5, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/gcc
+                                make regression
+                           '''
+                        }
+                        timeout(time: 20, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/lmbench
+                                make regression
+                            '''
+                        }
+                        sh '''
+                            cd LibOS/shim/test/apps/lighttpd
+                            make
+                            make start-graphene-server &
+                            sleep 1
+                            ./benchmark-http.sh `hostname -I|tr -d '[:space:]'`:8000
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/apache
+                            make
+                            make start-graphene-server &
+                            sleep 1
+                            ./benchmark-http.sh `hostname -I|tr -d '[:space:]'`:8001
+                            '''
+                    }
+                }
+                stage('Deploy') {
+                    steps {
+                        sh 'echo Deploying code'
+                    }
+                }
+        }
+        post {
+                success {
+                        echo 'Deployment successful'
+                }
+                failure {
+                        echo 'Failure while on the pipeline'
+                }
+                unstable {
+                        echo 'Pipeline marked as "unstable"'
+                }
+        }
+}

+ 119 - 0
Jenkinsfiles/Linux-SGX-18.04

@@ -0,0 +1,119 @@
+pipeline {
+        agent {
+            dockerfile { filename 'Jenkinsfiles/ubuntu-18.04.dockerfile'
+                         label 'sgx_slave'
+                         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"
+                       }
+        }
+        stages {
+                stage('Build') {
+                    steps {
+                        sh '''
+                            cd Pal/src/host/Linux-SGX/signer/ && openssl genrsa -3 -out enclave-key.pem 3072
+                        '''
+                        sh '''
+                           cd /opt/intel
+                           git clone https://github.com/01org/linux-sgx-driver.git
+                           cd linux-sgx-driver
+                           git checkout sgx_driver_1.9
+                           make
+                        '''
+                        sh '''
+                            cd Pal/src/host/Linux-SGX/sgx-driver
+                            ISGX_DRIVER_PATH=/opt/intel/linux-sgx-driver ISGX_DRIVER_VERSION=1.9 make
+                        '''
+                        sh '''
+                            make -j 8 SGX=1 WERROR=1
+                        '''
+                        sh '''
+                            make SGX_RUN=1
+                        '''
+                    }
+                }
+                stage('Test') {
+                    steps {
+                        timeout(time: 15, unit: 'MINUTES') {
+                            sh '''
+                                cd Pal/regression
+                                make SGX=1
+                                make SGX_RUN=1
+                                make SGX_RUN=1 KEEP_LOG=1 regression
+                                '''
+                        }
+                        timeout(time: 15, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/regression
+                                make SGX=1
+                                make SGX_RUN=1
+                                make SGX_RUN=1 regression
+                            '''
+                        }
+                        timeout(time: 5, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/python
+                                make SGX=1
+                                make SGX_RUN=1
+                                make SGX_RUN=1 regression
+                            '''
+      }
+      timeout(time: 5, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/bash
+                                make SGX=1
+                                make SGX_RUN=1
+                                make SGX_RUN=1 regression
+                           '''
+      }
+                        timeout(time: 5, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/gcc
+                                make SGX=1
+                                make SGX_RUN=1
+                                make SGX_RUN=1 regression
+                           '''
+                        }
+                        timeout(time: 15, unit: 'MINUTES') {
+                            sh '''
+                                cd LibOS/shim/test/apps/lmbench
+                                make SGX=1
+                                make SGX_RUN=1
+                                make SGX_RUN=1 regression
+                            '''
+                        }
+                        sh '''
+                            cd LibOS/shim/test/apps/lighttpd
+                            make SGX=1
+                            make SGX_RUN=1
+                            make SGX_RUN=1 start-graphene-server &
+                            sleep 10
+                            ./benchmark-http.sh `hostname -I|tr -d '[:space:]'`:8000
+                            '''
+                            /*
+                        sh '''
+                            cd LibOS/shim/test/apps/apache
+                            make SGX=1
+                            make SGX_RUN=1
+                            make SGX_RUN=1 start-graphene-server &
+                            sleep 15 && ./benchmark-http.sh `hostname -I|tr -d '[:space:]'`:8001
+                            '''
+                            */
+                    }
+                }
+                stage('Deploy') {
+                    steps {
+                        sh 'echo Deploying code'
+                    }
+                }
+        }
+        post {
+                success {
+                        echo 'Deployment successful'
+                }
+                failure {
+                        echo 'Failure while on the pipeline'
+                }
+                unstable {
+                        echo 'Pipeline marked as "unstable"'
+                }
+        }
+}

+ 46 - 0
Jenkinsfiles/ubuntu-18.04.dockerfile

@@ -0,0 +1,46 @@
+# Start with 18.04
+FROM ubuntu:18.04
+
+# Add steps here to set up dependencies
+RUN apt-get update && apt-get install -y \
+    apache2-utils \
+    autoconf \
+    build-essential \
+    gawk \
+    gettext \
+    git \
+    libexpat1 \
+    libexpat1-dev \
+    libomp-dev \
+    libpcre3-dev \
+    libxml2-dev \
+    net-tools \
+    python \
+    python-protobuf \
+    texinfo \
+    wget
+
+# Add the user UID:1001, GID:1001, home at /leeroy
+RUN groupadd -r leeroy -g 1001 && useradd -u 1001 -r -g leeroy -m -d /leeroy -c "Leeroy Jenkins" leeroy && \
+    chmod 755 /leeroy
+
+# Make sure /leeroy can be written by leeroy
+RUN chown 1001 /leeroy
+
+# Blow away any random state
+RUN rm -f /leeroy/.rnd
+
+# Make a directory for the intel driver
+RUN mkdir -p /opt/intel && chown 1001 /opt/intel
+
+# Set the working directory to leeroy home directory
+WORKDIR /leeroy
+
+# Specify the user to execute all commands below
+USER leeroy
+
+# Set environment variables.
+ENV HOME /leeroy
+
+# Define default command.
+CMD ["bash"]

+ 4 - 3
Pal/regression/Bootstrap.c

@@ -1,5 +1,6 @@
 #include "pal.h"
 #include "pal_debug.h"
+#include <string.h>
 
 static int test_data = 0;
 static int test_func (void) { return 0; }
@@ -14,7 +15,7 @@ int main (int argc, char ** argv, char ** envp)
     pal_printf("Loaded Executable: %s\n", pal_control.executable);
 
     /* check manifest name */
-    char manifest[30] = "";
+    char manifest[30];
     DkStreamGetName(pal_control.manifest_handle, manifest, 30);
     pal_printf("Loaded Manifest: %s\n", manifest);
 
@@ -33,8 +34,8 @@ int main (int argc, char ** argv, char ** envp)
     pal_printf("Parent Process: %p\n", pal_control.parent_process);
 
     /* test debug stream */
-    char msg[] = "Written to Debug Stream\n";
-    DkStreamWrite(pal_control.debug_stream, 0, sizeof(msg), msg, NULL);
+    char *msg = "Written to Debug Stream\n";
+    DkStreamWrite(pal_control.debug_stream, 0, strlen(msg), msg, NULL);
 
     /* page size */
     pal_printf("Page Size: %ld\n", pal_control.pagesize);