Skip to content

Commit

Permalink
fixes to the build_image workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeofblue committed Nov 7, 2023
1 parent 09b01cf commit fd3f4ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,35 @@ 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 }}
- name: Fail on YAML tag mismatch
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 }}
4 changes: 2 additions & 2 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit fd3f4ed

Please sign in to comment.