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

[docker] Added fix to run image release on tags creation + backfill action #2118

Merged
merged 4 commits into from
Jun 5, 2024

Conversation

mohsenari
Copy link
Collaborator

@mohsenari mohsenari commented Jun 3, 2024

Summary

Github action for releasing docker images to dockerhub didn't run when we created a new tag (0.11.0) this fixes that issue.
Plus I added a new github action that can only be triggered manually. It takes inputs for tag/version name and releases docker image to dockerhub at that specific tag. This is to backfill older versions of devbox to dockerhub as well.

How was it tested?

Will have to be tested via github actions run on a tag creation. But backfill will be tested manually

Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

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

I'm a bit confused by this action. It doesn't seem like the version is added to the image at all? Is this just meant to refresh the latest image? (DEVBOX_USE_VERSION is not set, so it looks like no matter what the docker image will use the latest version)

Also, are the actions identical? You should just add workflow_dispatch to existing one and can have ref defaulted correctly.

on:
workflow_dispatch:
inputs:
myCommit:
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be called ref or tag

@mohsenari
Copy link
Collaborator Author

mohsenari commented Jun 4, 2024

I'm a bit confused by this action. It doesn't seem like the version is added to the image at all? Is this just meant to refresh the latest image? (DEVBOX_USE_VERSION is not set, so it looks like no matter what the docker image will use the latest version)

The repo checkout action checks out the code at the provided tag. But good point on not having DEVBOX_USE_VERSION I added that to the build args for dockerfile and the action. I tested the docker build locally to make sure it builds the provided version.

Also, are the actions identical? You should just add workflow_dispatch to existing one and can have ref defaulted correctly.

The actions are similar but not identical. Frankly, I don't know how I can branch the logic in a YAML file to do the current tag and update latest if inputs aren't provided. This action can be deleted once we successfully backfill the older devbox versions in dockerhub

@mikeland73

@mohsenari mohsenari requested a review from mikeland73 June 4, 2024 21:20
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

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

What I had in mind was something like 8543619

I'm still a bit confused about what we're doing with versions. Currently, every time a tag is pushed we publish a latest without a version. I guess this is fine (it basically helps update the launcher, etc)

This does mean we don't really need to "backfill" anything. We've never actually published individual tags. I think just adding workflow_dispatch to the existing job is probably enough.

For future thought:
Ideally we publish latest only for newest tag (there's a latest=auto on the docker meta action, but I'm not sure how it works). In addition we also publish each individual tag with the env variable. Ideally we also pre-install the binary on the docker image so it doesn't need to be installed after the container is initialized.

@@ -1,5 +1,8 @@
FROM debian:stable-slim

# Optional arg to install custom devbox version
ARG DEVBOX_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

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

Just name this DEVBOX_USE_VERSION. No need to use 2 different names.

@mohsenari mohsenari requested a review from mikeland73 June 5, 2024 19:27
@@ -1,5 +1,8 @@
FROM debian:stable-slim

# Optional arg to install custom devbox version
ARG DEVBOX_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@mohsenari mohsenari merged commit c74320c into main Jun 5, 2024
24 checks passed
@mohsenari mohsenari deleted the mohsen--docker-release-fix branch June 5, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants