fix_release_build - xaynia_v0201 (arm64) #407
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Web Service Release | |
on: | |
workflow_dispatch: | |
inputs: | |
model_name: | |
description: Name of the model | |
type: string | |
default: xaynia | |
required: true | |
model_version: | |
description: Version of the model | |
type: string | |
default: v0201 | |
required: true | |
platform: | |
description: Platform to build the image for | |
type: choice | |
options: | |
- arm64 | |
- amd64 | |
default: arm64 | |
required: true | |
tag: | |
description: > | |
A tag for image identification. This override the default. | |
Default is <branch>-<timestamp>-<commit hash>-<model_name>_<model_version>-<platform>. | |
Step 'Images name' will print the name of the generated images. | |
type: string | |
required: false | |
run-name: ${{ github.ref_name }} - ${{ inputs.model_name }}_${{ inputs.model_version }} (${{ inputs.platform }}) | |
permissions: | |
contents: read | |
env: | |
DENY_WARNINGS: false | |
runtime_name: ort | |
runtime_version: v1.15.1 | |
web_api_archive: web-service-api | |
jobs: | |
services-build: | |
runs-on: hetzner-pm | |
container: | |
image: xaynetci/yellow:v15 | |
timeout-minutes: 30 | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Set up aarch64 environment | |
if: inputs.platform == 'arm64' | |
shell: bash | |
run: | | |
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0 | |
with: | |
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }} | |
aws-region: eu-central-1 | |
- name: Setup the CI. | |
uses: ./.github/actions/setup-job-docker | |
- name: Download assets | |
run: just download-assets \ | |
${{ inputs.model_name }} ${{ inputs.model_version }} \ | |
${{ env.runtime_name }} ${{ env.runtime_version }} | |
- name: Create web-api artifact | |
uses: ./.github/actions/release_artifact | |
with: | |
platform: ${{ inputs.platform }} | |
bin_name: "web-api" | |
archive_name: ${{ env.web_api_archive }} | |
model_full_name: ${{ inputs.model_name }}_${{ inputs.model_version }} | |
runtime_full_name: ${{ env.runtime_name }}_${{ env.runtime_version }} | |
docker-build: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 20 | |
needs: services-build | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0 | |
- name: Set up QEMU | |
if: inputs.platform == 'arm64' | |
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0 | |
with: | |
platforms: ${{ inputs.platform }} | |
- name: Image names | |
run: | | |
TAG=${{ github.event.inputs.tag }} | |
if [ -z "$TAG" ]; then | |
TAG="$(git rev-parse --abbrev-ref HEAD)" | |
TAG="$TAG-$(date +"%y%m%d%H%M%S")" | |
TAG="$TAG-$(git rev-parse --short HEAD)" | |
TAG="$TAG-${{ inputs.model_name }}_${{ inputs.model_version }}" | |
TAG="$TAG-${{ inputs.platform }}" | |
fi | |
webapi_image_name="xaynetci/xayn_discovery_web_service:$TAG" | |
echo "webapi_image_name=$webapi_image_name" >> $GITHUB_ENV | |
cat <<EOT >>${GITHUB_STEP_SUMMARY} | |
# Image names | |
WebApi: $webapi_image_name | |
EOT | |
- name: Create web API docker image | |
uses: ./.github/actions/release_image | |
with: | |
archive_name: ${{ env.web_api_archive }} | |
image_name: ${{ env.webapi_image_name }} | |
platform: ${{ inputs.platform }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
with: | |
username: "${{ secrets.DOCKERHUB_USERNAME }}" | |
password: "${{ secrets.DOCKERHUB_TOKEN }}" | |
- name: Push images | |
run: | | |
set -eux | |
docker push ${{ env.webapi_image_name }} |