Skip to content

Conversation

@noxasaxon
Copy link
Contributor

@noxasaxon noxasaxon commented Feb 4, 2020

Abort serverless deploy when plugin fails to package a lambda function properly.

if abortOnPackagingErrors: true -

  • pip install git clone will print to stderr, ignore it
  • check if error is related to docker, if so abort
  • all other errors, prompt to continue or abort

index.js Outdated
setupContainer(){
let out = this.runProcess('docker',['ps', '-a', '--filter',`name=${this.containerName}`,'--format','{{.Names}}'])
out = out.replace(/^\s+|\s+$/g, '')
console.log('SDLFKJSDL:KFJSDL:KFJ ', this.containerName)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is no longer needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol!

README.md Outdated
| useDocker | Boolean indicating whether to package pip dependencies using Docker. Set this to true if your project uses platform-specific compiled libraries like numpy. Requires a [Docker installation](https://www.docker.com/get-docker). | Yes. Defaults to `false` |
| dockerImage | The Docker image to use to compile functions if `useDocker` is set to `true`. Must be specified as `repository:tag`. If the image doesn't exist on the system, it will be downloaded. The initial download may take some time. | Yes. Defaults to `lambci/lambda:build-${provider.runtime}` |
| containerName | The desired name for the Docker container. | Yes. Defaults to `serverless-package-python-functions` |
| usePackagingErrorAlerts | Boolean indicating whether you want to stop deployment when packaging errors are detected. Example errors include: `useDocker` is enabled but the Docker service is not running, pip finds dependency mismatches, virtual environment errrors, etc.. When an error is detected, this will prompt via commandline to continue or abort deploy. | Yes. Defaults to `false` |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with a more descriptive/intuitive name, Like abortOnPackagingErrors

README.md Outdated
| useDocker | Boolean indicating whether to package pip dependencies using Docker. Set this to true if your project uses platform-specific compiled libraries like numpy. Requires a [Docker installation](https://www.docker.com/get-docker). | Yes. Defaults to `false` |
| dockerImage | The Docker image to use to compile functions if `useDocker` is set to `true`. Must be specified as `repository:tag`. If the image doesn't exist on the system, it will be downloaded. The initial download may take some time. | Yes. Defaults to `lambci/lambda:build-${provider.runtime}` |
| containerName | The desired name for the Docker container. | Yes. Defaults to `serverless-package-python-functions` |
| abortOnPackagingErrors | Boolean indicating whether you want to stop deployment when packaging errors are detected. Example errors include: `useDocker` is enabled but the Docker service is not running, pip finds dependency mismatches, virtual environment errrors, etc.. When an error is detected, this will prompt via commandline to continue or abort deploy. | Yes. Defaults to `false` |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of Example errors include: let's go with: Examples of scenarios that will cause packaging errors include:

@ubaniabalogun ubaniabalogun merged commit 03b1544 into ubaniabalogun:master Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants