Skip to content

Workflow file for this run

name: Build the GVMI image
on:
push:
workflow_dispatch:
inputs:
is_test_build:
description: Whether this build is a test build.
required: true
type: boolean
jobs:
image_test:
name: Build the image
runs-on: [goth2]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: Gr1N/setup-poetry@v8
- name: Install requirements
run: poetry install --no-ansi
- name: Get Ray-On-Golem version
run: echo "::set-output name=version::$(poetry version | sed 's/ray-on-golem //')"
id: ray_on_golem_version
- name: Get Ray version
run: echo "::set-output name=version::$(poetry run pip freeze | grep 'ray==' | sed 's/ray==//')"
id: ray_version
- name: Set image version
run: echo "::set-output name=version::${{ steps.ray_on_golem_version.outputs.version }}-py${{ vars.PYTHON_VERSION }}-ray${{ steps.ray_version.outputs.version }}"
id: image_version
- name: Build the image
run: docker build -t ray-on-golem:${{ steps.image_version.outputs.version }} --build-arg="PYTHON_VERSION=${{ vars.PYTHON_VERSION }}" .
- run: ls -alh .
- run: df -h
- name: Convert the image
run: gvmkit-build ray-on-golem:${{ steps.image_version.outputs.version }}
- name: Is test build?
run: echo "${{ inputs.is_test_build }}"
- name: Get YAML image tag
run: echo "::set-output name=tag::$(poetry run yaml-get -p provider.parameters.node_config.demand.image_tag golem-cluster-dev.yaml)"
id: yaml_image_tag
- name: Set pushed image tag
run: echo "::set-output name=tag::${{ vars.REGISTRY_TEST_REPOSITORY }}:${{ steps.image_version.outputs.version }}"
id: pushed_image_tag
- name: Test
run: echo ${{ steps.pushed_image_tag.outputs.tag }} VS ${{ steps.yaml_image_tag.outputs.tag }}
- name: Fail on YAML tag mismatch
run: exit 1
if:
${{ steps.yaml_image_tag.outputs.tag != steps.pushed_image_tag.outputs.tag }}
- name: Push the image
run: REGISTRY_USER=${{ secrets.REGISTRY_TEST_USER }} REGISTRY_TOKEN=${{ secrets.REGISTRY_TEST_TOKEN }} poetry run gvmkit-build ray-on-golem:${{ steps.image_version.outputs.version }} --push-to ${{ steps.pushed_image_tag.outputs.tag }}