Skip to content

main - e5_small_v2_v0001 #397

main - e5_small_v2_v0001

main - e5_small_v2_v0001 #397

Workflow file for this run

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 }}
permissions:
contents: read
env:
DENY_WARNINGS: false
runtime_name: ort
runtime_version: v1.15.1
frontoffice_archive: web-service-frontoffice
backoffice_archive: web-service-backoffice
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 backoffice artifact
uses: ./.github/actions/release_artifact
with:
platform: ${{ inputs.platform }}
bin_name: "ingestion"
archive_name: ${{ env.backoffice_archive }}
model_full_name: ${{ inputs.model_name }}_${{ inputs.model_version }}
runtime_full_name: ${{ env.runtime_name }}_${{ env.runtime_version }}
- name: Create frontoffice artifact
uses: ./.github/actions/release_artifact
with:
platform: ${{ inputs.platform }}
bin_name: "personalization"
archive_name: ${{ env.frontoffice_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
frontoffice_image_name="xaynetci/xayn_discovery_web_service:$TAG"
backoffice_image_name="xaynetci/xayn_discovery_ingestion_service:$TAG"
echo "frontoffice_image_name=$frontoffice_image_name" >> $GITHUB_ENV
echo "backoffice_image_name=$backoffice_image_name" >> $GITHUB_ENV
cat <<EOT >>${GITHUB_STEP_SUMMARY}
# Image names
Back-office: $frontoffice_image_name
Front-office: $backoffice_image_name
EOT
- name: Create backoffice docker image
uses: ./.github/actions/release_image
with:
archive_name: ${{ env.backoffice_archive }}
image_name: ${{ env.backoffice_image_name }}
platform: ${{ inputs.platform }}
- name: Create frontoffice docker image
uses: ./.github/actions/release_image
with:
archive_name: ${{ env.frontoffice_archive }}
image_name: ${{ env.frontoffice_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.frontoffice_image_name }}
docker push ${{ env.backoffice_image_name }}