Skip to content

Commit

Permalink
chore(docker): Use consistent naming and descriptions
Browse files Browse the repository at this point in the history
Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro authored and tsteenbe committed Sep 26, 2023
1 parent 8e6fd16 commit 029f1ca
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 48 deletions.
16 changes: 8 additions & 8 deletions .github/actions/ortdocker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
# SPDX-License-Identifier: Apache-2.0
# License-Filename: LICENSE

name: "ORT Docker Image"
description: "Check and create docker image for Ort components"
author: "Helio Chissini de Castro <[email protected]>"
name: "ORT Docker image"
description: "Check and create Docker image for ORT components"
author: "The ORT Project Authors"

inputs:
registry:
description: "GitHub Container Registry"
description: "GitHub container registry"
default: "ghcr.io"
token:
description: "GitHub token"
Expand Down Expand Up @@ -61,19 +61,19 @@ runs:
echo $result
echo "result=$result" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
- name: Set up Docker build
if: steps.check_image.outputs.result != 'found'
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
- name: Login to GitHub container registry
if: steps.check_image.outputs.result != 'found'
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ inputs.token }}

- name: Extract components metadata (tags, labels) for base image
- name: Extract components metadata (tags, labels)
if: steps.check_image.outputs.result != 'found'
id: meta
uses: docker/metadata-action@v4
Expand All @@ -83,7 +83,7 @@ runs:
tags:
type=raw,value=${{ inputs.version }}

- name: Build ORT Base container
- name: Build image
if: steps.check_image.outputs.result != 'found'
uses: docker/build-push-action@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/ortdocker/check_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

import requests

""" Use current GitHub API to check if a container image with the
given name and version exists.
"""

token = os.getenv("INPUT_TOKEN")
org = os.getenv("GITHUB_REPOSITORY_OWNER")
name = os.getenv("INPUT_NAME")
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/docker-ort-runtime-ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# SPDX-License-Identifier: Apache-2.0
# License-Filename: LICENSE

name: MegaDocker Extended Image
name: Mega Docker extended image

on:
workflow_dispatch:
Expand All @@ -31,7 +31,7 @@ on:
- '*'
workflow_run:
workflows:
- 'MegaDocker Runtime Image'
- 'Mega Docker runtime image'
types:
- completed

Expand All @@ -42,15 +42,15 @@ permissions: write-all

jobs:
android_image:
name: Android Image
name: Android image
runs-on: ubuntu-22.04
steps:
- name: Checkout default branch
uses: actions/checkout@v3
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Android Image
- name: Build Android image
uses: ./.github/actions/ortdocker
with:
name: android
Expand All @@ -60,15 +60,15 @@ jobs:
ANDROID_CMD_VERSION=${{ env.ANDROID_CMD_VERSION }}
dart_image:
name: Dart Image
name: Dart image
runs-on: ubuntu-22.04
steps:
- name: Checkout default branch
uses: actions/checkout@v3
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Dart Image
- name: Build Dart image
uses: ./.github/actions/ortdocker
with:
name: dart
Expand All @@ -78,15 +78,15 @@ jobs:
DART_VERSION=${{ env.DART_VERSION }}
dotnet_image:
name: Dotnet Image
name: Dotnet image
runs-on: ubuntu-22.04
steps:
- name: Checkout default branch
uses: actions/checkout@v3
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Dotnet Image
- name: Build Dotnet image
uses: ./.github/actions/ortdocker
with:
name: dotnet
Expand All @@ -97,15 +97,15 @@ jobs:
NUGET_INSPECTOR_VERSION=${{ env.NUGET_INSPECTOR_VERSION }}
haskell_image:
name: Haskell Image
name: Haskell image
runs-on: ubuntu-22.04
steps:
- name: Checkout default branch
uses: actions/checkout@v3
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Haskell Image
- name: Build Haskell image
uses: ./.github/actions/ortdocker
with:
name: haskell
Expand All @@ -115,15 +115,15 @@ jobs:
HASKELL_STACK_VERSION=${{ env.HASKELL_STACK_VERSION }}
scala_image:
name: Scala Image
name: Scala image
runs-on: ubuntu-22.04
steps:
- name: Checkout default branch
uses: actions/checkout@v3
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Scala Image
- name: Build Scala image
uses: ./.github/actions/ortdocker
with:
name: scala
Expand All @@ -133,15 +133,15 @@ jobs:
SBT_VERSION=${{ env.SBT_VERSION }}
swift_image:
name: Swift Image
name: Swift image
runs-on: ubuntu-22.04
steps:
- name: Checkout default branch
uses: actions/checkout@v3
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Swift Image
- name: Build Swift image
uses: ./.github/actions/ortdocker
with:
name: swift
Expand All @@ -152,7 +152,7 @@ jobs:
runtime_extended_image:
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
name: Build ORT Extended Image
name: Build ORT extended image
needs: [ android_image, dart_image, dotnet_image, haskell_image, scala_image, swift_image ]
runs-on: ubuntu-22.04
permissions:
Expand All @@ -163,17 +163,17 @@ jobs:
- name: Checkout default branch
uses: actions/checkout@v3

- name: Set up Docker Buildx
- name: Set up Docker build
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
- name: Login to GitHub container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract components metadata (tags, labels) for Ort runtime image
- name: Extract components metadata (tags, labels)
id: meta-ort
uses: docker/metadata-action@v4
with:
Expand All @@ -182,7 +182,7 @@ jobs:
tags: |
type=raw,sha,enable=true,format=short
- name: Build ORT runtime container
- name: Build ORT extended runtime image
uses: docker/build-push-action@v4
with:
context: .
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/docker-ort-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# SPDX-License-Identifier: Apache-2.0
# License-Filename: LICENSE

name: MegaDocker Runtime Image
name: Mega Docker runtime image

on:
workflow_dispatch:
Expand All @@ -36,15 +36,15 @@ permissions: write-all

jobs:
base_image:
name: Base Image
name: Base image
runs-on: ubuntu-22.04
steps:
- name: Checkout default branch
uses: actions/checkout@v3
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Base Image
- name: Build base image
uses: ./.github/actions/ortdocker
with:
name: base
Expand All @@ -55,7 +55,7 @@ jobs:
UBUNTU_VERSION=${{ env.UBUNTU_VERSION }}
nodejs_image:
name: NodeJS Image
name: NodeJS image
needs: [base_image]
runs-on: ubuntu-22.04
steps:
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build NodeJS Image
- name: Build NodeJS image
uses: ./.github/actions/ortdocker
with:
name: nodejs
Expand All @@ -77,7 +77,7 @@ jobs:
YARN_VERSION=${{ env.YARN_VERSION }}
python_image:
name: Python Image
name: Python image
needs: [base_image]
runs-on: ubuntu-22.04
steps:
Expand All @@ -86,7 +86,7 @@ jobs:
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Python Image
- name: Build Python image
uses: ./.github/actions/ortdocker
with:
name: python
Expand All @@ -103,7 +103,7 @@ jobs:
SCANCODE_VERSION=${{ env.SCANCODE_VERSION }}
rust_image:
name: Rust Image
name: Rust image
needs: [base_image]
runs-on: ubuntu-22.04
steps:
Expand All @@ -112,7 +112,7 @@ jobs:
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Rust Image
- name: Build Rust image
uses: ./.github/actions/ortdocker
with:
name: rust
Expand All @@ -122,7 +122,7 @@ jobs:
RUST_VERSION=${{ env.RUST_VERSION }}
ruby_image:
name: Ruby Image
name: Ruby image
needs: [base_image]
runs-on: ubuntu-22.04
steps:
Expand All @@ -131,7 +131,7 @@ jobs:
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Ruby Image
- name: Build Ruby image
uses: ./.github/actions/ortdocker
with:
name: ruby
Expand All @@ -142,7 +142,7 @@ jobs:
COCOAPODS_VERSION=${{ env.COCOAPODS_VERSION }}
golang_image:
name: Golang Image
name: Golang image
needs: [base_image]
runs-on: ubuntu-22.04
steps:
Expand All @@ -151,7 +151,7 @@ jobs:
- name: Set environment variables
run: |
cat .versions >> $GITHUB_ENV
- name: Build Golang Image
- name: Build Golang image
uses: ./.github/actions/ortdocker
with:
name: golang
Expand All @@ -163,7 +163,7 @@ jobs:
runtime_image:
needs: [base_image, nodejs_image, python_image, rust_image, ruby_image, golang_image]
name: Build ORT runtime Image
name: Build ORT runtime image
runs-on: ubuntu-22.04
permissions:
contents: read
Expand All @@ -177,17 +177,17 @@ jobs:
run: |
cat .versions >> $GITHUB_ENV
- name: Set up Docker Buildx
- name: Set up Docker build
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
- name: Login to GitHub container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract components metadata (tags, labels) for Ort runtime image
- name: Extract components metadata (tags, labels)
id: meta-ort
uses: docker/metadata-action@v4
with:
Expand All @@ -196,7 +196,7 @@ jobs:
tags: |
type=raw,sha,enable=true,format=short
- name: Build ORT runtime container
- name: Build ORT runtime image
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@v4
with:
Expand Down
Loading

0 comments on commit 029f1ca

Please sign in to comment.