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

chore(docker): fix master CI by using debian:buster with no backports repo for gcc8 builder #337

Merged
merged 2 commits into from
Apr 19, 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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ jobs:
with:
arch: ${{ matrix.arch }}

paths-filter:
runs-on: ubuntu-latest
outputs:
docker_needs_build: ${{ steps.filter.outputs.docker == 'true' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: filter
with:
filters: |
docker:
- 'docker/**'
build-images-dev:
needs: [build-test-dev,paths-filter]
Copy link
Contributor Author

@FedeDP FedeDP Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reusable_build_push_images workflow needs to download the built driverkit (for the driverkit main image), so we need to depend on build-test-dev too.

if: needs.paths-filter.outputs.docker_needs_build
strategy:
matrix:
arch: [ amd64, arm64 ]
uses: ./.github/workflows/reusable_build_push_images.yml
with:
arch: ${{ matrix.arch }}
push: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not push.

secrets: inherit

gomodtidy:
name: Enforce go.mod tidiness
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ jobs:
arch: ${{ matrix.arch }}

push-images-master:
needs: build-test-master
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved needs at the top of the jobs.

strategy:
matrix:
arch: [amd64, arm64]
uses: ./.github/workflows/reusable_build_push_images.yml
needs: build-test-master
with:
arch: ${{ matrix.arch }}
push: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added push: true

secrets: inherit

images-master:
uses: ./.github/workflows/reusable_manifest_images.yml
needs: push-images-master
uses: ./.github/workflows/reusable_manifest_images.yml
secrets: inherit


5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ jobs:
arch: ${{ matrix.arch }}

push-images-release:
needs: build-test-release
strategy:
matrix:
arch: [amd64, arm64]
uses: ./.github/workflows/reusable_build_push_images.yml
needs: build-test-release
with:
arch: ${{ matrix.arch }}
tag: ${{ github.ref_name }}
is_latest: true
push: true
secrets: inherit

images-release:
uses: ./.github/workflows/reusable_manifest_images.yml
needs: push-images-release
uses: ./.github/workflows/reusable_manifest_images.yml
with:
tag: ${{ github.ref_name }}
is_latest: true
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/reusable_build_push_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ on:
required: false
type: boolean
default: false
push:
description: Whether to also push images
required: false
type: boolean
default: false

jobs:
build-images:
Expand Down Expand Up @@ -48,14 +53,20 @@ jobs:
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Login to Docker Hub
if: inputs.push
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to login if we are not going to push.

uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_SECRET }}

- name: Build and Push docker images
if: inputs.push
run: make push/all


- name: Build docker images
if: inputs.push == false
run: make image/all

- name: Push latest images if needed
if: inputs.is_latest
if: inputs.push && inputs.is_latest
run: make push/latest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:buster-backports
FROM debian:buster

LABEL maintainer="[email protected]"

Expand All @@ -11,11 +11,11 @@ RUN apt-get update \
bash-completion \
bc \
clang \
llvm \
llvm \
ca-certificates \
curl \
dkms \
dwarves/buster-backports \
dwarves \
gnupg2 \
gcc \
jq \
Expand Down
Loading