Skip to content

[FEAT] [CLI] Make Hatchet Lite version configurable#3925

Merged
gregfurman merged 4 commits into
hatchet-dev:mainfrom
Ujjwal-Singh-20:Ujjwal-Singh-20_issue#3911
May 22, 2026
Merged

[FEAT] [CLI] Make Hatchet Lite version configurable#3925
gregfurman merged 4 commits into
hatchet-dev:mainfrom
Ujjwal-Singh-20:Ujjwal-Singh-20_issue#3911

Conversation

@Ujjwal-Singh-20

@Ujjwal-Singh-20 Ujjwal-Singh-20 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Description

This PR implements configurable image tags and pull policies for the hatchet server start command. It allows users to pin a specific version of the hatchet-lite image and control when the Docker daemon attempts to pull images from the registry.

Fixes #3911

Type of change

  • New feature (non-breaking change which adds functionality)
  • Refactor (non-breaking changes to code which doesn't change any behaviour)

What's Changed

  • Added PullPolicy enum (always, missing, never) to the Docker driver.
  • Implemented conditional image pulling logic that respects the specified policy for both Postgres and Hatchet Lite containers.
  • Parameterized the hatchet-lite image tag (defaults to latest).
  • Added --tag and --pull-policy CLI flags to the hatchet server start command.

added two new flags to hatchet server start: --tag (default "latest") to let users pin a specific hatchet-lite image version (e.g. --tag v0.83.1), and --pull-policy (default "always") which accepts "always", "missing", or "never" - aligned with Docker Compose pull_policy semantics.

The core change is a new pullImageWithPolicy() method in the Docker driver that replaces the two hardcoded ImagePull calls. With "never" it skips the pull entirely and errors if the image isnt local, with "missing" it checks ImageInspect first and only pulls if needed, and "always" preserves existing behavior. The hatchet-lite image name is now built dynamically from the tag instead of being hardcoded to :latest.
Copilot AI review requested due to automatic review settings May 15, 2026 14:54
@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

@Ujjwal-Singh-20 is attempting to deploy a commit to the Hatchet Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds configurable image tag and pull policy to the hatchet server start CLI command so users can pin the hatchet-lite image version and control Docker pull behavior.

Changes:

  • Introduces PullPolicy type (always, missing, never) plus WithImageTag/WithPullPolicy option setters and a shared pullImageWithPolicy helper in the Docker driver.
  • Adds --tag and --pull-policy flags to hatchet server start and threads them through startLocalServer.
  • Updates the no-profile bootstrap call site to pass the existing defaults (latest, always).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cmd/hatchet-cli/cli/internal/drivers/docker/hatchet_lite.go Adds PullPolicy enum, image tag/pull policy options, and centralized pull-with-policy logic used by both postgres and hatchet-lite container startup.
cmd/hatchet-cli/cli/server.go Adds --tag and --pull-policy flags, examples, and forwards them into the driver options.
cmd/hatchet-cli/cli/worker.go Updates the bootstrap path to pass the new default tag/pull-policy arguments to startLocalServer.

@promptless-for-oss

Copy link
Copy Markdown

Promptless prepared a documentation update related to this change.

Triggered by PR #3925

Updated the CLI reference documentation for hatchet server start to include the new --tag and --pull-policy flags with usage examples.

Review: Document CLI --tag and --pull-policy flags

@gregfurman gregfurman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice! Have left some comments. Lmk if you can address 😄

Comment on lines +39 to +47
const (
// PullPolicyAlways always pulls the image from the registry (default, existing behavior).
PullPolicyAlways PullPolicy = "always"
// PullPolicyMissing only pulls if the image is not already available locally.
PullPolicyMissing PullPolicy = "missing"
// PullPolicyNever never pulls; the image must already exist locally.
PullPolicyNever PullPolicy = "never"
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMO we can remove these comments. Perhaps just leave the original on PullPolicy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

}

// PullPolicy controls when Docker images are pulled, mirroring Docker Compose's pull_policy.
type PullPolicy string

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should PullPolicy be public?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry for overlooking that, it should not be public, since its only used internally within the docker package

func (d *DockerDriver) pullImageWithPolicy(ctx context.Context, imageName string, policy PullPolicy) error {
switch policy {
case PullPolicyNever:
// Verify the image exists locally.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we remove these comments? Would help tighten up the diff!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure

Comment thread cmd/hatchet-cli/cli/server.go Outdated

// startLocalServer starts a local Hatchet server and returns connection details
func startLocalServer(cmd *cobra.Command, profileName string, dashboardPort, grpcPort int, projectName string) (*ServerStartResult, error) {
func startLocalServer(cmd *cobra.Command, profileName string, dashboardPort, grpcPort int, projectName, tag, pullPolicy string) (*ServerStartResult, error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: function signature is getting quite long. Wdyt of passing in a struct here instead? Or perhaps instead replacing all of these with varadic HatchetLiteOpt fns?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

well second option will be better i think, refactored startLocalServer to use the variadic HatchetLiteOpt pattern. Its much cleaner now. Thanks for the tip

}
}

// pullImageWithPolicy pulls an image according to the specified pull policy.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

super-nit: don't think we need docs IMO -- this is a private + internal function unlikely to be used anywhere else in the codebase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Apologies for the over documentation, I was using some AI assistance to ensure the logic was clear but definitely went a bit overboard

updated the PR to address all of the feedback
@Ujjwal-Singh-20

Copy link
Copy Markdown
Contributor Author

Nice! Have left some comments. Lmk if you can address 😄

addressed, please check

@Ujjwal-Singh-20

Copy link
Copy Markdown
Contributor Author

@gregfurman Just checking back in whenever you get a moment to see if these changes look good to go

@gregfurman gregfurman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thanks for addressing my comments and nice job on your first contribution to Hatchet 🥳

@gregfurman gregfurman merged commit da6bfc0 into hatchet-dev:main May 22, 2026
35 of 37 checks passed
@Ujjwal-Singh-20

Copy link
Copy Markdown
Contributor Author

LGTM! Thanks for addressing my comments and nice job on your first contribution to Hatchet 🥳

Thank you so much, glad i could contribute

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.

[FEAT] [CLI] Make Hatchet Lite version configurable

4 participants