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:
-
Airgapped environments (i.e without access to ghcr.io) cannot take advantage of pre-existing hatchet-lite images already available.
-
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?
-
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
Is your feature request related to a problem? Please describe.
When running
hatchet server start, we hardcode this to always pull thelatestimage ofhatchet-litehatchet/cmd/hatchet-cli/cli/internal/drivers/docker/hatchet_lite.go
Lines 358 to 365 in df93e74
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:
Airgapped environments (i.e without access to
ghcr.io) cannot take advantage of pre-existinghatchet-liteimages already available.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?
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 startDescribe the solution you'd like
Allow the hatchet version to be overridable via config or a flag i.e
In addition, we could include a flag to skip an
ImagePullcall. I think it'd be easiest to align this approach with docker compose'spull_policy(see https://docs.docker.com/reference/compose-file/services/#pull_policy) (i.ealways,never,missing)hatchet server --pull-policy "missing" startOr 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