Skip to content

Commit

Permalink
Merge from aws/aws-sam-cli/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sam-cli-bot authored Dec 5, 2023
2 parents 80d65e0 + 60e77fd commit f37cf2b
Show file tree
Hide file tree
Showing 358 changed files with 3,954 additions and 1,954 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/need-attention-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
# the login of our bot called 'sam-cli-bot'
if: github.event.sender.login != 'aws-sam-cli-stale-bot'
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
40 changes: 23 additions & 17 deletions appveyor-linux-binary.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 1.0.{build}
image:
- Ubuntu2004
image:
- Ubuntu2204

configuration:
- BuildIntegTesting
Expand All @@ -19,7 +19,7 @@ environment:
PYTHON_HOME: "$HOME/venv3.11/bin"
PYTHON_VERSION: '3.11'
AWS_DEFAULT_REGION: us-east-1
NODE_VERSION: "14.17.6"
NODE_VERSION: "18.18.2"
AWS_S3: 'AWS_S3_TESTING'
AWS_ECR: 'AWS_ECR_TESTING'
CARGO_LAMBDA_VERSION: "v0.17.1"
Expand All @@ -28,45 +28,51 @@ environment:
APPVEYOR_CONSOLE_DISABLE_PTY: false
APPVEYOR_DETAILED_SHELL_LOGGING: true


install:
# AppVeyor's apt-get cache might be outdated, and the package could potentially be 404.
- sh: "sudo apt-get update --allow-releaseinfo-change"

# install coretto 21
- sh: wget -O - https://apt.corretto.aws/corretto.key | sudo gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg
- sh: echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | sudo tee /etc/apt/sources.list.d/corretto.list
- sh: sudo apt-get update; sudo apt-get install -y java-21-amazon-corretto-jdk
- sh: JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto
- sh: PATH=$JAVA_HOME/bin:$PATH
- sh: java --version
- sh: javac --version

- sh: "gvm use go1.19"
- sh: "echo $PATH"
- sh: "ls /usr/"
# install latest maven which is compatible with jdk17
- sh: "sudo apt-get -y remove maven"
- sh: "wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.zip -P /tmp"
- sh: "wget https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -P /tmp"
- sh: "sudo unzip -d /opt/mvn /tmp/apache-maven-*.zip"
- sh: "PATH=/opt/mvn/apache-maven-3.8.8/bin:$PATH"
- sh: "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
- sh: "PATH=$JAVA_HOME/bin:$PATH"
- sh: "javac -version"
- sh: "java -version"
- sh: "PATH=/opt/mvn/apache-maven-3.9.5/bin:$PATH"
- sh: "mvn --version"

- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
- sh: "rvm reinstall ruby-3.2.2 --with-openssl-dir=/usr/lib/x86_64-linux-gnu" # reinstall ruby3.2 to fix OpenSSL issue
- sh: "rvm use 3.2.2"
- sh: "docker info"
- sh: "docker version"
- sh: "nvm install ${NODE_VERSION}"
- sh: "npm install npm@7.24.2 -g"
- sh: "npm install npm@10.2.3 -g"
- sh: "npm -v"

# Install latest gradle
- sh: "sudo apt-get -y remove gradle"
- sh: "wget https://services.gradle.org/distributions/gradle-7.3.1-bin.zip -P /tmp"
- sh: "wget https://services.gradle.org/distributions/gradle-8.4-bin.zip -P /tmp"
- sh: "sudo unzip -d /opt/gradle /tmp/gradle-*.zip"
- sh: "PATH=/opt/gradle/gradle-7.3.1/bin:$PATH"
- sh: "PATH=/opt/gradle/gradle-8.4/bin:$PATH"
- sh: "gradle --version"

# Install AWS CLI
- sh: "virtualenv aws_cli"
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"

- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin"
- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin:$HOME/venv3.12/bin"

# Install pytest
- sh: "python3.9 -m venv $HOME/pytest"
Expand Down Expand Up @@ -150,9 +156,9 @@ on_finish:
# Upload test reports as artifacts
- sh: find "$APPVEYOR_BUILD_FOLDER" -type f -name 'TEST_REPORT-*.json' -print0 | xargs -0 -I '{}' appveyor PushArtifact '{}'
- sh: >
AWS_ACCESS_KEY_ID=$TEST_REPORT_S3_BUCKET_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=$TEST_REPORT_S3_BUCKET_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN=$TEST_REPORT_S3_BUCKET_SESSION_TOKEN
AWS_ACCESS_KEY_ID=$TEST_REPORT_S3_BUCKET_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=$TEST_REPORT_S3_BUCKET_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN=$TEST_REPORT_S3_BUCKET_SESSION_TOKEN
aws s3 cp "$APPVEYOR_BUILD_FOLDER" "s3://$TEST_REPORT_S3_BUCKET_NAME/appveyor/$APPVEYOR_PROJECT_SLUG/$APPVEYOR_BUILD_ID/$APPVEYOR_JOB_ID/" --recursive --exclude "*" --include "TEST_REPORT-*.json" --region us-west-2
# notify task success
Expand Down
42 changes: 24 additions & 18 deletions appveyor-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 1.0.{build}
image:
- Ubuntu2004
- Ubuntu2204

configuration:
- BuildIntegTesting
Expand All @@ -20,7 +20,7 @@ environment:
PYTHON_VERSION: '3.8'
AWS_DEFAULT_REGION: us-east-1
SAM_CLI_DEV: 1
NODE_VERSION: "14.17.6"
NODE_VERSION: "18.18.2"
AWS_S3: 'AWS_S3_TESTING'
AWS_ECR: 'AWS_ECR_TESTING'
CARGO_LAMBDA_VERSION: "v0.17.1"
Expand All @@ -33,40 +33,47 @@ install:
# AppVeyor's apt-get cache might be outdated, and the package could potentially be 404.
- sh: "sudo apt-get update --allow-releaseinfo-change"

# install coretto 21
- sh: wget -O - https://apt.corretto.aws/corretto.key | sudo gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg
- sh: echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | sudo tee /etc/apt/sources.list.d/corretto.list
- sh: sudo apt-get update; sudo apt-get install -y java-21-amazon-corretto-jdk
- sh: JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto
- sh: PATH=$JAVA_HOME/bin:$PATH
- sh: java --version
- sh: javac --version

- sh: "gvm use go1.19"
- sh: "echo $PATH"
- sh: "ls /usr/"
# install latest maven which is compatible with jdk17
- sh: "sudo apt-get -y remove maven"
- sh: "wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.zip -P /tmp"
- sh: "wget https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip -P /tmp"
- sh: "sudo unzip -d /opt/mvn /tmp/apache-maven-*.zip"
- sh: "PATH=/opt/mvn/apache-maven-3.8.8/bin:$PATH"
- sh: "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
- sh: "PATH=$JAVA_HOME/bin:$PATH"
- sh: "javac -version"
- sh: "java -version"
- sh: "PATH=/opt/mvn/apache-maven-3.9.5/bin:$PATH"
- sh: "mvn --version"

- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
- sh: "rvm reinstall ruby-3.2.2 --with-openssl-dir=/usr/lib/x86_64-linux-gnu" # reinstall ruby3.2 to fix OpenSSL issue
- sh: "rvm use 3.2.2"
- sh: "docker info"
- sh: "docker version"
- sh: "nvm install ${NODE_VERSION}"
- sh: "npm install npm@7.24.2 -g"
- sh: "npm install npm@10.2.3 -g"
- sh: "npm -v"

# Install latest gradle
- sh: "sudo apt-get -y remove gradle"
- sh: "wget https://services.gradle.org/distributions/gradle-7.3.1-bin.zip -P /tmp"
- sh: "wget https://services.gradle.org/distributions/gradle-8.4-bin.zip -P /tmp"
- sh: "sudo unzip -d /opt/gradle /tmp/gradle-*.zip"
- sh: "PATH=/opt/gradle/gradle-7.3.1/bin:$PATH"
- sh: "PATH=/opt/gradle/gradle-8.4/bin:$PATH"
- sh: "gradle --version"

# Install AWS CLI
- sh: "virtualenv aws_cli"
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"

- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin"
- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin:$HOME/venv3.12/bin"

# update ca-certificates which causes failures with newest golang library
- sh: "sudo apt-get install --reinstall ca-certificates"
Expand Down Expand Up @@ -113,19 +120,19 @@ install:
# required for RIE with arm64 in linux
- sh: "
if [[ -n $BY_CANARY ]] && [[ -n $DOCKER_USER ]] && [[ -n $DOCKER_PASS ]];
then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin registry-1.docker.io;
then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin registry-1.docker.io;
fi"
- sh: "
if [[ -n $BY_CANARY ]] && [[ -n $DOCKER_USER ]] && [[ -n $DOCKER_PASS ]];
then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin;
then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin;
fi"
- sh: "docker run --rm --privileged multiarch/qemu-user-static --reset -p yes"


# Runs only in Linux, logging Public ECR when running canary and cred is available
- sh: "
if [[ -n $BY_CANARY ]];
then echo Logging in Public ECR; aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws;
then echo Logging in Public ECR; aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws;
fi"


Expand All @@ -152,7 +159,7 @@ on_finish:

for:
# Integ testing build
-
-
matrix:
only:
- configuration: BuildIntegTesting
Expand All @@ -168,8 +175,7 @@ for:
- sh: "pytest -vv -n 2 --reruns 3 tests/integration/buildcmd -m 'java or python or provided' --ignore=tests/integration/buildcmd/test_build_cmd_arm64.py --ignore=tests/integration/buildcmd/test_build_terraform_applications.py --ignore=tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd-java-python-provided.json"

# Integ testing build arm64 functions
-
matrix:
- matrix:
only:
- configuration: BuildIntegTestingArm64

Expand Down
23 changes: 13 additions & 10 deletions appveyor-windows-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,29 @@ cache:
- C:\ProgramData\chocolatey\lib -> appveyor.yml

install:
# upgrade chocolately
- choco upgrade chocolatey
# setup make
- "choco install make"
# setup Java, Maven and Gradle
- "choco install gradle -y --force"
- 'set JAVA_HOME=C:\Program Files\Java\jdk17'
- choco install correttojdk --version=21.0.0
- 'set JAVA_HOME=C:\Program Files\Amazon Corretto\jdk21.0.0_35'
- 'set PATH=%JAVA_HOME%\bin;%PATH%'
- "javac -version"
- "java -version"
- java --version
- javac --version
- choco upgrade gradle --version=8.4.0
- "gradle -v"
- "mvn --version"

# Make sure the temp directory exists for Python to use.
- ps: "mkdir -Force C:\\tmp"
- 'set PATH=%PYTHON_HOME%;C:\Ruby32-x64\bin;%PATH%;C:\Python37-x64;C:\Python39-x64;C:\Python310-x64;C:\Python38-x64'
- 'set PATH=%PYTHON_HOME%;C:\Ruby32-x64\bin;%PATH%;C:\Python37-x64;C:\Python39-x64;C:\Python310-x64;C:\Python38-x64;C:\Python312-x64'
- "echo %PYTHON_HOME%"
- "echo %PATH%"
- "python --version"
- ps: "Restart-Service docker"
# Switch to Docker Linux containers
- ps: Switch-DockerLinux
- "docker info"
- "docker version"

Expand All @@ -84,9 +90,6 @@ install:
# Install AWS CLI Globally via pip3
- "pip install awscli"

# Switch to Docker Linux containers
- ps: Switch-DockerLinux

# Check for git executable
- "git --version"

Expand Down Expand Up @@ -205,7 +208,7 @@ for:
- cargo lambda -V

test_script:
- ps: "pytest -vv -n 2 --reruns 3 tests/integration/buildcmd -m 'java or python or provided' --ignore=tests/integration/buildcmd/test_build_cmd_arm64.py --ignore tests/integration/buildcmd/test_build_terraform_applications.py --ignore=tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"
- ps: "pytest -vv -n 2 --reruns 3 tests/integration/buildcmd -m 'java or python or provided' --ignore=tests/integration/buildcmd/test_build_cmd_arm64.py --ignore=tests/integration/buildcmd/test_build_terraform_applications.py --ignore=tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd-java-python-provided.json"

#Integ testing build arm64
- matrix:
Expand Down Expand Up @@ -308,4 +311,4 @@ for:
# Uncomment for RDP
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

19 changes: 11 additions & 8 deletions appveyor-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,29 @@ cache:
- C:\ProgramData\chocolatey\lib -> appveyor.yml

install:
# upgrade chocolately
- choco upgrade chocolatey
# setup make
- "choco install make"
# setup Java, Maven and Gradle
- "choco install gradle -y --force"
- 'set JAVA_HOME=C:\Program Files\Java\jdk17'
- choco install correttojdk --version=21.0.0
- 'set JAVA_HOME=C:\Program Files\Amazon Corretto\jdk21.0.0_35'
- 'set PATH=%JAVA_HOME%\bin;%PATH%'
- "javac -version"
- "java -version"
- java --version
- javac --version
- choco upgrade gradle --version=8.4.0
- "gradle -v"
- "mvn --version"

# Make sure the temp directory exists for Python to use.
- ps: "mkdir -Force C:\\tmp"
- 'set PATH=%PYTHON_HOME%;C:\Ruby32-x64\bin;%PATH%;C:\Python37-x64;C:\Python39-x64;C:\Python310-x64;C:\Python311-x64'
- 'set PATH=%PYTHON_HOME%;C:\Ruby32-x64\bin;%PATH%;C:\Python37-x64;C:\Python39-x64;C:\Python310-x64;C:\Python311-x64;C:\Python312-x64'
- "echo %PYTHON_HOME%"
- "echo %PATH%"
- "python --version"
- ps: "Restart-Service docker"
# Switch to Docker Linux containers
- ps: Switch-DockerLinux
- "docker info"
- "docker version"

Expand All @@ -83,9 +89,6 @@ install:
# Install AWS CLI Globally via pip3
- "pip install awscli"

# Switch to Docker Linux containers
- ps: Switch-DockerLinux

# Check for git executable
- "git --version"

Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[pytest]
; timeout any test after 30 minutes if it's hanging
timeout = 1800
log_cli = 1
log_cli_level = INFO
addopts = --maxfail=1000 -rf
Expand Down
18 changes: 9 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ boto3>=1.26.109,<2
jmespath~=1.0.1
ruamel_yaml~=0.18.5
PyYAML~=6.0,>=6.0.1
cookiecutter~=2.4.0
aws-sam-translator==1.80.0
cookiecutter~=2.5.0
aws-sam-translator==1.81.0
#docker minor version updates can include breaking changes. Auto update micro version only.
docker~=6.1.0
dateparser~=1.1
dateparser~=1.2
requests~=2.31.0
aws_lambda_builders==1.42.0
tomlkit==0.12.2
aws_lambda_builders==1.43.0
tomlkit==0.12.3
watchdog==3.0.0
rich~=13.6.0
rich~=13.7.0
pyopenssl~=23.3.0
# Pin to <4.18 to until SAM-T no longer uses RefResolver
jsonschema<4.20
jsonschema<4.21

# Needed for supporting Protocol in Python 3.7, Protocol class became public with python3.8
typing_extensions>=4.4.0,<5
Expand All @@ -28,7 +28,7 @@ regex!=2021.10.8
tzlocal==5.2

#Adding cfn-lint dependency for SAM validate
cfn-lint~=0.83.1
cfn-lint~=0.83.4

# Type checking boto3 objects
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.29.0
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.33.5
Loading

0 comments on commit f37cf2b

Please sign in to comment.