From fd3f4ed4c698b77c740087b6e6827247489422aa Mon Sep 17 00:00:00 2001 From: shadeofblue Date: Mon, 6 Nov 2023 17:49:33 +0100 Subject: [PATCH] fixes to the `build_image` workflow --- .github/workflows/build_image.yml | 22 +++++++++------------- .github/workflows/build_publish.yml | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 02bb5c35..e79325bc 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -39,28 +39,25 @@ jobs: - 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 + run: echo "RAY_ON_GOLEM_VERSION=$(poetry version | sed 's/ray-on-golem //')" >> $GITHUB_ENV - name: Get Ray version - run: echo "::set-output name=version::$(poetry run pip freeze | grep 'ray==' | sed 's/ray==//')" - id: ray_version + run: echo "RAY_VERSION=$(poetry run pip freeze | grep 'ray==' | sed 's/ray==//')" >> $GITHUB_ENV - name: Set image version - run: echo "::set-output name=version::${{ steps.ray_on_golem_version.outputs.version }}-py${{ inputs.IMAGE_PYTHON_VERSION }}-ray${{ steps.ray_version.outputs.version }}" - id: image_version + run: echo "IMAGE_VERSION=${{ env.RAY_ON_GOLEM_VERSION }}-py${{ inputs.IMAGE_PYTHON_VERSION }}-ray${{ env.RAY_VERSION }}" >> $GITHUB_ENV - name: Build DEV cluster config file run: poetry run poe dev_yaml if: ${{ inputs.IS_TEST_BUILD }} - name: Get DEV YAML image tag - run: echo "YAML_IMAGE_TAG=$(poetry run yaml-get -p provider.parameters.node_config.demand.image_tag golem-cluster.dev.yaml)" + run: echo "YAML_IMAGE_TAG=$(poetry run yaml-get -p provider.parameters.node_config.demand.image_tag golem-cluster.dev.yaml)" >> $GITHUB_ENV if: ${{ inputs.IS_TEST_BUILD }} - name: Get Production YAML image tag - run: echo "YAML_IMAGE_TAG=$(poetry run yaml-get -p provider.parameters.node_config.demand.image_tag golem-cluster.yaml)" + run: echo "YAML_IMAGE_TAG=$(poetry run yaml-get -p provider.parameters.node_config.demand.image_tag golem-cluster.yaml)" >> $GITHUB_ENV if: ${{ ! inputs.IS_TEST_BUILD }} - name: Set YAML image tag run: echo "::set-output name=tag::${{ env.YAML_IMAGE_TAG }}" id: yaml_image_tag - name: Set pushed image tag - run: echo "::set-output name=tag::${{ inputs.REGISTRY_REPOSITORY }}:${{ steps.image_version.outputs.version }}" + run: echo "::set-output name=tag::${{ inputs.REGISTRY_REPOSITORY }}:${{ env.IMAGE_VERSION }}" id: pushed_image_tag - name: Test run: echo ${{ steps.pushed_image_tag.outputs.tag }} VS ${{ steps.yaml_image_tag.outputs.tag }} @@ -68,10 +65,9 @@ jobs: run: exit 1 if: ${{ steps.yaml_image_tag.outputs.tag != steps.pushed_image_tag.outputs.tag }} - - name: Build the image - run: docker build -t ray-on-golem:${{ steps.image_version.outputs.version }} --build-arg="PYTHON_VERSION=${{ inputs.IMAGE_PYTHON_VERSION }}" . + run: docker build -t ray-on-golem:${{ env.IMAGE_VERSION }} --build-arg="PYTHON_VERSION=${{ inputs.IMAGE_PYTHON_VERSION }}" . - name: Convert the image - run: gvmkit-build ray-on-golem:${{ steps.image_version.outputs.version }} + run: gvmkit-build ray-on-golem:${{ env.IMAGE_VERSION }} - name: Push the image - run: REGISTRY_USER=${{ secrets.REGISTRY_USER }} REGISTRY_TOKEN=${{ secrets.REGISTRY_TOKEN }} poetry run gvmkit-build ray-on-golem:${{ steps.image_version.outputs.version }} --push-to ${{ steps.pushed_image_tag.outputs.tag }} + run: REGISTRY_USER=${{ secrets.REGISTRY_USER }} REGISTRY_TOKEN=${{ secrets.REGISTRY_TOKEN }} poetry run gvmkit-build ray-on-golem:${{ env.IMAGE_VERSION }} --push-to ${{ steps.pushed_image_tag.outputs.tag }} diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index 78efeeb8..3cb63cc4 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -18,8 +18,8 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION}} - - uses: Gr1N/setup-poetry@v8 - - run: poetry install +# - uses: Gr1N/setup-poetry@v8 +# - run: poetry install test_image: needs: [release_test]