Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh GHA runners for UBI8 tests #432

Merged
merged 10 commits into from
Jan 10, 2024
45 changes: 45 additions & 0 deletions .github/workflows/image-workflow-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: UBI8 OpenJDK S2I Image CI template
on:
workflow_call:
inputs:
image:
required: true
type: string
env:
LANG: en_US.UTF-8
jobs:
openjdkci:
name: OpenJDK S2I Build and Test
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Verify latest UBI image is present
run: docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest

- name: Install CEKit
uses: cekit/[email protected]

- name: Build
run: |
cekit -v --descriptor ${{ inputs.image }}.yaml build docker --no-squash

- name: Install and cache S2I CLI tool from GitHub
uses: redhat-actions/openshift-tools-installer@v1
with:
source: "github"
github_pat: ${{ github.token }}
s2i: "1.3.4"

# s2i misbehaves if registry credentials are present: tries and fails to query
# image metadata from docker.io before each build, etc. See:
# https://github.com/openshift/source-to-image/issues/1134
- name: clear docker credentials
run: docker logout

- name: Behave Tests
run: |
echo /home/runner/work/_temp/openshift-bin >> $GITHUB_PATH
cekit -v --descriptor ${{ inputs.image }}.yaml test behave --steps-url https://github.com/jmtd/behave-test-steps
52 changes: 6 additions & 46 deletions .github/workflows/ubi8-openjdk-11-runtime.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,10 @@
name: OpenJDK 11 Runtime Image CI
name: UBI8 OpenJDK 11 Runtime Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
CEKIT_VERSION: 4.6.0
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
IMAGE: ubi8-openjdk-11-runtime
jobs:
openjdkci:
name: OpenJDK Runtime Build and Test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Verify latest UBI image is present
run: |
docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest
docker image ls | grep ubi8
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install -y virtualenv libkrb5-dev
- name: Setup virtualenv and install cekit and required packages
run: |
mkdir ~/cekit${{ env.CEKIT_VERSION }}
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
- name: Build
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-11-runtime.yaml build docker
docker image ls

# even though we don't run any S2I tests for the runtime images, the test suite
# will fail to start if the s2i binary is not present.
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version

- name: Behave Tests
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-11-runtime.yaml test behave
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-11-runtime
48 changes: 6 additions & 42 deletions .github/workflows/ubi8-openjdk-11.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,10 @@
name: OpenJDK 11 S2I Image CI
name: UBI8 OpenJDK 11 S2I Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
CEKIT_VERSION: 4.6.0
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
IMAGE: ubi8-openjdk-11
jobs:
openjdkci:
name: OpenJDK S2I Build and Test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Verify latest UBI image is present
run: |
docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest
docker image ls | grep ubi8
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install -y virtualenv libkrb5-dev
- name: Setup virtualenv and install cekit and required packages
run: |
mkdir ~/cekit${{ env.CEKIT_VERSION }}
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
- name: Build
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-11.yaml build docker
docker image ls
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version
- name: Behave Tests
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-11.yaml test behave
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-11
52 changes: 6 additions & 46 deletions .github/workflows/ubi8-openjdk-17-runtime.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,10 @@
name: OpenJDK 17 Runtime Image CI
name: UBI8 OpenJDK 17 Runtime Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
CEKIT_VERSION: 4.6.0
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
IMAGE: ubi8-openjdk-17-runtime
jobs:
openjdkci:
name: OpenJDK Runtime Build and Test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Verify latest UBI image is present
run: |
docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest
docker image ls | grep ubi8
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install -y virtualenv libkrb5-dev
- name: Setup virtualenv and install cekit and required packages
run: |
mkdir ~/cekit${{ env.CEKIT_VERSION }}
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
- name: Build
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-17-runtime.yaml build docker
docker image ls

# even though we don't run any S2I tests for the runtime images, the test suite
# will fail to start if the s2i binary is not present.
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version

- name: Behave Tests
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-17-runtime.yaml test behave
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-17-runtime
48 changes: 6 additions & 42 deletions .github/workflows/ubi8-openjdk-17.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,10 @@
name: OpenJDK 17 S2I Image CI
name: UBI8 OpenJDK 17 S2I Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
CEKIT_VERSION: 4.6.0
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
IMAGE: ubi8-openjdk-17
jobs:
openjdkci:
name: OpenJDK S2I Build and Test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Verify latest UBI image is present
run: |
docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest
docker image ls | grep ubi8
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install -y virtualenv libkrb5-dev
- name: Setup virtualenv and install cekit and required packages
run: |
mkdir ~/cekit${{ env.CEKIT_VERSION }}
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
- name: Build
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-17.yaml build docker
docker image ls
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version
- name: Behave Tests
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-17.yaml test behave
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-17
2 changes: 1 addition & 1 deletion .github/workflows/ubi8-openjdk-21-runtime.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: UBI8 OpenJDK 21 Runtime S2I Image CI
name: UBI8 OpenJDK 21 Runtime Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
Expand Down
52 changes: 6 additions & 46 deletions .github/workflows/ubi8-openjdk-8-runtime.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,10 @@
name: OpenJDK 8 Runtime Image CI
name: UBI8 OpenJDK 8 Runtime Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
CEKIT_VERSION: 4.6.0
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
IMAGE: ubi8-openjdk-8-runtime
jobs:
openjdkci:
name: OpenJDK Runtime Build and Test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Verify latest UBI image is present
run: |
docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest
docker image ls | grep ubi8
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install -y virtualenv libkrb5-dev
- name: Setup virtualenv and install cekit and required packages
run: |
mkdir ~/cekit${{ env.CEKIT_VERSION }}
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
- name: Build
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-8-runtime.yaml build docker
docker image ls

# even though we don't run any S2I tests for the runtime images, the test suite
# will fail to start if the s2i binary is not present.
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version

- name: Behave Tests
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-8-runtime.yaml test behave
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-8-runtime
48 changes: 6 additions & 42 deletions .github/workflows/ubi8-openjdk-8.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,10 @@
name: OpenJDK 8 S2I Image CI
name: UBI8 OpenJDK 8 S2I Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
CEKIT_VERSION: 4.6.0
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
IMAGE: ubi8-openjdk-8
jobs:
openjdkci:
name: OpenJDK S2I Build and Test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Verify latest UBI image is present
run: |
docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest
docker image ls | grep ubi8
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install -y virtualenv libkrb5-dev
- name: Setup virtualenv and install cekit and required packages
run: |
mkdir ~/cekit${{ env.CEKIT_VERSION }}
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
- name: Build
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-8.yaml build docker
docker image ls
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version
- name: Behave Tests
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
cekit -v --descriptor ubi8-openjdk-8.yaml test behave
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-8
10 changes: 3 additions & 7 deletions tests/features/java/java_s2i.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# temporarily marking 'ignore' so these tests are skipped on GHA
# See: https://issues.redhat.com/browse/OPENJDK-2602
@ignore
@ubi8/openjdk-8
@ubi8/openjdk-11
@ubi8/openjdk-17
Expand Down Expand Up @@ -328,10 +331,3 @@ Feature: Openshift OpenJDK S2I tests
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from OPENJDK-1549 with env
| variable | value |
| MAVEN_ARGS | validate |

Scenario: Ensure that run-env.sh placed in the JAVA_APP_DIR is sourced in the run script before launching java
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i
| variable | value |
| S2I_SOURCE_DATA_DIR | ./ |
| S2I_TARGET_DATA_DIR | /deployments |
Then container log should contain INFO exec -a "someUniqueString" java
Loading
Loading