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

[cherry-pick] Image matrix #5950

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -24,6 +24,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 @@ -34,6 +37,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:
id-token: write
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 @@ -117,12 +117,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 @@ -190,39 +185,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 @@ -229,7 +229,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
Loading