Skip to content

Quickstart documentation points to the wrong build-lambdas.sh #49

Open
@ThiagoDella

Description

@ThiagoDella

Description

As of today the Quickstart documentation mentions under the "Setup the serverless image resizer" section that the developer should execute the bash script located at: deployment/build-lambdas.sh.

Image

Apparently there are two issues with the script:

  1. It produces zipped files with sub folders, the zip file inner structure looks like: lambdas/${lambda_name}/handler.py, which breaks the commands defined in deployment/awslocal/deploy.sh and in the terraform/main.tf files. Both of them expect the handler.py file to be at the root of the zipped file.
  2. It does not build the dependencies needed by the resize lambda. They are defined in lambdas/resize/requirements.txt and need to be built before zipping the resize lambda. Which prevents the resize lambda from working properly.

Possible solution

Fortunately this repo has another build-lambdas.sh script, this one located at: bin/build-lambdas.sh (used to be part of the deploy.sh in earlier versions). This script works as intended as it:

  • Navigates to each lambda folder for compressing the files, avoiding the wrong inner structure mentioned in my first listed issue;
  • Builds the required dependencies for the resize lambda.

It's worth noting that this script is also used by the Makefile (the build-lambdas function) and in the CI pipelines of this repo.

I can gladly make a PR moving things around but considering that the "correct" version of the build-lambdas.sh is already inside the bin folder (which makes sense) and is also used in multiple places inside this repo, it probably makes more sense to adapt the Quickstart documentation to point to the correct build-lambdas.sh and delete the other one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions