community icon indicating copy to clipboard operation
community copied to clipboard

worker: init step should output image digests instead of (or in addition to) image IDs

Open GregoryDosh opened this issue 3 years ago • 0 comments

Description

If an end user ever wants to pull the same image used by the Vela workers on their local machine for debugging purposes, then the image ID output during the init step isn't very useful. The digest sha is what is actually used for pulling images and pinning to specific SHAs.

Example

Screen Shot 2022-02-15 at 8 23 40 AM

$ docker image inspect target/vela-git:v0.5.1
sha256:f951fe5470663c0676d249d0084dbe3f6aa3e779bca54962844e8135dd8ecc98

If trying to use that SHA locally...

docker run -it --rm -v $(pwd):$(pwd) -w $(pwd) --entrypoint sh target/vela-git:v0.5.1@sha256:f951fe5470663c0676d249d0084dbe3f6aa3e779bca54962844e8135dd8ecc98
Unable to find image 'target/vela-git:v0.5.1@sha256:f951fe5470663c0676d249d0084dbe3f6aa3e779bca54962844e8135dd8ecc98' locally
docker: Error response from daemon: received unexpected HTTP status: 500 Internal Server Error.

If I manually pull that latest image, and inspect it I see ....

docker image inspect target/vela-git:v0.5.1
[
    {
        "Id": "sha256:f951fe5470663c0676d249d0084dbe3f6aa3e779bca54962844e8135dd8ecc98",
        "RepoTags": [
            "target/vela-git:v0.5.1"
        ],
        "RepoDigests": [
            "target/vela-git@sha256:f349bfe5c9f382393d897534e61357a3ef8d5a6f7524e02bd0cef5def5c35a9d"
        ],
 ...

And if I use the Digest instead....

docker run-pwd --entrypoint sh target/vela-git@sha256:f349bfe5c9f382393d897534e61357a3ef8d5a6f7524e02bd0cef5def5c35a9d
docker run -it --rm -v $(pwd):$(pwd) -w $(pwd) --entrypoint sh target/vela-git@sha256:f349bfe5c9f382393d897534e61357a3ef8d5a6f7524e02bd0cef5def5c35a9d
/Users/USERNAME/SOME/PATH #

Value

This is an important debugging step and is commonly skipped by end users when diagnosing why their pipelines are failing. And, as someone who helps end users debug I also have to manually pull and inspect to find the correct digest to use to mimic the same environment the Vela worker is using.

Definition of Done

The image digest is also displayed during the init step.

Effort (Optional)

Impacted Personas (Optional)

GregoryDosh avatar Feb 15 '22 14:02 GregoryDosh