Skip to content

Commit

Permalink
Merge branch 'master' into merge_ruby_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
mndeveci authored Nov 7, 2023
2 parents ee416e3 + 9badf4c commit bcbfc23
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 25 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build_test_invoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [master, "feat*"]

env:
PYTHON_VERSION_INSTALL: '3.7'
PYTHON_VERSION_INSTALL: '3.11'
SAM_CLI_DEV: 1
PIP_CARGO_LAMBDA_VERSION: '0.17.1'

Expand Down Expand Up @@ -102,16 +102,12 @@ jobs:
- version: '3.11'
type: 'Invoke'
file: 'tests/integration/build_invoke/python/test_python_3_11.py'
env:
PYTHON_VERSION_INSTALL: ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
env:
PYTHON_VERSION_INSTALL: ${{ matrix.version }}
- uses: actions/setup-python@v4
name: Setup Python ${{ matrix.version }}
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ npm run build && cd dist/
aws s3 sync . s3://$s3_bucket_name/

# Create cloudfront invalidation and capture id for next step
invalidation_output=$(aws cloudfront create-invalidation --distribution-id $cloudfront_distribution_id --paths "/*")
invalidation_id=$(echo "$invalidation_output" | grep -oP '(?<="Id": ")[^"]+')
invalidation_id=$(aws cloudfront create-invalidation --distribution-id $cloudfront_distribution_id --paths "/*" --query "Invalidation.Id" --output text)

# Wait for cloudfront invalidation to complete
aws cloudfront wait invalidation-completed --distribution-id $cloudfront_distribution_id --id $invalidation_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.10

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

RUN python3.10 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM public.ecr.aws/lambda/python:3.10

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

# temporarily install gcc so that scikit-learn can be built
RUN yum install gcc-c++ -y

RUN python3.10 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.10

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

RUN python3.10 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.10

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

RUN python3.10 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.10

COPY app.py requirements.txt ./
COPY requirements.txt ./

RUN {{cookiecutter.runtime}} -m pip install -r requirements.txt -t .

COPY app.py ./

# Command can be overwritten by providing a different command in the template directly.
CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.11

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

RUN python3.11 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM public.ecr.aws/lambda/python:3.11

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

# temporarily install gcc so that scikit-learn can be built
RUN yum install gcc-c++ -y

RUN python3.11 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.11

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

RUN python3.11 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.11

COPY app.py requirements.txt ./
COPY model /opt/ml/model
COPY requirements.txt ./

RUN python3.11 -m pip install -r requirements.txt -t .

COPY model /opt/ml/model
COPY app.py ./

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM public.ecr.aws/lambda/python:3.11

COPY app.py requirements.txt ./
COPY requirements.txt ./

RUN {{cookiecutter.runtime}} -m pip install -r requirements.txt -t .

COPY app.py ./

# Command can be overwritten by providing a different command in the template directly.
CMD ["app.lambda_handler"]

0 comments on commit bcbfc23

Please sign in to comment.