Skip to content

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

@gregfurman

Description

@gregfurman

Is your feature request related to a problem? Please describe.

When running hatchet server start, we hardcode this to always pull the latest image of hatchet-lite

func (d *DockerDriver) startHatchetLiteContainer(ctx context.Context, opts *HatchetLiteOpts, networkId string, dashboardPort, grpcPort int, sharedLabels map[string]string) error {
imageName := "ghcr.io/hatchet-dev/hatchet/hatchet-lite:latest"
containerName := canonicalContainerName(opts.projectName, opts.hatchetName)
out, err := d.apiClient.ImagePull(ctx, imageName, image.PullOptions{})
if err != nil {
return fmt.Errorf("could not pull image %s: %w", imageName, err)
}

While ensuring that the latest version of hatchet lite (and therefore the engine and api server) is always pulled and run, the approach has several issues:

  1. Airgapped environments (i.e without access to ghcr.io) cannot take advantage of pre-existing hatchet-lite images already available.

  2. Forced upgrades to a later version of hatchet occur regardless of whether current infrastructure/application logic caters for this. For example, what if I am running an older version of the SDK with functionality that has been removed in the latest version of hatchet?

  3. A supply chain attack means a malicious version getting published will automatically be pulled in by all users starting a hatchet instance via hatchet server start

Describe the solution you'd like

Allow the hatchet version to be overridable via config or a flag i.e

hatchet server --tag v0.83.1 start

In addition, we could include a flag to skip an ImagePull call. I think it'd be easiest to align this approach with docker compose's pull_policy (see https://docs.docker.com/reference/compose-file/services/#pull_policy) (i.e always, never, missing)

hatchet server --pull-policy "missing" start

Or perhaps prompt a user to agree that a new version of hatchet is going to be pulled in.

Describe alternatives you've considered

This can be worked around with docker compose and specifying the exact image we want to use, but that defeats the purpose of the (more convienient) hatchet CLI on offer.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions