Skip to content

Commit

Permalink
feat(docker): Rename images to new defaults
Browse files Browse the repository at this point in the history
- ORT main image is now called ort alone. Is based on previous
  ort-extended image.
- A new image called ort-minimal is created based on original ort image.
- Language component images now have named version with hash addition
  to chek if contents of the image changed without changing core
  language.

Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro committed Nov 2, 2023
1 parent b26c5bd commit 10702f7
Show file tree
Hide file tree
Showing 9 changed files with 564 additions and 552 deletions.
1 change: 1 addition & 0 deletions .github/actions/ortdocker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ runs:
INPUT_TOKEN: ${{ inputs.token }}
INPUT_NAME: ${{ inputs.name }}
INPUT_VERSION: ${{ inputs.version }}
BUILD_ARGS: ${{ inputs.build-args }}
run: |
pip install -q -U pip requests
Expand Down
9 changes: 7 additions & 2 deletions .github/actions/ortdocker/check_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# SPDX-License-Identifier: Apache-2.0
# License-Filename: LICENSE

import hashlib
import os

import requests
Expand All @@ -26,7 +27,11 @@
token = os.getenv("INPUT_TOKEN")
org = os.getenv("GITHUB_REPOSITORY_OWNER")
name = os.getenv("INPUT_NAME")
version = os.getenv("INPUT_VERSION")
base_version = os.getenv("INPUT_VERSION")
unique_id = hashlib.sha256(os.getenv("BUILD_ARGS").encode()).hexdigest()

# We base the version on the base_version and the unique_id
version = f"{base_version}-{unique_id[:8]}"

url = f"https://api.github.com/orgs/{org}/packages/container/ort%2F{name}/versions"

Expand All @@ -47,4 +52,4 @@
if version in versions:
print("found")
else:
print("none")
print(version)
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: Docker runtime image
name: ORT Minimal Image

on:
workflow_dispatch:
Expand All @@ -25,7 +25,7 @@ on:
paths:
- '.versions'
- 'Dockerfile'
- '.github/workflows/docker-ort-runtime.yml'
- '.github/workflows/docker-ort-minimal.yml'
push:
tags:
- '*'
Expand Down Expand Up @@ -213,6 +213,7 @@ jobs:
with:
context: .
target: run
file: Dockerfile-minimal
push: true
load: false
build-args: |
Expand Down
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: Docker extended runtime image
name: ORT Image

on:
workflow_dispatch:
workflow_run:
workflows:
- 'Docker runtime image'
- 'ORT Minimal Image'
types:
- completed

Expand Down Expand Up @@ -186,14 +186,13 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile-extended
push: true
load: false
tags: |
${{ steps.meta-ort.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-contexts: |
ort=docker-image://${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:${{ env.ORT_VERSION }}
ort-minimal=docker-image://${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-minimal:${{ env.ORT_VERSION }}
android=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/android:latest
swift=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/swift:latest
scala=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/scala:latest
Expand Down
Loading

0 comments on commit 10702f7

Please sign in to comment.