Skip to content

Commit

Permalink
Shrink the deployment so we can deploy again
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte committed Apr 7, 2024
1 parent a63c47c commit a03da44
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
10 changes: 10 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ poetry export -f requirements.txt --output ingestor/requirements.txt --without-h
pushd ingestor/

poetry run chalice package --stage prod --merge-template .chalice/resources.json cfn/

# Shrink the deployment package for the lambda layer https://stackoverflow.com/a/69355796
zip -d cfn/layer-deployment.zip '*/__pycache__/*'
zip -d cfn/layer-deployment.zip python/**/*.dist-info/**/*
zip -d cfn/layer-deployment.zip python/lib/python3.11/site-packages/numpy*/tests/**/*
zip -d cfn/layer-deployment.zip python/lib/python3.11/site-packages/pandas*/tests/**/*
zip -d cfn/layer-deployment.zip python/lib/python3.11/site-packages/pyarrow*/tests/**/*
zip -d cfn/layer-deployment.zip python/lib/python3.11/site-packages/boto3*/**/*
zip -d cfn/layer-deployment.zip python/lib/python3.11/site-packages/botocore*/**/*

aws cloudformation package --template-file cfn/sam.json --s3-bucket $BUCKET --output-template-file cfn/packaged.yaml
aws cloudformation deploy --template-file cfn/packaged.yaml --stack-name $STACK_NAME \
--capabilities CAPABILITY_NAMED_IAM --no-fail-on-empty-changeset \
Expand Down
2 changes: 1 addition & 1 deletion ingestor/.chalice/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"iam_policy_file": "policy-yankee.json",
"lambda_memory_size": 1024,
"lambda_timeout": 60,
"max_ebs_size_gb": 5
"max_ebs_size_gb": 2
},
"process_daily_lamp": {
"iam_policy_file": "policy-lamp-ingest.json",
Expand Down
4 changes: 3 additions & 1 deletion ingestor/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ def store_landing_data(event):


# Runs every 5 minutes from either 4 AM -> 1:55AM or 5 AM -> 2:55 AM depending on DST
@app.schedule(Cron("0/5", "0-6,9-23", "*", "*", "?", "*"))
# @app.schedule(Cron("0/5", "0-6,9-23", "*", "*", "?", "*"))
# Hourly frequency for now until we've fixed things up
@app.schedule(Cron("0", "0-6,9-23", "*", "*", "?", "*"))
def update_yankee_shuttles(event):
yankee.update_shuttles()

Expand Down
31 changes: 10 additions & 21 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a03da44

Please sign in to comment.