diff --git a/.github/actions/ortdocker/action.yml b/.github/actions/ortdocker/action.yml new file mode 100644 index 0000000000000..02c732ec79f76 --- /dev/null +++ b/.github/actions/ortdocker/action.yml @@ -0,0 +1,100 @@ +# Copyright (C) 2023 The ORT Project Authors (see ) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# 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 " + +inputs: + registry: + description: "GitHub Container Registry" + default: "ghcr.io" + token: + description: "GitHub token" + required: true + name: + description: "Image name" + required: true + version: + description: "Image version" + required: true + build-args: + description: "List of build-time variables" + required: false + +runs: + using: "composite" + + steps: + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' + + - name: Check if Docker image tag exists + id: check_image + shell: bash + env: + INPUT_REGISTRY: ${{ inputs.registry }} + INPUT_TOKEN: ${{ inputs.token }} + INPUT_NAME: ${{ inputs.name }} + INPUT_VERSION: ${{ inputs.version }} + run: | + pip install -q -U pip requests + + result=$(python ./.github/actions/ortdocker/check_image.py) + echo $result + echo "result=$result" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + if: steps.check_image.outputs.result != 'found' + uses: docker/setup-buildx-action@v2 + + - 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 + if: steps.check_image.outputs.result != 'found' + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }} + tags: + type=raw,value=${{ inputs.version }} + + - name: Build ORT Base container + if: steps.check_image.outputs.result != 'found' + uses: docker/build-push-action@v4 + with: + context: . + target: ${{ inputs.name }} + push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + load: false + build-args: ${{ inputs.build-args }} + tags: | + ${{ steps.meta.outputs.tags }} + ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }}:latest + labels: ${{ steps.meta.outputs.labels }} + + diff --git a/.github/actions/ortdocker/check_image.py b/.github/actions/ortdocker/check_image.py new file mode 100644 index 0000000000000..49ecbfbfc00b5 --- /dev/null +++ b/.github/actions/ortdocker/check_image.py @@ -0,0 +1,45 @@ +# Copyright (C) 2023 The ORT Project Authors (see ) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# License-Filename: LICENSE + +import os + +import requests + +token = os.getenv("INPUT_TOKEN") +org = os.getenv("GITHUB_REPOSITORY_OWNER") +name = os.getenv("INPUT_NAME") +version = os.getenv("INPUT_VERSION") + +url = f"https://api.github.com/orgs/{org}/packages/container/ort%2F{name}/versions" + +headers = { + "Accept": "application/vnd.github+json", + "Authorization": f"Bearer {token}", +} +response = requests.get(url, headers=headers) +response.raise_for_status() + +versions = [ + item + for sublist in [v["metadata"]["container"]["tags"] for v in response.json()] + if sublist + for item in sublist +] +if version in versions: + print("found") +else: + print("none") diff --git a/.github/workflows/docker-ort-base.yml b/.github/workflows/docker-ort-base.yml deleted file mode 100644 index 5f0589ce94d18..0000000000000 --- a/.github/workflows/docker-ort-base.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2023 The ORT Project Authors (see ) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# License-Filename: LICENSE - -name: Base Image - -on: - workflow_dispatch: - pull_request: - paths: - - '.ortversions/base.versions' - - 'Dockerfile' - push: - branches: - - main - -env: - REGISTRY: ghcr.io - -jobs: - build: - name: Build ORT Base image - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout main repository - uses: actions/checkout@v3 - - - name: Set environment variables - run: | - cat .ortversions/base.versions >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - 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 base image - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository }}/base - tags: - type=raw,value=${{ env.JAVA_VERSION }}-jdk-${{ env.UBUNTU_VERSION }} - - - name: Build ORT Base container - uses: docker/build-push-action@v4 - with: - context: . - target: ort-base-image - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - build-args: | - JAVA_VERSION=${{ env.JAVA_VERSION }} - UBUNTU_VERSION=${{ env.UBUNTU_VERSION }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository }}/base:latest - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha,scope=ortbase - cache-to: type=gha,scope=ortbase,mode=max diff --git a/.github/workflows/docker-ort-golang.yml b/.github/workflows/docker-ort-golang.yml deleted file mode 100644 index 2b79707ff5a64..0000000000000 --- a/.github/workflows/docker-ort-golang.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) 2023 The ORT Project Authors (see ) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# License-Filename: LICENSE - -name: Golang Image - -on: - workflow_dispatch: - push: - branches: - - main - pull_request: - paths: - - '.ortversions/golang.versions' - - '.github/workflows/docker-ort-base.yml' - workflow_run: - workflows: ["Ruby Image"] - types: - - completed - -env: - REGISTRY: ghcr.io - -permissions: write-all - -jobs: - build: - name: Build ORT Golang Image - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout main repository - uses: actions/checkout@v3 - - - name: Set environment variables - run: | - cat .ortversions/golang.versions >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - 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 base image - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository }}/golang - tags: | - type=semver,pattern={{version}},value=${{ env.GO_VERSION }} - - - - name: Build ORT Golang container - uses: docker/build-push-action@v4 - with: - context: . - target: golang - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - build-args: | - GO_DEP_VERSION=${{ env.GO_DEP_VERSION }} - GO_VERSION=${{ env.GO_VERSION }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository }}/golang:latest - labels: ${{ steps.meta.outputs.labels }} - build-contexts: | - ort-base-image=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/base:latest - cache-from: type=gha,scope=ortgolang - cache-to: type=gha,scope=ortgolang,mode=max diff --git a/.github/workflows/docker-ort-nodejs.yml b/.github/workflows/docker-ort-nodejs.yml deleted file mode 100644 index 7429a049d6324..0000000000000 --- a/.github/workflows/docker-ort-nodejs.yml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) 2023 The ORT Project Authors (see ) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# License-Filename: LICENSE - -name: NodeJS Image - -on: - workflow_dispatch: - push: - branches: - - main - pull_request: - paths: - - '.ortversions/nodejs.versions' - - '.github/workflows/docker-ort-base.yml' - workflow_run: - workflows: ["Python Image"] - types: - - completed - -env: - REGISTRY: ghcr.io - -permissions: write-all - -jobs: - build: - name: Build ORT NodeJS Image - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout main repository - uses: actions/checkout@v3 - - - name: Set environment variables - run: | - cat .ortversions/nodejs.versions >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - 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 base image - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository }}/nodejs - tags: | - type=raw,value=${{ env.NODEJS_VERSION }} - - - name: Build ORT NodeJS container - uses: docker/build-push-action@v4 - with: - context: . - target: nodejs - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - build-args: | - NODEJS_VERSION=${{ env.NODEJS_VERSION }} - NPM_VERSION=${{ env.NPM_VERSION }} - PNPM_VERSION=${{ env.PNPM_VERSION }} - YARN_VERSION=${{ env.YARN_VERSION }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository }}/nodejs:latest - labels: ${{ steps.meta.outputs.labels }} - build-contexts: | - ort-base-image=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/base:latest - cache-from: type=gha,scope=ortnodejs - cache-to: type=gha,scope=ortnodejs,mode=max diff --git a/.github/workflows/docker-ort-python.yml b/.github/workflows/docker-ort-python.yml deleted file mode 100644 index 783e3fc4d3bec..0000000000000 --- a/.github/workflows/docker-ort-python.yml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (C) 2023 The ORT Project Authors (see ) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# License-Filename: LICENSE - -name: Python Image - -on: - workflow_dispatch: - push: - branches: - - main - pull_request: - paths: - - '.ortversions/python.versions' - - '.github/workflows/docker-ort-base.yml' - workflow_run: - workflows: ["Base Image"] - types: - - completed - -env: - REGISTRY: ghcr.io - -permissions: write-all - -jobs: - build: - name: Build ORT Python Image - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout main repository - uses: actions/checkout@v3 - - - name: Set environment variables - run: | - cat .ortversions/python.versions >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - 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 base image - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository }}/python - tags: | - type=raw,value=${{ env.PYTHON_VERSION }} - - - name: Build ORT Python container - uses: docker/build-push-action@v4 - with: - context: . - target: python - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - build-args: | - CONAN_VERSION=${{ env.CONAN_VERSION }} - PIPTOOL_VERSION=${{ env.PIPTOOL_VERSION }} - PYENV_GIT_TAG=${{ env.PYENV_GIT_TAG }} - PYTHON_INSPECTOR_VERSION=${{ env.PYTHON_INSPECTOR_VERSION }} - PYTHON_PIPENV_VERSION=${{ env.PYTHON_PIPENV_VERSION }} - PYTHON_POETRY_VERSION=${{ env.PYTHON_POETRY_VERSION }} - PYTHON_VERSION=${{ env.PYTHON_VERSION }} - SCANCODE_VERSION=${{ env.SCANCODE_VERSION }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository }}/python:${{ env.PYTHON_VERSION }} - ${{ env.REGISTRY }}/${{ github.repository }}/python:latest - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha,scope=ortpython - cache-to: type=gha,scope=ortpython,mode=max diff --git a/.github/workflows/docker-ort-ruby.yml b/.github/workflows/docker-ort-ruby.yml deleted file mode 100644 index b8de1d088dd6e..0000000000000 --- a/.github/workflows/docker-ort-ruby.yml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) 2023 The ORT Project Authors (see ) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# License-Filename: LICENSE - -name: Ruby Image - -on: - workflow_dispatch: - push: - branches: - - main - pull_request: - paths: - - '.ortversions/ruby.versions' - - '.github/workflows/docker-ort-base.yml' - workflow_run: - workflows: ["Rust Image"] - types: - - completed - -env: - REGISTRY: ghcr.io - -permissions: write-all - -jobs: - build: - name: Build ORT Ruby Image - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout main repository - uses: actions/checkout@v3 - - - name: Set environment variables - run: | - cat .ortversions/ruby.versions >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - 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 base image - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository }}/ruby - tags: | - type=semver,pattern={{version}},value=${{ env.RUBY_VERSION }} - - - - name: Build ORT Ruby container - if: github.event_name == 'push' - uses: docker/build-push-action@v4 - with: - context: . - target: ruby - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - build-args: | - RUBY_VERSION=${{ env.RUBY_VERSION }} - COCOAPODS_VERSION=${{ env.COCOAPODS_VERSION }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository }}/ruby:latest - labels: ${{ steps.meta.outputs.labels }} - build-contexts: | - ort-base-image=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/base:latest - cache-from: type=gha,scope=ortruby - cache-to: type=gha,scope=ortruby,mode=max diff --git a/.github/workflows/docker-ort-runtime.yml b/.github/workflows/docker-ort-runtime.yml index 76e34226d2680..60e4bc31ccfb2 100644 --- a/.github/workflows/docker-ort-runtime.yml +++ b/.github/workflows/docker-ort-runtime.yml @@ -15,21 +15,18 @@ # SPDX-License-Identifier: Apache-2.0 # License-Filename: LICENSE -name: Runtime Image +name: MegaDocker Runtime Image on: workflow_dispatch: pull_request: - branches: - - main + paths: + - '.versions' push: branches: - main - workflow_run: - workflows: - - 'Golang Image' - types: - - completed + tags: + - '*' env: REGISTRY: ghcr.io @@ -37,7 +34,134 @@ env: permissions: write-all jobs: - build: + 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 + uses: ./.github/actions/ortdocker + with: + name: base + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.JAVA_VERSION }}-jdk-${{ env.UBUNTU_VERSION }}" + build-args: | + JAVA_VERSION=${{ env.JAVA_VERSION }} + UBUNTU_VERSION=${{ env.UBUNTU_VERSION }} + + nodejs_image: + name: NodeJS Image + needs: [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 NodeJS Image + uses: ./.github/actions/ortdocker + with: + name: nodejs + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.NODEJS_VERSION }}" + build-args: | + NODEJS_VERSION=${{ env.NODEJS_VERSION }} + NPM_VERSION=${{ env.NPM_VERSION }} + PNPM_VERSION=${{ env.PNPM_VERSION }} + YARN_VERSION=${{ env.YARN_VERSION }} + + python_image: + name: Python Image + needs: [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 Python Image + uses: ./.github/actions/ortdocker + with: + name: python + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.PYTHON_VERSION }}" + build-args: | + CONAN_VERSION=${{ env.CONAN_VERSION }} + PIPTOOL_VERSION=${{ env.PIPTOOL_VERSION }} + PYENV_GIT_TAG=${{ env.PYENV_GIT_TAG }} + PYTHON_INSPECTOR_VERSION=${{ env.PYTHON_INSPECTOR_VERSION }} + PYTHON_PIPENV_VERSION=${{ env.PYTHON_PIPENV_VERSION }} + PYTHON_POETRY_VERSION=${{ env.PYTHON_POETRY_VERSION }} + PYTHON_VERSION=${{ env.PYTHON_VERSION }} + SCANCODE_VERSION=${{ env.SCANCODE_VERSION }} + + rust_image: + name: Rust Image + needs: [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 Rust Image + uses: ./.github/actions/ortdocker + with: + name: rust + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.RUST_VERSION }}" + build-args: | + RUST_VERSION=${{ env.RUST_VERSION }} + + ruby_image: + name: Ruby Image + needs: [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 Ruby Image + uses: ./.github/actions/ortdocker + with: + name: ruby + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.RUBY_VERSION }}" + build-args: | + RUBY_VERSION=${{ env.RUBY_VERSION }} + COCOAPODS_VERSION=${{ env.COCOAPODS_VERSION }} + + golang_image: + name: Golang Image + needs: [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 Golang Image + uses: ./.github/actions/ortdocker + with: + name: golang + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.GO_VERSION }}" + build-args: | + GO_DEP_VERSION=${{ env.GO_DEP_VERSION }} + GO_VERSION=${{ env.GO_VERSION }} + + runtime_image: + needs: [base_image, nodejs_image, python_image, rust_image, ruby_image, golang_image] name: Build ORT runtime Image runs-on: ubuntu-22.04 permissions: @@ -72,11 +196,12 @@ jobs: type=raw,sha,enable=true,format=short - name: Build ORT runtime container + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} uses: docker/build-push-action@v4 with: context: . target: run - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + push: true load: false build-args: | NODEJS_VERSION=${{ env.NODEJS_VERSION }} diff --git a/.github/workflows/docker-ort-rust.yml b/.github/workflows/docker-ort-rust.yml deleted file mode 100644 index 654c122e36594..0000000000000 --- a/.github/workflows/docker-ort-rust.yml +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (C) 2023 The ORT Project Authors (see ) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# License-Filename: LICENSE - -name: Rust Image - -on: - workflow_dispatch: - push: - branches: - - main - pull_request: - paths: - - '.ortversions/rust.versions' - - '.github/workflows/docker-ort-base.yml' - workflow_run: - workflows: ["NodeJS Image"] - types: - - completed - -env: - REGISTRY: ghcr.io - -permissions: write-all - -jobs: - build: - name: Build ORT Rust Image - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout main repository - uses: actions/checkout@v3 - - - name: Set environment variables - run: | - cat .ortversions/rust.versions >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - 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 base image - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository }}/rust - tags: | - type=raw,value=${{ env.RUST_VERSION }} - - - - name: Build ORT Rust container - uses: docker/build-push-action@v4 - with: - context: . - target: rust - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - build-args: | - RUST_VERSION=${{ env.RUST_VERSION }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository }}/rust:latest - labels: ${{ steps.meta.outputs.labels }} - build-contexts: | - ort-base-image=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/base:latest - cache-from: type=gha,scope=ortrust - cache-to: type=gha,scope=ortrust,mode=max diff --git a/.ortversions/android.versions b/.ortversions/android.versions deleted file mode 100644 index 6a895889da72a..0000000000000 --- a/.ortversions/android.versions +++ /dev/null @@ -1 +0,0 @@ -ANDROID_CMD_VERSION=9477386 \ No newline at end of file diff --git a/.ortversions/base.versions b/.ortversions/base.versions deleted file mode 100644 index abc7cc3fac010..0000000000000 --- a/.ortversions/base.versions +++ /dev/null @@ -1,2 +0,0 @@ -JAVA_VERSION=17 -UBUNTU_VERSION=jammy diff --git a/.ortversions/dart.versions b/.ortversions/dart.versions deleted file mode 100644 index 31191f8ff697a..0000000000000 --- a/.ortversions/dart.versions +++ /dev/null @@ -1 +0,0 @@ -DART_VERSION=2.18.4 \ No newline at end of file diff --git a/.ortversions/dotnet.versions b/.ortversions/dotnet.versions deleted file mode 100644 index 29159cfc2b228..0000000000000 --- a/.ortversions/dotnet.versions +++ /dev/null @@ -1,2 +0,0 @@ -DOTNET_VERSION=6.0 -NUGET_INSPECTOR_VERSION=0.9.12 diff --git a/.ortversions/golang.versions b/.ortversions/golang.versions deleted file mode 100644 index 8625a6c84e258..0000000000000 --- a/.ortversions/golang.versions +++ /dev/null @@ -1,2 +0,0 @@ -GO_DEP_VERSION=0.5.4 -GO_VERSION=1.20.5 diff --git a/.ortversions/haskell.versions b/.ortversions/haskell.versions deleted file mode 100644 index 9e794390d449f..0000000000000 --- a/.ortversions/haskell.versions +++ /dev/null @@ -1 +0,0 @@ -HASKELL_STACK_VERSION=2.7.5 \ No newline at end of file diff --git a/.ortversions/nodejs.versions b/.ortversions/nodejs.versions deleted file mode 100644 index a278ab79d394e..0000000000000 --- a/.ortversions/nodejs.versions +++ /dev/null @@ -1,5 +0,0 @@ -BOWER_VERSION=1.8.12 -NODEJS_VERSION=18.17.1 -NPM_VERSION=8.15.1 -PNPM_VERSION=7.8.0 -YARN_VERSION=1.22.17 diff --git a/.ortversions/php.versions b/.ortversions/php.versions deleted file mode 100644 index 8114d4c2b7b06..0000000000000 --- a/.ortversions/php.versions +++ /dev/null @@ -1,2 +0,0 @@ -PHP_VERSION=8.1 -COMPOSER_VERSION=2.2 \ No newline at end of file diff --git a/.ortversions/python.versions b/.ortversions/python.versions deleted file mode 100644 index 35b83ed1ce6b0..0000000000000 --- a/.ortversions/python.versions +++ /dev/null @@ -1,8 +0,0 @@ -CONAN_VERSION=1.57.0 -PIPTOOL_VERSION=22.2.2 -PYENV_GIT_TAG=v2.3.25 -PYTHON_INSPECTOR_VERSION=0.9.8 -PYTHON_PIPENV_VERSION=2022.9.24 -PYTHON_POETRY_VERSION=1.6.1 -PYTHON_VERSION=3.10.13 -SCANCODE_VERSION=32.0.6 diff --git a/.ortversions/ruby.versions b/.ortversions/ruby.versions deleted file mode 100644 index 71b8026d9091e..0000000000000 --- a/.ortversions/ruby.versions +++ /dev/null @@ -1,2 +0,0 @@ -COCOAPODS_VERSION=1.11.2 -RUBY_VERSION=3.1.2 diff --git a/.ortversions/rust.versions b/.ortversions/rust.versions deleted file mode 100644 index 2e59451ab4622..0000000000000 --- a/.ortversions/rust.versions +++ /dev/null @@ -1 +0,0 @@ -RUST_VERSION=1.72.0 diff --git a/.ortversions/sbt.versions b/.ortversions/sbt.versions deleted file mode 100644 index 9e0c411cab528..0000000000000 --- a/.ortversions/sbt.versions +++ /dev/null @@ -1 +0,0 @@ -SBT_VERSION=1.6.1 diff --git a/.ortversions/swift.versions b/.ortversions/swift.versions deleted file mode 100644 index 46c2142b6fdb0..0000000000000 --- a/.ortversions/swift.versions +++ /dev/null @@ -1 +0,0 @@ -SWIFT_VERSION=5.8.1 diff --git a/.versions b/.versions new file mode 100644 index 0000000000000..41c33d6495d3e --- /dev/null +++ b/.versions @@ -0,0 +1,29 @@ +ANDROID_CMD_VERSION=9477386 +BOWER_VERSION=1.8.12 +COCOAPODS_VERSION=1.11.2 +COMPOSER_VERSION=2.2 +CONAN_VERSION=1.57.0 +DART_VERSION=2.18.4 +DOTNET_VERSION=6.0 +GO_DEP_VERSION=0.5.4 +GO_VERSION=1.20.5 +HASKELL_STACK_VERSION=2.7.5 +JAVA_VERSION=17 +NODEJS_VERSION=18.17.1 +NPM_VERSION=8.15.1 +NUGET_INSPECTOR_VERSION=0.9.12 +PHP_VERSION=8.1 +PIPTOOL_VERSION=22.2.2 +PNPM_VERSION=7.8.0 +PYENV_GIT_TAG=v2.3.25 +PYTHON_INSPECTOR_VERSION=0.9.8 +PYTHON_PIPENV_VERSION=2022.9.24 +PYTHON_POETRY_VERSION=1.6.1 +PYTHON_VERSION=3.10.13 +RUBY_VERSION=3.1.2 +RUST_VERSION=1.72.0 +SBT_VERSION=1.6.1 +SCANCODE_VERSION=32.0.6 +SWIFT_VERSION=5.8.1 +UBUNTU_VERSION=jammy +YARN_VERSION=1.22.17