From 2cce9776be1c8cee5d3b2e13f031073cabcfa309 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 21 Oct 2024 17:00:06 +0200 Subject: [PATCH] devops: stop publishing Ubuntu 20.04 (#1690) --- .github/workflows/test_docker.yml | 2 +- .github/workflows/trigger_internal_tests.yml | 2 +- utils/docker/Dockerfile.focal | 53 -------------------- utils/docker/build.sh | 6 +-- utils/docker/publish_docker.sh | 21 ++------ 5 files changed, 9 insertions(+), 75 deletions(-) delete mode 100644 utils/docker/Dockerfile.focal diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index 19009fff0..417f4fde6 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - flavor: [focal, jammy, noble] + flavor: [jammy, noble] steps: - uses: actions/checkout@v3 - name: Build Docker image diff --git a/.github/workflows/trigger_internal_tests.yml b/.github/workflows/trigger_internal_tests.yml index c22082f99..8af0dff2a 100644 --- a/.github/workflows/trigger_internal_tests.yml +++ b/.github/workflows/trigger_internal_tests.yml @@ -9,7 +9,7 @@ on: jobs: trigger: name: "trigger" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - run: | curl -X POST \ diff --git a/utils/docker/Dockerfile.focal b/utils/docker/Dockerfile.focal deleted file mode 100644 index 5a719cd3b..000000000 --- a/utils/docker/Dockerfile.focal +++ /dev/null @@ -1,53 +0,0 @@ -FROM ubuntu:focal - -ARG DEBIAN_FRONTEND=noninteractive -ARG TZ=America/Los_Angeles -ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/java:v%version%-focal" - -# === INSTALL JDK and Maven === - -RUN apt-get update && \ - apt-get install -y --no-install-recommends openjdk-21-jdk \ - # Install utilities required for downloading browsers - wget \ - # Install utilities required for downloading driver - unzip \ - # For the MSEdge install script - gpg && \ - rm -rf /var/lib/apt/lists/* && \ - # Create the pwuser - adduser pwuser - -# Ubuntu 22.04 and earlier come with Maven 3.6.3 which fails with -# Java 21, so we install latest Maven from Apache instead. -RUN VERSION=3.9.6 && \ - wget -O - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \ - ln -s /opt/apache-maven-$VERSION/bin/mvn /usr/local/bin/ - -ARG PW_TARGET_ARCH -ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-${PW_TARGET_ARCH} - -# === BAKE BROWSERS INTO IMAGE === - -# Browsers will remain downloaded in `/ms-playwright`. -# Note: make sure to set 777 to the registry so that any user can access -# registry. - -ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright - -RUN mkdir /ms-playwright && \ - mkdir /tmp/pw-java - -COPY . /tmp/pw-java - -RUN cd /tmp/pw-java && \ - ./scripts/download_driver.sh && \ - mvn install -D skipTests --no-transfer-progress && \ - DEBIAN_FRONTEND=noninteractive mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \ - -D exec.args="install-deps" -f playwright/pom.xml --no-transfer-progress && \ - mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \ - -D exec.args="install" -f playwright/pom.xml --no-transfer-progress && \ - mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \ - -D exec.args="mark-docker-image '${DOCKER_IMAGE_NAME_TEMPLATE}'" -f playwright/pom.xml --no-transfer-progress && \ - rm -rf /tmp/pw-java && \ - chmod -R 777 $PLAYWRIGHT_BROWSERS_PATH diff --git a/utils/docker/build.sh b/utils/docker/build.sh index 03d162873..074d22b19 100755 --- a/utils/docker/build.sh +++ b/utils/docker/build.sh @@ -3,12 +3,12 @@ set -e set +x if [[ ($1 == '--help') || ($1 == '-h') || ($1 == '') || ($2 == '') ]]; then - echo "usage: $(basename $0) {--arm64,--amd64} {focal,jammy} playwright:localbuild-focal" + echo "usage: $(basename $0) {--arm64,--amd64} {jammy,noble} playwright:localbuild-noble" echo - echo "Build Playwright docker image and tag it as 'playwright:localbuild-focal'." + echo "Build Playwright docker image and tag it as 'playwright:localbuild-noble'." echo "Once image is built, you can run it with" echo "" - echo " docker run --rm -it playwright:localbuild-focal /bin/bash" + echo " docker run --rm -it playwright:localbuild-noble /bin/bash" echo "" echo "NOTE: this requires on Playwright PIP dependencies to be installed" echo "" diff --git a/utils/docker/publish_docker.sh b/utils/docker/publish_docker.sh index 9bf5c9fea..65c05bbaa 100755 --- a/utils/docker/publish_docker.sh +++ b/utils/docker/publish_docker.sh @@ -27,11 +27,6 @@ else exit 1 fi -# Ubuntu 20.04 -FOCAL_TAGS=( - "v${PW_VERSION}-focal" -) - # Ubuntu 22.04 JAMMY_TAGS=( "v${PW_VERSION}-jammy" @@ -75,14 +70,12 @@ install_oras_if_needed() { publish_docker_images_with_arch_suffix() { local FLAVOR="$1" local TAGS=() - if [[ "$FLAVOR" == "focal" ]]; then - TAGS=("${FOCAL_TAGS[@]}") - elif [[ "$FLAVOR" == "jammy" ]]; then + if [[ "$FLAVOR" == "jammy" ]]; then TAGS=("${JAMMY_TAGS[@]}") elif [[ "$FLAVOR" == "noble" ]]; then TAGS=("${NOBLE_TAGS[@]}") else - echo "ERROR: unknown flavor - $FLAVOR. Must be either 'focal', 'jammy', or 'noble'" + echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'" exit 1 fi local ARCH="$2" @@ -103,14 +96,12 @@ publish_docker_images_with_arch_suffix() { publish_docker_manifest () { local FLAVOR="$1" local TAGS=() - if [[ "$FLAVOR" == "focal" ]]; then - TAGS=("${FOCAL_TAGS[@]}") - elif [[ "$FLAVOR" == "jammy" ]]; then + if [[ "$FLAVOR" == "jammy" ]]; then TAGS=("${JAMMY_TAGS[@]}") elif [[ "$FLAVOR" == "noble" ]]; then TAGS=("${NOBLE_TAGS[@]}") else - echo "ERROR: unknown flavor - $FLAVOR. Must be either 'focal', 'jammy', 'noble'" + echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble'" exit 1 fi @@ -129,10 +120,6 @@ publish_docker_manifest () { done } -publish_docker_images_with_arch_suffix focal amd64 -publish_docker_images_with_arch_suffix focal arm64 -publish_docker_manifest focal amd64 arm64 - publish_docker_images_with_arch_suffix jammy amd64 publish_docker_images_with_arch_suffix jammy arm64 publish_docker_manifest jammy amd64 arm64