GithubHelp home page GithubHelp logo

aws-actions / setup-sam Goto Github PK

View Code? Open in Web Editor NEW
140.0 140.0 22.0 268 KB

Action to set up AWS SAM CLI and add it to the PATH

License: Apache License 2.0

JavaScript 100.00%
aws-sam-cli cicd sam serverless

setup-sam's People

Contributors

aahung avatar ajamesphillips avatar amazon-auto avatar chenrui333 avatar christopherivier avatar dependabot[bot] avatar gavinzz avatar godwingrs22 avatar hawflau avatar hoffa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup-sam's Issues

Runtime Node20.x support?

Hello,

I was wondering if there are any updates planned for runtime Node20.x support?
According to this article (https://aws.amazon.com/blogs/compute/node-js-20-x-runtime-now-available-in-aws-lambda/) Lambda can now run on node v20.
When i tried to sam build a sam app locally with runtime set to Node20.x, build succeeded (sam-cli v1.103.0).
However, when I tried to deploy the app w github actions, build failed with the following error:

Build Failed
Error: 'node20.x' runtime is not supported

I would really appreciate it if someone can share plans for node v20.x support in the near future. Thank you!

Node 20 - Breaking Change?

Hi,

we noticed our builds failing (using setup-sam@v2) this morning because we have no support yet for Node 20 on our self-hosted runners. Our current workaround is to target a specific commit hash right before the upgrade to Node 20.

Screenshot 2024-02-01 at 11 33 19

Perhaps you should consider releasing this change as a V3?

Thanks,
Maarten

setup-sam is failing; AttributeError: module '__main__' has no attribute '__file__'

    ### snip
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: "3.8"
      - uses: aws-actions/setup-sam@v1
      - uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
      - run: sam validate
      ### snip

This workflow is starting to fail.
It worked fine on 5 Jan 18:26+09:00.
Rerunning same workflow against same commit fails on 6 Jan 11:28+09:00.

Run aws-actions/setup-sam@v1
/opt/hostedtoolcache/Python/3.8.12/x64/bin/python3 --version
Python 3.8.12
/opt/hostedtoolcache/Python/3.8.12/x64/bin/python3 -m venv /home/runner/work/_temp/setup-sam-eRWxCs/.venv
/home/runner/work/_temp/setup-sam-eRWxCs/.venv/bin/python -m pip install --upgrade pip
Requirement already satisfied: pip in /home/runner/work/_temp/setup-sam-eRWxCs/.venv/lib/python3.8/site-packages (21.1.1)
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.1.1
    Uninstalling pip-21.1.1:
      Successfully uninstalled pip-21.1.1
Successfully installed pip-21.3.1
/home/runner/work/_temp/setup-sam-eRWxCs/.venv/bin/python -m pip install --upgrade setuptools wheel
Requirement already satisfied: setuptools in /home/runner/work/_temp/setup-sam-eRWxCs/.venv/lib/python3.8/site-packages (56.0.0)
Collecting setuptools
  Downloading setuptools-60.3.0-py3-none-any.whl (953 kB)
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 56.0.0
    Uninstalling setuptools-56.0.0:
      Successfully uninstalled setuptools-56.0.0
Successfully installed setuptools-60.3.0 wheel-0.37.1
/home/runner/work/_temp/setup-sam-eRWxCs/.venv/bin/python -m pip install --upgrade aws-sam-cli==1.*
/home/runner/work/_temp/setup-sam-eRWxCs/.venv/bin/python: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
Error: The process '/home/runner/work/_temp/setup-sam-eRWxCs/.venv/bin/python' failed with exit code 1
Log for successful attempt
Run aws-actions/setup-sam@v1
/opt/hostedtoolcache/Python/3.8.12/x64/bin/python3 --version
Python 3.8.12
/opt/hostedtoolcache/Python/3.8.12/x64/bin/python3 -m venv /home/runner/work/_temp/setup-sam-oxJIY4/.venv
/home/runner/work/_temp/setup-sam-oxJIY4/.venv/bin/python -m pip install --upgrade pip
Requirement already satisfied: pip in /home/runner/work/_temp/setup-sam-oxJIY4/.venv/lib/python3.8/site-packages (21.1.1)
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.1.1
    Uninstalling pip-21.1.1:
      Successfully uninstalled pip-21.1.1
Successfully installed pip-21.3.1
/home/runner/work/_temp/setup-sam-oxJIY4/.venv/bin/python -m pip install --upgrade setuptools wheel
Requirement already satisfied: setuptools in /home/runner/work/_temp/setup-sam-oxJIY4/.venv/lib/python3.8/site-packages (56.0.0)
Collecting setuptools
  Downloading setuptools-60.2.0-py3-none-any.whl (953 kB)
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 56.0.0
    Uninstalling setuptools-56.0.0:
      Successfully uninstalled setuptools-56.0.0
Successfully installed setuptools-60.2.0 wheel-0.37.1
/home/runner/work/_temp/setup-sam-oxJIY4/.venv/bin/python -m pip install --upgrade aws-sam-cli==1.*
Collecting aws-sam-cli==1.*
  Downloading aws_sam_cli-1.36.0-py3-none-any.whl (5.0 MB)
Collecting cookiecutter~=1.7.2
  Downloading cookiecutter-1.7.3-py2.py3-none-any.whl (34 kB)
Collecting regex==2021.9.30
  Downloading regex-2021.9.30-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (763 kB)
Collecting tomlkit==0.7.2
  Downloading tomlkit-0.7.2-py2.py3-none-any.whl (32 kB)
Collecting tzlocal==3.0
  Downloading tzlocal-3.0-py3-none-any.whl (16 kB)
Collecting serverlessrepo==0.1.10
  Downloading serverlessrepo-0.1.10-py2.py3-none-any.whl (23 kB)
Collecting click~=7.1
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting aws-lambda-builders==1.9.0
  Downloading aws_lambda_builders-1.9.0-py3-none-any.whl (102 kB)
Collecting PyYAML~=5.3
  Downloading PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl (662 kB)
Collecting aws-sam-translator==1.42.0
  Downloading aws_sam_translator-1.42.0-py3-none-any.whl (216 kB)
Collecting chevron~=0.12
  Downloading chevron-0.14.0-py3-none-any.whl (11 kB)
Collecting boto3==1.*,>=1.18.32
  Downloading boto3-1.20.28-py3-none-any.whl (131 kB)
Collecting Flask~=1.1.2
  Downloading Flask-1.1.4-py2.py3-none-any.whl (94 kB)
Collecting docker~=4.2.0
  Downloading docker-4.2.2-py2.py3-none-any.whl (144 kB)
Collecting requests==2.25.1
  Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting watchdog==2.1.2
  Downloading watchdog-2.1.2-py3-none-manylinux2014_x86_64.whl (74 kB)
Collecting jmespath~=0.10.0
  Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting typing-extensions==3.10.0.0
  Downloading typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)
Collecting dateparser~=1.0
  Downloading dateparser-1.1.0-py2.py3-none-any.whl (288 kB)
Collecting six~=1.11
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: wheel in /home/runner/work/_temp/setup-sam-oxJIY4/.venv/lib/python3.8/site-packages (from aws-lambda-builders==1.9.0->aws-sam-cli==1.*) (0.37.1)
Requirement already satisfied: setuptools in /home/runner/work/_temp/setup-sam-oxJIY4/.venv/lib/python3.8/site-packages (from aws-lambda-builders==1.9.0->aws-sam-cli==1.*) (60.2.0)
Collecting jsonschema~=3.2
  Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting s3transfer<0.6.0,>=0.5.0
  Downloading s3transfer-0.5.0-py3-none-any.whl (79 kB)
Collecting botocore<1.24.0,>=1.23.28
  Downloading botocore-1.23.28-py3-none-any.whl (8.5 MB)
Collecting certifi>=2017.4.17
  Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.7-py2.py3-none-any.whl (138 kB)
Collecting idna<3,>=2.5
  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting chardet<5,>=3.0.2
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting backports.zoneinfo
  Downloading backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_x86_64.whl (74 kB)
Collecting Jinja2<4.0.0,>=2.7
  Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
Collecting poyo>=0.5.0
  Downloading poyo-0.5.0-py2.py3-none-any.whl (10 kB)
Collecting jinja2-time>=0.2.0
  Downloading jinja2_time-0.2.0-py2.py3-none-any.whl (6.4 kB)
Collecting binaryornot>=0.4.4
  Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB)
Collecting python-slugify>=4.0.0
  Downloading python_slugify-5.0.2-py2.py3-none-any.whl (6.7 kB)
Collecting pytz
  Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
Collecting python-dateutil
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting websocket-client>=0.32.0
  Downloading websocket_client-1.2.3-py3-none-any.whl (53 kB)
Collecting Jinja2<4.0.0,>=2.7
  Downloading Jinja2-2.11.3-py2.py3-none-any.whl (125 kB)
Collecting itsdangerous<2.0,>=0.24
  Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Werkzeug<2.0,>=0.15
  Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Collecting arrow
  Downloading arrow-1.2.1-py3-none-any.whl (63 kB)
Collecting pyrsistent>=0.14.0
  Downloading pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl (118 kB)
Collecting attrs>=17.4.0
  Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting text-unidecode>=1.3
  Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Installing collected packages: six, urllib3, python-dateutil, jmespath, MarkupSafe, botocore, text-unidecode, s3transfer, pyrsistent, Jinja2, idna, chardet, certifi, backports.zoneinfo, attrs, arrow, Werkzeug, websocket-client, tzlocal, requests, regex, PyYAML, pytz, python-slugify, poyo, jsonschema, jinja2-time, itsdangerous, click, boto3, binaryornot, watchdog, typing-extensions, tomlkit, serverlessrepo, Flask, docker, dateparser, cookiecutter, chevron, aws-sam-translator, aws-lambda-builders, aws-sam-cli
Successfully installed Flask-1.1.4 Jinja2-2.11.3 MarkupSafe-2.0.1 PyYAML-5.4.1 Werkzeug-1.0.1 arrow-1.2.1 attrs-21.4.0 aws-lambda-builders-1.9.0 aws-sam-cli-1.36.0 aws-sam-translator-1.42.0 backports.zoneinfo-0.2.1 binaryornot-0.4.4 boto3-1.20.28 botocore-1.23.28 certifi-2021.10.8 chardet-4.0.0 chevron-0.14.0 click-7.1.2 cookiecutter-1.7.3 dateparser-1.1.0 docker-4.2.2 idna-2.10 itsdangerous-1.1.0 jinja2-time-0.2.0 jmespath-0.10.0 jsonschema-3.2.0 poyo-0.5.0 pyrsistent-0.18.0 python-dateutil-2.8.2 python-slugify-5.0.2 pytz-2021.3 regex-2021.9.30 requests-2.25.1 s3transfer-0.5.0 serverlessrepo-0.1.10 six-1.16.0 text-unidecode-1.3 tomlkit-0.7.2 typing-extensions-3.10.0.0 tzlocal-3.0 urllib3-1.26.7 watchdog-2.1.2 websocket-client-1.2.3

Intermittant Setup-Sam Failures

Hi 👋🏽 ,

Not sure if this is the right place to post this issue or in actions/runner (or runner-images), but I figured I would post here first to rule out issues with the action itself.

I am experiencing somewhat intermittent failures when trying to setup sam on an ubuntu-22.04 runner from github.

Action Setup:

name: Setup sam.

description: Sets up AWS SAM with retries.

runs:
  using: "composite"
  steps:
    - uses: aws-actions/setup-sam@v2
      id: setup1
      continue-on-error: true
      with:
        use-installer: true

    - run: echo "SAM Setup Failed, 10 Second Timeout" && sleep 10
      if: ${{ steps.setup1.outcome == 'failure' }}
      shell: bash

    - uses: aws-actions/setup-sam@v2
      id: setup2
      continue-on-error: true
      if: ${{ steps.setup1.outcome == 'failure' }}
      with:
        use-installer: true

    - run: echo "SAM Setup Failed, 10 Second Timeout" && sleep 10
      if: ${{ steps.setup2.outcome == 'failure' }}
      shell: bash

    - uses: aws-actions/setup-sam@v2
      id: setup3
      if: ${{ steps.setup2.outcome == 'failure' }}
      with:
        use-installer: true

Here is a copy of the runner info for the last failure:

  Image: ubuntu-22.04
  Version: 20231205.1.0

Error message and retries:

Run aws-actions/setup-sam@v2
Error: Error:
/usr/bin/unzip -o -q /home/runner/work/_temp/5416c708-9217-4057-8852-a01b225e1e32
Run echo "SAM Setup Failed, 10 Second Timeout" && sleep 10
SAM Setup Failed, 10 Second Timeout
Run aws-actions/setup-sam@v2
Error: Error:
/usr/bin/unzip -o -q /home/runner/work/_temp/4dc53d00-a7c1-471e-bd54-f43ae8e8dd0e
Run echo "SAM Setup Failed, 10 Second Timeout" && sleep 10
SAM Setup Failed, 10 Second Timeout
Run aws-actions/setup-sam@v2
Error: Error:
/usr/bin/unzip -o -q /home/runner/work/_temp/d4efffda-8428-4661-9417-b86ad0e9ab7b

Unfortunately because of the issue's intermittent nature, I haven't been able to reproduce with debug logging. I'll keep trying though.

Normally the setup task is fine and has an output like this:
image

I would appreciate it someone had any insight into this issue, or could point me in the right direction.

Thanks,
Arnav

I get following error: when run sam build --use-container command from github action

I get following error: when run sam buidl --use-container command from github action

following is the workflow

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- uses: aws-actions/setup-sam@v2
with:
version: 1.23.0
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "us-east-1"
# sam build
- run: sam build --use-container

ERROR:

`sam build --use-container
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.7.17/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***

SAM CLI now collects telemetry to better understand customer needs.

You can OPT OUT and disable telemetry collection by setting the
environment variable SAM_CLI_TELEMETRY=0 in your shell.
Thanks for your help!

Learn More: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-telemetry.html

Traceback (most recent call last):
File "/home/runner/work/_temp/setup-sam-kHJdVN/bin/sam", line 8, in
sys.exit(cli())
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1257, in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 700, in make_context
self.parse_args(ctx, args)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1048, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1623, in handle_parse_result
value = self.full_process_value(ctx, value)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1965, in full_process_value
return Parameter.full_process_value(self, ctx, value)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1589, in full_process_value
value = self.process_value(ctx, value)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1579, in process_value
return self.type_cast_value(ctx, value)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1568, in type_cast_value
return _convert(value, (self.nargs != 1) + bool(self.multiple))
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/core.py", line 1565, in _convert
return self.type(value, self, ctx)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/types.py", line 46, in call
return self.convert(value, param, ctx)
File "/home/runner/work/_temp/setup-sam-kHJdVN/.venv/lib/python3.7/site-packages/click/types.py", line 412, in convert
value = value.lower()
AttributeError: 'Bool' object has no attribute 'lower'
Error: Process completed with exit code 1.`

Runtime Node20.x support in github actions?

@ssenchenko

With the new version of sam-cli pulled on my local machine, i'm able to successfully build sam apps with runtime set to nodejs20.x

However, the issue i'm having is when i try to deploy the sam app with github actions.
Here is a bit of the github workflow pipline.yaml I have:

build-and-deploy-dev:
   if: github.ref == 'refs/heads/dev'
   needs: [test]
   runs-on: ubuntu-latest
   steps:
     - uses: actions/checkout@v3
     - uses: aws-actions/setup-sam@v2
       with:
         use-installer: true
     - run: sam build --template ${SAM_TEMPLATE} --use-container

..and so on.
This is where i get the error in github actions:

Build Failed
Error: 'nodejs20.x' runtime is not supported

How should i update the .github/workflows/pipeline.yaml file in order for the sam app to be successfully built when the runtime is set to nodejs20.x in the template.yaml?

Cache does not seem to be working with use-installer: true

Hi 👋

I don't see a cache being created for SAM under the GitHub Action Caches in my repository using this action.

I'm using:

    runs-on: ubuntu-latest
    steps:
      - uses: aws-actions/setup-sam@v2
        with:
          use-installer: true
          version: 1.107.0

and my workflow run logs constantly show:

Cached AWS SAM CLI 1.107.0 to /opt/hostedtoolcache/sam/1.107.0/x64

Look like the @actions/cache module with the restoreCache and saveCache functions should be used, instead of @actions/tool-cache with find and cacheDir, in order to actually persistently cache the files.

Error: Getting requirements to build wheel did not run successfully

The setup-sam@v2 build action is failing all our pipelines

the error message is-
Getting requirements to build wheel did not run successfully

I get the following stack trace

exit code: 1 ╰─> [68 lines of output] /tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg`
!!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.
  
          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3/PyYAML.egg-info/PKG-INFO
  writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
  writing top-level names to lib3/PyYAML.egg-info/top_level.txt
  Traceback (most recent call last):
    File "/home/runner/work/_temp/setup-sam-ga5CTW/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/runner/work/_temp/setup-sam-ga5CTW/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/runner/work/_temp/setup-sam-ga5CTW/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1[234](https://github.com/CloudCall-Engineering/syncconnectors-bullhorn/actions/runs/5577482690/jobs/10190902096#step:4:238), in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 314, in run
      self.find_sources()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
      mm.run()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 551, in run
      self.add_defaults()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
      sdist.add_defaults(self)
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
      super().add_defaults()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line [251](https://github.com/CloudCall-Engineering/syncconnectors-bullhorn/actions/runs/5577482690/jobs/10190902096#step:4:255), in add_defaults
      self._add_defaults_ext()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 201, in get_source_files
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Error: The process '/home/runner/work/_temp/setup-sam-ga5CTW/.venv/bin/python' failed with exit code 1`

Enable custom caching with Github Actions workflow

Issue

When using setup-sam@v2 alongside actions/[email protected]', despite the .aws-sam/cache` directory succefully being stored by the github cache, the following response is always given:

Cache is invalid, running build and copying resources for following functions

This appears to have something to do with the way the cache is being stored, leading to the cache being unable to be accessed.

As a recreateable example, the following action showcases a succesful cache store of .aws-sam/cache with an invalid cache hit.

      - uses: aws-actions/setup-sam@v2
        with:
          use-installer: true
          version: 1.95.0

      - name: Cache SAM dependencies
        id: cache
        uses: actions/[email protected]
        with:
          path: |
            .aws-sam/cache
          key: ${{ runner.os }}-SAM_BUILD-${{hashFiles('**/requirements.txt')}}

      - name: Build resources
        run: sam build --template ${SAM_TEMPLATE} --parallel --use-container --cached  --beta-features

This has also been attempted using the cache created by using use-installer and version, with a cache invalid response returned.

      - uses: aws-actions/setup-sam@v2
        with:
          use-installer: true
          version: 1.95.0

      - name: Cache SAM dependencies
        id: cache
        uses: actions/[email protected]
        with:
          path: |
            /opt/hostedtoolcache/sam/1.95.0/x64
          key: ${{ runner.os }}-AWSbuildV2-${{hashFiles('**/requirements.txt')}}

      - name: Build resources
        run: sam build --template ${SAM_TEMPLATE} --parallel --use-container --cached  --beta-features

Proposal

I'd like to request the ability to cache using the sam build --cached option, in the same capacity as other dependency caching found Cahing Dependencies to Speed Up Workflows. I'm aware there is SAM CLI caching as found in #73, however, this appears to not be supported by the github runner, and only works for self hosted runners.

I'm unsure if this is a bug, or if it's intended that caching is only supported via self-hosted runners, so please let me know any further logs that may be useful for debugging this issue.

Please let me know if i'm using the setup-sam incorrectly to cache, or if there's a different recommended method for doing so.

Example without Docker

Current documentation only includes the catch-all approach using --use-container. This works great on GitHub-hosted runners, but might be less straightforward on self-hosted ones lacking Docker (there is no official setup-docker either). It also potentially takes longer than using setup-node and sam building the app right away, as many setup-* actions are cached.

Example:

on:
  push:
    branches:
      - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - uses: aws-actions/setup-sam@v0
      - uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-east-2
      - run: sam build
      - run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset

Maybe have a section for building with Docker, and one without?

SAM build stopped working | AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'

failing (was working a week ago)
Run sam build --use-container

  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/bin/sam", line 8, in <module>
    sys.exit(cli())
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/click/core.py", line [1](https://github.com/oziva-in/oziva-functions/actions/runs/3820580200/jobs/6499156404#step:10:1)130, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/click/core.py", line 16[51](https://github.com/oziva-in/oziva-functions/actions/runs/3820580200/jobs/6499156404#step:10:51), in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/click/core.py", line 1698, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/samcli/cli/command.py", line 133, in get_command
    mod = importlib.import_module(pkg_name)
  File "/home/ubuntu/actions-runner/_work/_tool/Python/3.8.15/x[64](https://github.com/oziva-in/oziva-functions/actions/runs/3820580200/jobs/6499156404#step:10:65)/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line [67](https://github.com/oziva-in/oziva-functions/actions/runs/3820580200/jobs/6499156404#step:10:68)1, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/samcli/commands/build/__init__.py", line 6, in <module>
    from .command import cli  # noqa
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/samcli/commands/build/command.py", line 12, in <module>
    from samcli.commands._utils.options import (
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/samcli/commands/_utils/options.py", line 21, in <module>
    from samcli.commands._utils.template import get_template_data, TemplateNotFoundException
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/samcli/commands/_utils/template.py", line 10, in <module>
    from botocore.utils import set_value_from_jmespath
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/botocore/utils.py", line 37, in <module>
    import botocore.httpsession
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/botocore/httpsession.py", line 46, in <module>
    from urllib3.contrib.pyopenssl import (
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
    import OpenSSL.crypto
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/home/ubuntu/actions-runner/_work/_temp/setup-sam-jpw4ru/.venv/lib/python3.8/site-packages/OpenSSL/crypto.py", line 32[68](https://github.com/oziva-in/oziva-functions/actions/runs/3820580200/jobs/6499156404#step:10:69), in <module>
    _lib.OpenSSL_add_all_algorithms()
AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'
Error: Process completed with exit code 1.

Support caching

With #15 merged, at every run all files are stored under a new random temporary directory.

We could use @actions/tool-cache to avoid downloading SAM CLI each time. Only really useful for self-hosted runners as they don't have a fresh machine each time.

Questions:

  • Does the symlink cache without issues? https://docs.python.org/3/library/venv.html#creating-virtual-environments "While symlinks are supported on Windows, they are not recommended."
  • What about actions/cache? Caches directory as key; needs to know directory; used for caching across runners.
  • What about @actions/cache?
  • What about wildcard versions? (e.g. 1.*) Can't cache 1.* otherwise would never update; tool-cache doesn't seem to provide solution to invalidate. Would at minimum have to find version installed; anything not pip seems fragile.

Error: NodejsNpmEsbuildBuilder:EsbuildBundle - Esbuild Failed in GitHub Actions

Hello,

I am encountering an error while using Sam build on GitHub Actions with the AWS-actions/setup-sam. Strangely, the build process works perfectly fine on my local machine using Sam build. However, when the same build process is executed on GitHub Actions, I receive the following error:

"Error: NodejsNpmEsbuildBuilder:EsbuildBundle - Esbuild Failed: Cannot find esbuild. esbuild must be installed on the host machine to use this feature. It is recommended to be installed on the PATH, but can also be included as a project dependency."

I have double-checked that esbuild is installed on my local machine and even included it as a project dependency, which allows me to perform successful builds locally. However, the error only occurs within the GitHub Actions environment.

I kindly request your assistance and guidance in troubleshooting this perplexing issue. If anyone has encountered a similar situation or possesses insights into potential solutions, I would greatly appreciate your input.

Thank you for your support.

ImportError: cannot import name 'soft_unicode' from 'markupsafe'

The action was working fine till last night and has suddenly started throwing errors.

Below is the log.

Traceback (most recent call last):
  File "/home/runner/work/_temp/setup-sam-2S4sF4/bin/sam", line 8, in <module>
    sys.exit(cli())
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 8[29](https://github.com/***/***/runs/5243409939?check_suite_focus=true#step:5:29), in __call__
    return self.main(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/telemetry/metric.py", line 166, in wrapped
    raise exception  # pylint: disable=raising-bad-type
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/telemetry/metric.py", line 124, in wrapped
    return_value = func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/utils/version_checker.py", line 41, in wrapped
    actual_result = func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/cli/main.py", line 87, in wrapper
    return func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/commands/build/command.py", line 174, in cli
    do_cli(
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/commands/build/command.py", line 220, in do_cli
    from samcli.commands.build.build_context import BuildContext
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/commands/build/build_context.py", line 13, in <module>
    from samcli.lib.providers.sam_api_provider import SamApiProvider
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/providers/sam_api_provider.py", line 6, in <module>
    from samcli.lib.providers.api_collector import ApiCollector
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/providers/api_collector.py", line 10, in <module>
    from samcli.local.apigw.local_apigw_service import Route
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/local/apigw/local_apigw_service.py", line 11, in <module>
    from flask import Flask, request
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F[40](https://github.com/***/***/runs/5243409939?check_suite_focus=true#step:5:40)1
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/markupsafe/__init__.py)

The usage:

steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: aws-actions/setup-sam@v1

      - name: Build resources
        run: sam build --template template.yaml --use-container

jsonschema new patch version breaks the deployment

I have been facing with new issues while using this GA today, as a new version of jsonschema (4.18.1) has been released just today, which makes my deployment to fail:

Screenshot 2023-07-12 at 13 10 50

And, I think your GA should pin down the version for that package to 4.18.0.

How to pass environment variables

my samconfig.toml contains some environment variables used during deployment.
for example
parameter_overrides = "VipsDiscThreshold=\"16g\" and other sensitive details.

is there a way to safely pass these parameters during build without putting them in the samconfig.toml file?

Unable to install latest version of SAM

We were trying to update EphemeralStorage on our Serverless function.

This is supposed to work based on aws/serverless-application-model#2361 and documentation here.

However, on our GHA workflow when using latest setup-sam action, it only installs 1.41. Due to this down the line when using SAM deploy we get an error property EphemeralStorage not defined for resource of type AWS::Serverless::Function (which per the documentation should be valid)

Workflow step:

- name: Setup AWS SAM
  uses: aws-actions/setup-sam@v2

image

We also tried to use the version parameter to force it to download version 1.48 and got this error:
image

Support native installers

Currently setup-sam uses pip to install SAM CLI. It makes multi-platform support trivial, but means issues can occur due to transient dependencies changing (e.g. #64 or #41). It also means Python has to be installed for setup-sam to work (although it isn't typically a problem in practice; GitHub-hosted runners include it).

Using the official installers would minimize dependency issues and get rid of the setup-python dependency. And perhaps makes #12 easier? One potential issue is SAM CLI doesn't currently support Linux ARM (see aws/aws-sam-cli#3908).

No need to run the install script, and can use dist/sam directly instead. Might help with caching.

Should probably push a v3, as the python input will be removed, and don't want to break changes such as #64 (comment).

Add example to README

Something like this?

on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: aws-actions/setup-sam@v0
        with:
          version: 1.18.2
      - uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-west-2
      - run: sam build --use-container
      - run: sam deploy --no-fail-on-empty-changeset --no-confirm-changeset

Support caching with `use-installer` when `version` not specified

Context

With #73 merged, SAM CLI is cached when use-installer is enabled and version is specified.

For example:

- uses: aws-actions/setup-sam@v2
  with:
    version: 1.76.0
    use-installer: true

This is beneficial for self-hosted runners that don't get a fresh machine at every workflow run.

Issue

When version is not specified (i.e. it uses the latest available version), it currently does not cache:

setup-sam/lib/setup.js

Lines 137 to 144 in b42eb7a

// TODO: If not set, check latest version and return from cache if exists
if (version) {
const cachedDir = tc.find("sam", version);
if (cachedDir) {
core.info(`Using cached AWS SAM CLI ${version} from ${cachedDir}`);
return path.join(cachedDir, "dist");
}
}

setup-sam/lib/setup.js

Lines 154 to 159 in b42eb7a

// TODO: If not set, cache with latest version
if (version) {
const cachedDir = await tc.cacheDir(extractedDir, "sam", version);
core.info(`Cached AWS SAM CLI ${version} to ${cachedDir}`);
return path.join(cachedDir, "dist");
}

Proposal

Ideally, it would do something like this when version is not specified:

  1. Get the version number of the latest SAM CLI release.
  2. If the version is in the cache, return it.
  3. If not, set up as usual and add the version to the cache.

Challenges

  1. How to reliably get the latest version number, without downloading the full release? If we use the version field in PyPI (e.g. curl https://pypi.org/pypi/aws-sam-cli/json | jq -r .info.version), there's no guarantee the GitHub release for that version will always exist at the same time (they're separate assets, so there can be a brief delay during releases). If we use the GitHub release directly, there's no robust way of getting the version (but could parse the title or tag).

Alternatives

  1. Something like check-latest from actions/setup-go and actions/setup-python? GitHub-hosted runners already include SAM CLI (see e.g. https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md), so perhaps by default if it finds SAM CLI is installed, it could immediately return? Might require a new major version, as it no longer installs latest version by default. Might not be a reliable way to ensure pre-installed version is functioning well. The way check-latest works seems to be a little different; it's because the version can be a range, and so instead of picking whatever fits in the range from the cache, it ensures the latest version is used.

Fully isolate SAM CLI

Add sam symlink to a directory, and use that for PATH so that other binaries in the virtual environment don't overwrite existing ones.

Getting Esbuild Failed: Cannot find esbuild in the GitHub Actions

Hi,

We are getting Esbuild Failed: Cannot find esbuild in the GitHub actions. Here is the full error message:

Starting Build inside a container
Building codeuri: /home/runner/work/BillingService/BillingService/billing-service runtime: nodejs16.x metadata: {'BuildMethod': 'esbuild', 'BuildProperties': {'Minify': True, 'Target': 'es2020', 'Sourcemap': True, 'EntryPoints': ['handlers/app.ts']}} architecture: x86_64 functions: KBAddAccountCall

Fetching public.ecr.aws/sam/build-nodejs16.x:latest-x86_64 Docker container image.........................................................................................................................................................................................................................................................................................................................................................................................................
Mounting /home/runner/work/BillingService/BillingService/billing-service as /tmp/samcli/source:ro,delegated inside runtime container

Build Failed
Running NodejsNpmEsbuildBuilder:CopySource
Running NodejsNpmEsbuildBuilder:NpmInstall
Running NodejsNpmEsbuildBuilder:EsbuildBundle
Error: NodejsNpmEsbuildBuilder:EsbuildBundle - Esbuild Failed: Cannot find esbuild. esbuild must be installed on the host machine to use this feature. It is recommended to be installed on the PATH, but can also be included as a project dependency.

2 days back, everything was working fine, but now somehow build process broke.

Can anyone please help me to resolve this issue?

Thanks in advance!

Error: pg_config executable not found.

error: subprocess-exited-with-error -- 01:44:34.644 |   01:44:34.644 | × Getting requirements to build wheel did not run successfully. 01:44:34.644 | │ exit code: 1 01:44:34.644 | ╰─> [21 lines of output] 01:44:34.644 | running egg_info 01:44:34.644 | writing psycopg2.egg-info/PKG-INFO 01:44:34.645 | writing dependency_links to psycopg2.egg-info/dependency_links.txt 01:44:34.645 | writing top-level names to psycopg2.egg-info/top_level.txt 01:44:34.645 |   01:44:34.645 | Error: pg_config executable not found. 01:44:34.645 |   01:44:34.645 | pg_config is required to build psycopg2 from source. Please add the directory 01:44:34.645 | containing pg_config to the $PATH or specify the full executable path with the 01:44:34.645 | option: 01:44:34.646 |   01:44:34.646 | python setup.py build_ext --pg-config /path/to/pg_config build ... 01:44:34.646 |   01:44:34.646 | or with the pg_config option in 'setup.cfg'. 01:44:34.646 |   01:44:34.646 | If you prefer to avoid building psycopg2 from source, please install the PyPI 01:44:34.647 | 'psycopg2-binary' package instead. 01:44:34.647 |   01:44:34.647 | For further information please check the 'doc/src/install.rst' file (also at 01:44:34.647 | ). 01:44:34.647 |   01:44:34.647 | [end of output] 01:44:34.648 |   01:44:34.648 | note: This error originates from a subprocess, and is likely not a problem with pip. 01:44:34.650 | error: subprocess-exited-with-error 01:44:34.650 |   01:44:34.650 | × Getting requirements to build wheel did not run successfully. 01:44:34.651 | │ exit code: 1 01:44:34.651 | ╰─> See above for output. 01:44:34.651 |   01:44:34.651 | note: This error originates from a subprocess, and is likely not a problem with pip. 01:44:35.470 | Traceback (most recent call last): 01:44:35.471 | File "/vercel/path0/manage.py", line 11, in main 01:44:35.471 | from django.core.management import execute_from_command_line 01:44:35.471 | ModuleNotFoundError: No module named 'django'

image

i am trying to deploy django app to vercel and keep getting this error
please, can someone help me with this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.