From 71a81858bb307bed0317c06528b6925981225a5c Mon Sep 17 00:00:00 2001 From: Parker Johnson Date: Fri, 4 Oct 2024 21:35:36 -0600 Subject: [PATCH 1/6] Update deploy-to-lambda.yml try starting shell without installing --- .github/workflows/deploy-to-lambda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-lambda.yml b/.github/workflows/deploy-to-lambda.yml index eaaeffa..d7fc942 100644 --- a/.github/workflows/deploy-to-lambda.yml +++ b/.github/workflows/deploy-to-lambda.yml @@ -38,7 +38,7 @@ jobs: installer-parallel: true - name: Build Project run: | - poetry install --only main --sync --no-interaction + # poetry install --only main --sync --no-interaction poetry shell poetry build poetry run pip install --upgrade -t package dist/*.whl From 02dca97b069598f4f19580298745358567488f8f Mon Sep 17 00:00:00 2001 From: Parker Johnson Date: Fri, 4 Oct 2024 21:37:40 -0600 Subject: [PATCH 2/6] Update deploy-to-lambda.yml try no shell --- .github/workflows/deploy-to-lambda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-lambda.yml b/.github/workflows/deploy-to-lambda.yml index d7fc942..de49f23 100644 --- a/.github/workflows/deploy-to-lambda.yml +++ b/.github/workflows/deploy-to-lambda.yml @@ -38,8 +38,8 @@ jobs: installer-parallel: true - name: Build Project run: | - # poetry install --only main --sync --no-interaction - poetry shell + poetry install --only main --sync --no-interaction + # poetry shell poetry build poetry run pip install --upgrade -t package dist/*.whl cd package ; zip -r ../artifact.zip . -x '*.pyc' From ff6355c8fabaa7ce09332ed6ae436510a64bf833 Mon Sep 17 00:00:00 2001 From: Parker Johnson Date: Fri, 4 Oct 2024 21:41:22 -0600 Subject: [PATCH 3/6] Update deploy-to-lambda.yml try making ./artifact.zip more explicit... --- .github/workflows/deploy-to-lambda.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-lambda.yml b/.github/workflows/deploy-to-lambda.yml index de49f23..52a2591 100644 --- a/.github/workflows/deploy-to-lambda.yml +++ b/.github/workflows/deploy-to-lambda.yml @@ -39,7 +39,6 @@ jobs: - name: Build Project run: | poetry install --only main --sync --no-interaction - # poetry shell poetry build poetry run pip install --upgrade -t package dist/*.whl cd package ; zip -r ../artifact.zip . -x '*.pyc' @@ -56,7 +55,7 @@ jobs: - name: Upload the ZIP file to S3 run : | ls -laF - aws s3 sync artifact.zip s3://sleeper-data-pipeline-backfill-bucket --delete + aws s3 sync ./artifact.zip s3://sleeper-data-pipeline-backfill-bucket --delete # - name: Update the Lambda function # uses: aws-actions/aws-lambda@v1 From 7b5fd749424957480d7d159f1a21808042dd2439 Mon Sep 17 00:00:00 2001 From: Parker Johnson Date: Fri, 4 Oct 2024 21:47:47 -0600 Subject: [PATCH 4/6] Update deploy-to-lambda.yml try just syncing the dist folder, which contains artifact.zip --- .github/workflows/deploy-to-lambda.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy-to-lambda.yml b/.github/workflows/deploy-to-lambda.yml index 52a2591..7a72854 100644 --- a/.github/workflows/deploy-to-lambda.yml +++ b/.github/workflows/deploy-to-lambda.yml @@ -40,27 +40,9 @@ jobs: run: | poetry install --only main --sync --no-interaction poetry build - poetry run pip install --upgrade -t package dist/*.whl - cd package ; zip -r ../artifact.zip . -x '*.pyc' - - # mkdir -p dist/lambda-package - # cp "$(poetry config --list | grep 'cache-dir =' | sed -n '1s/.*"\([^"]*\)".*/\1/p')" dist/lambda-package" - # cp --recur - # poetry build # poetry run pip install --upgrade -t package dist/*.whl - - # - name: Create a ZIP archive - # run: zip -r sleeper-data-pipeline.zip . - + # cd package ; zip -r ./artifact.zip . -x '*.pyc' - name: Upload the ZIP file to S3 run : | ls -laF - aws s3 sync ./artifact.zip s3://sleeper-data-pipeline-backfill-bucket --delete - - # - name: Update the Lambda function - # uses: aws-actions/aws-lambda@v1 - # with: - # function-name: arn:aws:lambda:us-west-2:648295097384:function:sleeper-data-pipeline-backfill - # package-type: Zip - # s3-bucket: sleeper-data-pipeline-backfill-bucket - # s3-key: lambda_function.zip + aws s3 sync ./dist s3://sleeper-data-pipeline-backfill-bucket --delete From 7936dacf13fa427d804338725655340bcc882092 Mon Sep 17 00:00:00 2001 From: Parker Johnson Date: Fri, 4 Oct 2024 21:50:37 -0600 Subject: [PATCH 5/6] Update deploy-to-lambda.yml ll into dist and also try harder to put the zip in there --- .github/workflows/deploy-to-lambda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-lambda.yml b/.github/workflows/deploy-to-lambda.yml index 7a72854..0e5d716 100644 --- a/.github/workflows/deploy-to-lambda.yml +++ b/.github/workflows/deploy-to-lambda.yml @@ -41,8 +41,8 @@ jobs: poetry install --only main --sync --no-interaction poetry build # poetry run pip install --upgrade -t package dist/*.whl - # cd package ; zip -r ./artifact.zip . -x '*.pyc' + # cd package ; zip -r ../dist/artifact.zip . -x '*.pyc' - name: Upload the ZIP file to S3 run : | - ls -laF + ls -laF ./dist aws s3 sync ./dist s3://sleeper-data-pipeline-backfill-bucket --delete From f318311b4e0633b3e3baff41f8c265f3fa165d3d Mon Sep 17 00:00:00 2001 From: Parker Johnson Date: Fri, 4 Oct 2024 21:53:30 -0600 Subject: [PATCH 6/6] Update deploy-to-lambda.yml uncomment the code that makes the zip (lol) --- .github/workflows/deploy-to-lambda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-lambda.yml b/.github/workflows/deploy-to-lambda.yml index 0e5d716..1dd8a08 100644 --- a/.github/workflows/deploy-to-lambda.yml +++ b/.github/workflows/deploy-to-lambda.yml @@ -40,8 +40,8 @@ jobs: run: | poetry install --only main --sync --no-interaction poetry build - # poetry run pip install --upgrade -t package dist/*.whl - # cd package ; zip -r ../dist/artifact.zip . -x '*.pyc' + poetry run pip install --upgrade -t package dist/*.whl + cd package ; zip -r ../dist/artifact.zip . -x '*.pyc' - name: Upload the ZIP file to S3 run : | ls -laF ./dist