Skip to content

Commit

Permalink
github: use fqin tagging throughout the CI jobs
Browse files Browse the repository at this point in the history
Use the newer Fully-Qualified-Image-Name tagging scheme in the github ci
actions yaml. This makes the naming of each image better match the core
build parameters (kind, package source, distro base (aka OS), and arch).

The major build and test targets all get an IMG_TAG env var to help
organize and make the rest of the yaml structure consistent.

One workaround we need to apply is to the toolbox builds as the
FROM line in the dockerfiles don't match FQINs nor do they match the
old scheme consistently (see #146). So we just do a little hack
in that section alone to get things working correctly.

Signed-off-by: John Mulligan <[email protected]>
  • Loading branch information
phlogistonjohn authored and mergify[bot] committed Jul 19, 2023
1 parent 8a631d9 commit a6022f2
Showing 1 changed file with 40 additions and 20 deletions.
60 changes: 40 additions & 20 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ jobs:
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Build the server image
run: make KIND=server OS_NAME=${{ matrix.os}} BUILD_ARCH=${{ matrix.arch}} build-image
- name: Upload server image
uses: ishworkh/[email protected]
with:
image: "samba-server:${{ matrix.os }}-latest"
image: "samba-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
retention_days: 1

Expand All @@ -64,14 +65,15 @@ jobs:
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Build the ad server image
run: make KIND=ad-server OS_NAME=${{matrix.os}} BUILD_ARCH=${{matrix.arch}} build-image
- name: Upload ad server image
uses: ishworkh/[email protected]
with:
image: "samba-ad-server:${{ matrix.os}}-latest"
image: "samba-ad-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
retention_days: 1

Expand All @@ -83,6 +85,7 @@ jobs:
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: build the client image
Expand All @@ -92,7 +95,7 @@ jobs:
- name: Upload the client image
uses: ishworkh/[email protected]
with:
image: "quay.io/samba.org/samba-client:${{ matrix.os }}-latest"
image: "samba-client:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
retention_days: 1

Expand All @@ -105,15 +108,22 @@ jobs:
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
# Download locally stored samba-client image to be used as base for building
# samba-toolbox.
- name: Download client image
uses: ishworkh/[email protected]
with:
image: "quay.io/samba.org/samba-client:${{ matrix.os }}-latest"
image: "samba-client:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
# Workaround: retag the image so that the FQIN image matches the name in
# the toolbox containerfiles.
- name: Apply OS-latest tag to image (for centos)
run: ${{ env.CONTAINER_CMD }} tag samba-client:${{ env.IMG_TAG }} quay.io/samba.org/samba-client:${{ matrix.os }}-latest
- name: Apply latest tag to image (for fedora)
run: ${{ env.CONTAINER_CMD }} tag samba-client:${{ env.IMG_TAG }} quay.io/samba.org/samba-client:latest
- name: Build the toolbox image
run: make KIND=toolbox OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image

Expand All @@ -124,15 +134,18 @@ jobs:
arch: [amd64]
needs: build-server
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Download server image
uses: ishworkh/[email protected]
with:
image: "samba-server:${{ matrix.os }}-latest"
image: "samba-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
- name: Test the server image
run: LOCAL_TAG="samba-server:${{ matrix.os}}-latest" tests/test-samba-container.sh
run: LOCAL_TAG=samba-server:${{ env.IMG_TAG }} tests/test-samba-container.sh

# Reminder: the nightly-server images consume nightly samba rpm builds
# it is not *just* an image that gets built nightly
Expand All @@ -144,14 +157,15 @@ jobs:
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Build the nightly server image
run: make KIND=server PACKAGE_SOURCE=nightly OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
- name: Upload nightly server image
uses: ishworkh/[email protected]
with:
image: "samba-server:${{ matrix.os }}-nightly"
image: "samba-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
retention_days: 1

Expand All @@ -163,14 +177,15 @@ jobs:
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Build the nightly ad server image
run: make KIND=ad-server PACKAGE_SOURCE=nightly OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
- name: Upload nightly AD server image
uses: ishworkh/[email protected]
with:
image: "samba-ad-server:${{ matrix.os }}-nightly"
image: "samba-ad-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
retention_days: 1

Expand All @@ -181,15 +196,18 @@ jobs:
arch: [amd64]
needs: build-nightly-server
runs-on: ubuntu-latest
env:
BUILDAH_FORMAT: oci
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Download nightly server image
uses: ishworkh/[email protected]
with:
image: "samba-server:${{ matrix.os }}-nightly"
image: "samba-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
- name: Test the nightly server image
run: LOCAL_TAG=samba-server:${{ matrix.os }}-nightly tests/test-samba-container.sh
run: LOCAL_TAG=samba-server:${{ env.IMG_TAG }} tests/test-samba-container.sh

test-ad-server-kubernetes:
strategy:
Expand All @@ -204,7 +222,8 @@ jobs:
# need to explicitly use 20.04 to avoid problems with jq...
runs-on: ubuntu-20.04
env:
IMG_TAG: ${{ matrix.os }}-latest
BUILDAH_FORMAT: oci
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- uses: nolar/setup-k3d-k3s@v1
Expand All @@ -213,17 +232,17 @@ jobs:
- name: Download ad server image
uses: ishworkh/[email protected]
with:
image: "samba-ad-server:${{ matrix.os }}-latest"
image: "samba-ad-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
- name: import ad server image
run: k3d image import samba-ad-server:${{ matrix.os }}-latest
run: k3d image import samba-ad-server:${{ env.IMG_TAG }}
- name: Download file server image
uses: ishworkh/[email protected]
with:
image: "samba-server:${{ matrix.os }}-latest"
image: "samba-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
- name: import file server image
run: k3d image import samba-server:${{ matrix.os }}-latest
run: k3d image import samba-server:${{ env.IMG_TAG }}
- name: run the ad-dc deployment test
run: ./tests/test-samba-ad-server-kubernetes.sh

Expand All @@ -238,7 +257,8 @@ jobs:
# need to explicitly use 20.04 to avoid problems with jq...
runs-on: ubuntu-20.04
env:
IMG_TAG: ${{ matrix.os }}-nightly
BUILDAH_FORMAT: oci
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- uses: nolar/setup-k3d-k3s@v1
Expand All @@ -247,17 +267,17 @@ jobs:
- name: Download nightly ad server image
uses: ishworkh/[email protected]
with:
image: "samba-ad-server:${{ matrix.os }}-nightly"
image: "samba-ad-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
- name: import nightly ad server image
run: k3d image import samba-ad-server:${{ matrix.os }}-nightly
run: k3d image import samba-ad-server:${{ env.IMG_TAG }}
- name: Download nightly file server image
uses: ishworkh/[email protected]
with:
image: "samba-server:${{ matrix.os }}-nightly"
image: "samba-server:${{ env.IMG_TAG }}"
container_engine: ${{ env.CONTAINER_CMD }}
- name: import nightly file server image
run: k3d image import samba-server:${{ matrix.os }}-nightly
run: k3d image import samba-server:${{ env.IMG_TAG }}
- name: run the ad-dc deployment test
run: ./tests/test-samba-ad-server-kubernetes.sh

Expand Down

0 comments on commit a6022f2

Please sign in to comment.