Skip to content

Commit

Permalink
Use an explicit server image tag when provided (#484)
Browse files Browse the repository at this point in the history
## What was changed

When running against a provided docker image we now use the _explicit_ image tag I've embedded in our artifacts rather than `latest`.

## Why?

While adding feature tests to our [builds repo](temporalio/docker-builds#200) I discovered that running `latest` doesn't always run the actual image we've loaded. It seems to be running the latest version we've pushed to dockerhub rather than the locally tagged `latest` version.

If this is true (it's what my testing indicates), then we aren't testing the image we think we are in the server's CI. This will fix that, however
  • Loading branch information
tdeebswihart authored May 21, 2024
1 parent e1d330d commit da4604c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ jobs:
run: docker load --input /tmp/server-docker/temporal-autosetup.tar
working-directory: '.'

- name: Override IMAGE_TAG environment variable
if: ${{ inputs.docker-image-artifact-name }}
run: |
image_tag=latest
# image_tag won't exist on older builds (like 1.22.0), so default to latest
if [ -f /tmp/server-docker/image_tag ]; then
image_tag=$(cat /tmp/server-docker/image_tag)
fi
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_ENV
working-directory: '.'

- name: Checkout SDK features repo
uses: actions/checkout@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ jobs:
run: docker load --input /tmp/server-docker/temporal-autosetup.tar
working-directory: '.'

- name: Override IMAGE_TAG environment variable
if: ${{ inputs.docker-image-artifact-name }}
run: |
image_tag=latest
# image_tag won't exist on older builds (like 1.22.0), so default to latest
if [ -f /tmp/server-docker/image_tag ]; then
image_tag=$(cat /tmp/server-docker/image_tag)
fi
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_ENV
working-directory: '.'

- name: Checkout SDK features repo
uses: actions/checkout@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ jobs:
run: docker load --input /tmp/server-docker/temporal-autosetup.tar
working-directory: '.'

- name: Override IMAGE_TAG environment variable
if: ${{ inputs.docker-image-artifact-name }}
run: |
image_tag=latest
# image_tag won't exist on older builds (like 1.22.0), so default to latest
if [ -f /tmp/server-docker/image_tag ]; then
image_tag=$(cat /tmp/server-docker/image_tag)
fi
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_ENV
working-directory: '.'

- name: Checkout SDK features repo
uses: actions/checkout@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ jobs:
run: docker load --input /tmp/server-docker/temporal-autosetup.tar
working-directory: '.'

- name: Override IMAGE_TAG environment variable
if: ${{ inputs.docker-image-artifact-name }}
run: |
image_tag=latest
# image_tag won't exist on older builds (like 1.22.0), so default to latest
if [ -f /tmp/server-docker/image_tag ]; then
image_tag=$(cat /tmp/server-docker/image_tag)
fi
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_ENV
working-directory: '.'

- name: Checkout SDK features repo
uses: actions/checkout@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/typescript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ jobs:
run: docker load --input /tmp/server-docker/temporal-autosetup.tar
working-directory: '.'

- name: Override IMAGE_TAG environment variable
if: ${{ inputs.docker-image-artifact-name }}
run: |
image_tag=latest
# image_tag won't exist on older builds (like 1.22.0), so default to latest
if [ -f /tmp/server-docker/image_tag ]; then
image_tag=$(cat /tmp/server-docker/image_tag)
fi
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_ENV
working-directory: '.'

- name: Checkout SDK features repo
uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/docker-compose.for-server-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: '3.5'

services:
temporal-server:
image: temporaliotest/auto-setup:latest
image: temporaliotest/auto-setup:${IMAGE_TAG:-latest}
environment:
- CASSANDRA_SEEDS=cassandra
- ENABLE_ES=true
Expand Down

0 comments on commit da4604c

Please sign in to comment.