Skip to content

Commit

Permalink
consolidate image generation matrices (#5815)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabelf5 authored Jun 21, 2024
1 parent 0bb061c commit d073aa6
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 243 deletions.
85 changes: 85 additions & 0 deletions .github/data/matrix-images-nap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"image": [
"debian-plus-nap"
],
"platforms": [
"linux/amd64"
],
"target": [
"goreleaser",
"aws"
],
"nap_modules": [
"dos",
"waf",
"waf,dos"
],
"include": [
{
"image": "ubi-9-plus-nap",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "waf"
},
{
"image": "ubi-8-plus-nap",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "dos"
},
{
"image": "ubi-8-plus-nap",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "waf,dos"
},
{
"image": "ubi-9-plus-nap",
"target": "aws",
"platforms": "linux/amd64",
"nap_modules": "waf"
},
{
"image": "ubi-8-plus-nap",
"target": "aws",
"platforms": "linux/amd64",
"nap_modules": "dos"
},
{
"image": "ubi-8-plus-nap",
"target": "aws",
"platforms": "linux/amd64",
"nap_modules": "waf,dos"
},
{
"image": "alpine-plus-nap-fips",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "waf"
},
{
"image": "alpine-plus-nap-v5-fips",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "waf"
},
{
"image": "debian-plus-nap-v5",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "waf"
},
{
"image": "ubi-9-plus-nap-v5",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "waf"
},
{
"image": "ubi-8-plus-nap-v5",
"target": "goreleaser",
"platforms": "linux/amd64",
"nap_modules": "waf"
}
]
}
15 changes: 15 additions & 0 deletions .github/data/matrix-images-oss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"image": [
"debian",
"alpine"
],
"platforms": [
"linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
],
"include": [
{
"image": "ubi",
"platforms": "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
}
]
}
21 changes: 21 additions & 0 deletions .github/data/matrix-images-plus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"image": [
"debian-plus",
"alpine-plus",
"alpine-plus-fips"
],
"platforms": [
"linux/arm64, linux/amd64"
],
"target": [
"goreleaser",
"aws"
],
"include": [
{
"image": "ubi-plus",
"platforms": "linux/arm64, linux/amd64, linux/s390x",
"target": "goreleaser"
}
]
}
55 changes: 9 additions & 46 deletions .github/workflows/build-base-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
outputs:
docker_md5: ${{ steps.vars.outputs.docker_md5 }}
ic_version: ${{ steps.vars.outputs.ic_version }}
image_matrix_oss: ${{ steps.vars.outputs.image_matrix_oss }}
image_matrix_plus: ${{ steps.vars.outputs.image_matrix_plus }}
image_matrix_nap: ${{ steps.vars.outputs.image_matrix_nap }}
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -35,6 +38,9 @@ jobs:
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
source .github/data/version.txt
echo "ic_version=${IC_VERSION}" >> $GITHUB_OUTPUT
echo "image_matrix_oss=$(cat .github/data/matrix-images-oss.json | jq -c)" >> $GITHUB_OUTPUT
echo "image_matrix_plus=$(cat .github/data/matrix-images-plus.json | jq -c)" >> $GITHUB_OUTPUT
echo "image_matrix_nap=$(cat .github/data/matrix-images-nap.json | jq -c)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
build-oss:
Expand All @@ -46,13 +52,7 @@ jobs:
pull-requests: write # for scout report
strategy:
fail-fast: false
matrix:
image: [debian, alpine]
platforms:
["linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"]
include:
- image: ubi
platforms: "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_oss ) }}
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -116,12 +116,7 @@ jobs:
pull-requests: write # for scout report
strategy:
fail-fast: false
matrix:
image: [debian-plus, alpine-plus, alpine-plus-fips]
platforms: ["linux/arm64, linux/amd64"]
include:
- image: ubi-plus
platforms: "linux/arm64, linux/amd64, linux/s390x"
matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_plus ) }}
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -188,39 +183,7 @@ jobs:
pull-requests: write # for scout report
strategy:
fail-fast: false
matrix:
image: [debian-plus-nap]
platforms: ["linux/amd64"]
nap_modules: [dos, waf, "waf,dos"]
include:
- image: ubi-9-plus-nap
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-8-plus-nap
platforms: "linux/amd64"
nap_modules: dos
- image: ubi-8-plus-nap
platforms: "linux/amd64"
nap_modules: "waf,dos"
- image: alpine-plus-nap-fips
platforms: "linux/amd64"
nap_modules: waf
- image: alpine-plus-nap-v5-fips
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: debian-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-9-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-8-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_nap ) }}
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
summary: true
if: ${{ inputs.authenticated && steps.build-push.conclusion == 'success' }}

- name: Upload Scan Results to the cache
- name: Upload Scan Results to Github Artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
continue-on-error: true
with:
Expand Down
75 changes: 9 additions & 66 deletions .github/workflows/cache-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
outputs:
go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
docker_md5: ${{ steps.vars.outputs.docker_md5 }}
image_matrix_oss: ${{ steps.vars.outputs.image_matrix_oss }}
image_matrix_plus: ${{ steps.vars.outputs.image_matrix_plus }}
image_matrix_nap: ${{ steps.vars.outputs.image_matrix_nap }}
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -30,21 +33,17 @@ jobs:
run: |
./.github/scripts/variables.sh go_code_md5 >> $GITHUB_OUTPUT
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
source .github/data/version.txt
echo "image_matrix_oss=$(cat .github/data/matrix-images-oss.json | jq -c)" >> $GITHUB_OUTPUT
echo "image_matrix_plus=$(cat .github/data/matrix-images-plus.json | jq -c)" >> $GITHUB_OUTPUT
echo "image_matrix_nap=$(cat .github/data/matrix-images-nap.json | jq -c)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
build-docker:
name: Build Docker OSS
needs: [checks]
strategy:
fail-fast: false
matrix:
image: [debian, alpine]
platforms:
["linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"]
include:
- image: ubi
platforms: "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_oss ) }}
uses: ./.github/workflows/build-oss.yml
with:
platforms: ${{ matrix.platforms }}
Expand All @@ -68,14 +67,7 @@ jobs:
needs: [checks]
strategy:
fail-fast: false
matrix:
image: [debian-plus, alpine-plus, alpine-plus-fips]
platforms: ["linux/arm64, linux/amd64"]
target: [goreleaser, aws]
include:
- image: ubi-plus
platforms: "linux/arm64, linux/amd64, linux/s390x"
target: goreleaser
matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_plus ) }}
uses: ./.github/workflows/build-plus.yml
with:
platforms: ${{ matrix.platforms }}
Expand All @@ -98,56 +90,7 @@ jobs:
needs: [checks]
strategy:
fail-fast: false
matrix:
image: [debian-plus-nap]
platforms: ["linux/amd64"]
target: [goreleaser, aws]
nap_modules: [dos, waf, "waf,dos"]
include:
- image: ubi-9-plus-nap
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-8-plus-nap
target: goreleaser
platforms: "linux/amd64"
nap_modules: dos
- image: ubi-8-plus-nap
target: goreleaser
platforms: "linux/amd64"
nap_modules: "waf,dos"
- image: ubi-9-plus-nap
target: aws
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-8-plus-nap
target: aws
platforms: "linux/amd64"
nap_modules: dos
- image: ubi-8-plus-nap
target: aws
platforms: "linux/amd64"
nap_modules: "waf,dos"
- image: alpine-plus-nap-fips
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: alpine-plus-nap-v5-fips
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: debian-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-9-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
- image: ubi-8-plus-nap-v5
target: goreleaser
platforms: "linux/amd64"
nap_modules: waf
matrix: ${{ fromJSON( needs.checks.outputs.image_matrix_nap ) }}
uses: ./.github/workflows/build-plus.yml
with:
platforms: ${{ matrix.platforms }}
Expand Down
Loading

0 comments on commit d073aa6

Please sign in to comment.