Skip to content

Commit

Permalink
chore: update appveyor image (#6278)
Browse files Browse the repository at this point in the history
* update newer ubuntu image

* update newer ubuntu image

* add py3.12

* add py3.12

* install py3.12

* check what is in 3.12 dir

* check contents

* check jdk21

* add py3.12 to the path

* install jdk21

* install jdk21

* install jdk21

* check default java & javac version

* versions

* update alternatives

* echo path

* get choco logs

* update java_home and path

* run it with powershell

* gradle version

* refresh env

* update mvn & gradle

* move java installation part

* upgrade choco first

* uninstall & re-install gradle

* update linux binary

* update windows binary configuration

* Use Ubuntu2004 image

* Update appveyor-ubuntu.yml - install python3.12

* Update appveyor-ubuntu.yml

* Update appveyor-ubuntu.yml

* Update appveyor-ubuntu.yml

* Apply suggestions from code review

* Update appveyor-windows.yml

* Apply suggestions from code review

* Update appveyor-ubuntu.yml

* Apply suggestions from code review

* Update appveyor-windows.yml

* Update appveyor-windows.yml

* set python version back to 3.8

* install pip through bootstrap.pypa.io

* test with new ubuntu image

* Remove provided rust integ tests and change python3 to python (#6311)

* install jdk8 as well

* do not dictate jdk tooling version but set target java version

* don't install jdk8

* Create a separate Makefile for provided Docker integ tests

* fix ruby issue

* Remove go1.x debug test as due to different GLIB version, this is not required

* remove refreshenv and updating docker engine

* skip gradlew and gradle-kotlin containerized tests for earlier java versions

* run other tests sequentially

* fix test skipping for java arm64

* aligning changes between regular tests and binary ones

* fix formatting

* use provided.al2 for golang terraform tests

* (windows) refresh env after installing correttojdk 21

* (windows) refreshenv breaking appveyor commands, setting PATH and JAVA_HOME manually

* skip tests involving nodejs20 container in Windows

* fix golang terraform tests

* run upgrade gradle instead of doing uninstall & install

* bump timeout of tf golang function

* update tests to skip certain tests if runtime is not supported by installed docker version

* fix typing

* add missing changes and update formatting to match with regular linux config

* add missing lines and update formatting with regular windows config

---------

Co-authored-by: Wing Fung Lau <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>
  • Loading branch information
4 people authored Dec 5, 2023
1 parent 4959db0 commit ca87c88
Show file tree
Hide file tree
Showing 14 changed files with 535 additions and 279 deletions.
36 changes: 21 additions & 15 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 Down Expand Up @@ -28,26 +28,31 @@ 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"
Expand All @@ -57,16 +62,17 @@ install:

# 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
38 changes: 22 additions & 16 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 Down Expand Up @@ -33,21 +33,27 @@ 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"
Expand All @@ -57,16 +63,17 @@ install:

# 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
Loading

0 comments on commit ca87c88

Please sign in to comment.