Skip to content

Commit

Permalink
Merge pull request #160 from PhilippvK/test-ci-philippvk
Browse files Browse the repository at this point in the history
[CI] Make docker more configurable
  • Loading branch information
PhilippvK authored May 9, 2024
2 parents 52b8325 + e40067d commit 8b34152
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ jobs:
uses: docker/login-action@v2
if: ${{ github.repository == 'tum-ei-eda/mlonmcu' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
Expand All @@ -174,7 +175,7 @@ jobs:
type=registry,ref=ghcr.io/${{ steps.lowered.outputs.lowercase }}-cmake:${{ github.event.inputs.version }}
type=registry,ref=ghcr.io/${{ steps.lowered.outputs.lowercase }}-ci:${{ github.event.inputs.version }}
cache-to: type=inline
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu:${{ github.event.inputs.version }}
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu:${{ github.event.inputs.version }}
bench:
name: Build large image for benchmarking
runs-on: ubuntu-latest
Expand Down Expand Up @@ -229,6 +230,7 @@ jobs:
uses: docker/login-action@v2
if: ${{ github.repository == 'tum-ei-eda/mlonmcu' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
Expand All @@ -247,4 +249,4 @@ jobs:
type=registry,ref=ghcr.io/${{ steps.lowered.outputs.lowercase }}-ci:${{ github.event.inputs.version }}
type=registry,ref=ghcr.io/${{ steps.lowered.outputs.lowercase }}:${{ github.event.inputs.version }}
cache-to: type=inline
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu-bench:${{ github.event.inputs.template }}-${{ github.event.inputs.version }}
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu-bench:${{ github.event.inputs.template }}-${{ github.event.inputs.version }}
10 changes: 6 additions & 4 deletions .github/workflows/container_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ jobs:
uses: docker/login-action@v2
if: ${{ github.repository == 'tum-ei-eda/mlonmcu' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
Expand All @@ -263,8 +264,8 @@ jobs:
type=registry,ref=ghcr.io/${{ steps.lowered.outputs.lowercase }}-ci:${{ steps.branch_str.outputs.branch }}latest
cache-to: type=inline
tags: |
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu:${{ steps.branch_str.outputs.branch }}latest
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu:${{ steps.branch_str.outputs.branch }}${{ steps.timestamp.outputs.builddate }}
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu:${{ steps.branch_str.outputs.branch }}latest
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu:${{ steps.branch_str.outputs.branch }}${{ steps.timestamp.outputs.builddate }}
bench:
name: Build large image for benchmarking
runs-on: ubuntu-latest
Expand Down Expand Up @@ -355,6 +356,7 @@ jobs:
uses: docker/login-action@v2
if: ${{ github.repository == 'tum-ei-eda/mlonmcu' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
Expand All @@ -374,5 +376,5 @@ jobs:
type=registry,ref=ghcr.io/${{ steps.lowered.outputs.lowercase }}:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest
cache-to: type=inline
tags: |
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}${{ steps.timestamp.outputs.builddate }}
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}${{ steps.timestamp.outputs.builddate }}
1 change: 1 addition & 0 deletions .github/workflows/refresh_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
uses: docker/login-action@v2
if: ${{ github.repository == 'tum-ei-eda/mlonmcu' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/refresh_container_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
uses: docker/login-action@v2
if: ${{ github.repository == 'tum-ei-eda/mlonmcu' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
Expand All @@ -97,10 +98,10 @@ jobs:
file: docker/Dockerfile2
push: true
build-args: |
BASE_IMAGE=${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest
BASE_IMAGE=${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest
MLONMCU_TEMPLATE=${{ github.event.inputs.template }}
tags: |
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest-updated
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest-updated
refresh_cron:
name: Refresh large image for benchmarking
if: (github.event_name == 'schedule')
Expand Down Expand Up @@ -162,6 +163,7 @@ jobs:
uses: docker/login-action@v2
if: ${{ github.repository == 'tum-ei-eda/mlonmcu' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
Expand All @@ -172,7 +174,7 @@ jobs:
file: docker/Dockerfile2
push: true
build-args: |
BASE_IMAGE=${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest
BASE_IMAGE=${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest
MLONMCU_TEMPLATE=${{ matrix.config.template }}
tags: |
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest-updated
${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/mlonmcu-bench:${{ steps.template_str.outputs.template }}${{ steps.branch_str.outputs.branch }}latest-updated
20 changes: 11 additions & 9 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ Due to their large size, all other images are hosted on Docker Hub.
All images are versioned by date. The `latest` tag is added to the most recent images.

#### [Cmake Image](https://github.com/tum-ei-eda/mlonmcu/pkgs/container/mlonmcu-cmake)

Command: `docker pull ghcr.io/tum-ei-eda/mlonmcu-cmake:latest`

#### [Minimal/CI Image](https://github.com/tum-ei-eda/mlonmcu/pkgs/container/mlonmcu-ci)

Command: `docker pull ghcr.io/tum-ei-eda/mlonmcu-ci:develop-20240420`

#### [Default/User Image](https://hub.docker.com/r/tumeda/mlonmcu)
Expand All @@ -55,7 +55,7 @@ All images are versioned by date. The `latest` tag is added to the most recent i
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/tumeda/mlonmcu/latest)


Command: `docker pull tumeda/mlonmcu:latest`
Command: `docker pull tumeda/mlonmcu:latest`

- Branch: `develop` ![Docker Image Version (tag)](https://img.shields.io/docker/v/tumeda/mlonmcu/develop-latest)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/tumeda/mlonmcu/develop-latest)
Expand All @@ -68,27 +68,27 @@ All images are versioned by date. The `latest` tag is added to the most recent i

- Branch: `main` , Environment: `dev` ![Docker Image Version (tag)](https://img.shields.io/docker/v/tumeda/mlonmcu-bench/latest)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/tumeda/mlonmcu-bench/latest)

Command: `docker pull tumeda/mlonmcu-bench:latest`

- Branch: `default` , Environment: `dev` ![Docker Image Version (tag)](https://img.shields.io/docker/v/tumeda/mlonmcu-bench/dev-develop-latest)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/tumeda/mlonmcu-bench/dev-develop-latest)

Command: `docker pull tumeda/mlonmcu:develop-latest`

- Branch: `develop`, Environment: `vicuna` ![Docker Image Version (tag)](https://img.shields.io/docker/v/tumeda/mlonmcu-bench/vicuna-develop-latest)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/tumeda/mlonmcu-bench/vicuna-develop-latest)

Command: `docker pull tumeda/mlonmcu-bench:vicuna-develop-latest`

- Branch: `develop`, Environment: `ara` ![Docker Image Version (tag)](https://img.shields.io/docker/v/tumeda/mlonmcu-bench/ara-develop-latest)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/tumeda/mlonmcu-bench/ara-develop-latest)

Command: `docker pull tumeda/mlonmcu-bench:ara-develop-latest`

- Branch: `develop`, Environment: `corev` ![Docker Image Version (tag)](https://img.shields.io/docker/v/tumeda/mlonmcu-bench/corev-develop-latest)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/tumeda/mlonmcu-bench/corev-develop-latest)

Command: `docker pull tumeda/mlonmcu-bench:corev-develop-latest`


Expand Down Expand Up @@ -154,7 +154,9 @@ schedule:
If you want to use the actions on a fork, they will fail due to missing docker credentials. Please export the followinf variables via `Settings -> Secrets -> Actions` to tell the jobs about your username and password:

- `DOCKER_PASSWORD`
- `DOCKER_USERNAME`
- `DOCKER_USERNAME` (i.e. `tumeda`)
- `DOCKER_REGISTRY` (i.e. `docker.io`, `ghcr.io`)
- `DOCKER_NAMESPACE` (i.e. `tumeda`, `path/to/container`)

### Running the Images in Docker Containers

Expand Down

0 comments on commit 8b34152

Please sign in to comment.