Skip to content

Commit

Permalink
feat(docker): Rename images to agreed names
Browse files Browse the repository at this point in the history
Rename Docker image 'ort' to 'ort-minimal' and  'ort-extended' to 'ort'
as agreed in community vote to make it easier for new users to understand
difference between ORT Docker images.

Additionally the language component images now have named version with a
hash to enable checking if contents of an image has changed without
changing core language.

Signed-off-by: Helio Chissini de Castro <heliocastro@gmail.com>
  • Loading branch information
heliocastro committed Nov 6, 2023
1 parent a701b73 commit 5a2fd32
Show file tree
Hide file tree
Showing 8 changed files with 317 additions and 350 deletions.
4 changes: 3 additions & 1 deletion .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 All @@ -80,8 +81,9 @@ runs:
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }}
tags:
tags: |
type=raw,value=${{ inputs.version }}
type=raw,value=${{ steps.check_image.outputs.result }}
- name: Build image
if: steps.check_image.outputs.result != 'found'
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)
202 changes: 0 additions & 202 deletions .github/workflows/docker-ort-runtime-ext.yml

This file was deleted.

Loading

0 comments on commit 5a2fd32

Please sign in to comment.