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 2, 2023
1 parent 91647b2 commit 0a33817
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 312 deletions.
8 changes: 5 additions & 3 deletions .github/actions/ortdocker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ runs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
python-version: "3.10"
cache: "pip"

- name: Check if Docker image tag exists
id: check_image
Expand All @@ -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 0a33817

Please sign in to comment.