Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suffix one off context builder images with short git sha #1315

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nnarayen
Copy link
Contributor

@nnarayen nnarayen commented Jan 16, 2025

🚀 What

It's pretty easy to accidentally clobber existing context builder images:

  • Forget to update version here
  • Two people are iterating in parallel, and happen to use the same rcX identifier

This PR adds the git sha as a suffix to context builder images only for the one off jobs kicked off via github actions. Can see this successful job as an example.

New workflow:

  • No longer need to update project version for every new context builder version you're testing
  • In order to derive the image tag (for input into Billip, for instance), you can check build output or run
$ echo -n "$(poetry version | awk '{print $2}')-$(git rev-parse --short HEAD)" | pbcopy

Alternatives considered:

  • Tooling to add the sha suffix to the poetry managed version, but poetry is opinionated that it should resemble a semver, which isn't necessarily compatible with Docker image tag formats

💻 How

🔬 Testing

- name: Docker Build
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: ./context_builder.Dockerfile
push: true
tags: baseten/truss-context-builder:v${{ needs.detect-version.outputs.version }}
tags: baseten/truss-context-builder:v${{ needs.detect-version.outputs.version }}-${{ steps.git_sha.outputs.sha_short }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But does that mean that in order to point to that image, you need to add the SHA as well in the constance config override? That seems a bit cumbersome.

Can we instead reject overwrite of existing images, but not require extra version parts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants