From c423af8311bdbdbabb6051fd862a7d7b388cae71 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Thu, 6 Jul 2023 18:16:43 -0500 Subject: [PATCH 1/3] Fix deploy job; use absolute path for HOME --- deploy.Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy.Jenkinsfile b/deploy.Jenkinsfile index 7abcd19..375c674 100644 --- a/deploy.Jenkinsfile +++ b/deploy.Jenkinsfile @@ -3,12 +3,18 @@ pipeline { dockerfile { dir 'jenkins' label 'docker' + // Required for the serverless-python-requirements plugin to install + // Python requirements using the AWS build images, running Docker inside Docker. additionalBuildArgs '--build-arg DOCKER_GID=$(stat -c %g /var/run/docker.sock) --build-arg JENKINS_UID=$(id -u jenkins) --build-arg JENKINS_GID=$(id -g jenkins)' args '-v /var/run/docker.sock:/var/run/docker.sock --group-add docker' } } environment { - HOME = "." + // Set HOME to the workspace for the serverless-python-requirements plugin. + // The plugin uses HOME for its default cache location, which needs to be + // mounted in the separate Python build container. This needs to be an absolute + // path that also exists on the host since we're mounting the Docker socket. + HOME = "${env.WORKSPACE}" } options { ansiColor('xterm') From ffb8b7b214f55740e61a8e38ae5529cfe312e189 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Thu, 6 Jul 2023 18:17:19 -0500 Subject: [PATCH 2/3] Add verbose logging to serverless deploy --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c67fe72..9b969c5 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ rebuild-all: deps fetch-serverless-custom-file $(SLS_BINARY) invoke stepf -n rBuilds -d '{"force": true}' serverless-deploy.%: deps fetch-serverless-custom-file - $(SLS_BINARY) deploy --stage $* + $(SLS_BINARY) deploy --stage $* --verbose define GEN_TARGETS docker-build-$(platform): From 503d980dc40fb34122b09c9ba6f68721abb319e2 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Wed, 5 Jul 2023 14:08:22 -0500 Subject: [PATCH 3/3] Ignore more generated files that increase serverless package size by 20M --- serverless.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverless.yml b/serverless.yml index 6f54bb2..3dbf6e8 100644 --- a/serverless.yml +++ b/serverless.yml @@ -11,7 +11,10 @@ package: - integration/** - builder/** - docs/** + # Generated files by other tools - node_modules/** + - .npm/** + - .cache/** provider: name: aws