Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Switch to official AWS docker images by default #724

Merged
merged 2 commits into from
Oct 23, 2022

Conversation

pgrzesik
Copy link
Contributor

@pgrzesik pgrzesik commented Sep 27, 2022

BREAKING CHANGE: Switches to official AWS docker images from previous lambci images that did not support Python 3.9

Switch to official images as defaults for packaging with Docker. Please note that it's a breaking change and will be released as a part of next major version of the plugin.

Closes: #647

@pgrzesik pgrzesik self-assigned this Sep 27, 2022
@pgrzesik pgrzesik marked this pull request as draft September 27, 2022 17:36
@pgrzesik pgrzesik force-pushed the change-default-images-to-official-aws branch from f880bb8 to babcb38 Compare September 28, 2022 18:50
@pgrzesik pgrzesik marked this pull request as ready for review October 4, 2022 18:02
@pgrzesik pgrzesik force-pushed the change-default-images-to-official-aws branch from babcb38 to f89d05d Compare October 4, 2022 18:25
@nc-dirknilius
Copy link

Should we also automatically use the matching platform image (e.g. arm64)?

This should be it:

const defaultImage = `public.ecr.aws/sam/build-${this.serverless.service.provider.runtime}:latest-${this.serverless.service.provider.architecture}`;

Currently to build arm64 based Lambdas we do this:

provider:
  name: aws
  runtime: python3.9
  architecture: arm64

custom:
  pythonRequirements:
    dockerizePip: true
    dockerImage: public.ecr.aws/sam/build-${self:provider.runtime}:latest-${self:provider.architecture}

With the suggested change to the PR, the dockerImage option could be omitted entirely and would always pick the right build image based on the requested architecture.

@pgrzesik
Copy link
Contributor Author

Hey @nc-dirknilius, thanks for the proposition. I didn't think of that previously, but it sounds like a really good idea. I'll add that to the PR 👍

BREAKING CHANGE: Switches to official AWS docker images from
previous `lambci` images that did not support Python 3.9
@pgrzesik pgrzesik force-pushed the change-default-images-to-official-aws branch from f89d05d to 654e0f1 Compare October 23, 2022 13:56
@pgrzesik pgrzesik merged commit 4ba3bbe into master Oct 23, 2022
@pgrzesik pgrzesik deleted the change-default-images-to-official-aws branch October 23, 2022 20:50
badouralix added a commit to badouralix/rclone-lambda-sync that referenced this pull request Oct 25, 2022
Overriding the default docker image for serverless is not needed as of serverless/serverless-python-requirements#724
whisller added a commit to epsylabs/serverless-builder that referenced this pull request Jan 5, 2023
…`6.0.0`

With version `6.0.0` of `serverless-python-requirements` they switched to use official AWS docker images.
More info can be found in serverless/serverless-python-requirements#724

So we don’t need `lambci/lambda` anymore.

With this change everyone who is using `serverless-python-requirements` plugin and will update `serverless-builder`, would have to upgrade `serverless-python-requirements` itself.

I was considering two less breaking change approach like:

1. Introduce new plugin class
```
class PythonRequirements600 {

}
```

2. Modification of `PythonRequirements.__init__` and add `version` parameter

But to be honest I don’t think it’s worth to maintain this backward compatibility.
whisller added a commit to epsylabs/serverless-builder that referenced this pull request Jan 5, 2023
…`6.0.0`

With version `6.0.0` of `serverless-python-requirements` they switched to use official AWS docker images.
More info can be found in serverless/serverless-python-requirements#724

So we don’t need `lambci/lambda` anymore.

With this change everyone who is using `serverless-python-requirements` plugin and will update `serverless-builder`, would have to upgrade `serverless-python-requirements` itself.

I was considering two less breaking change approach like:

1. Introduce new plugin class
```
class PythonRequirements600 {

}
```

2. Modification of `PythonRequirements.__init__` and add `version` parameter

But to be honest I don’t think it’s worth to maintain this backward compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

serverless docker images (python 3.9)
2 participants