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

Update ggcr to pick up estargz and caching option #1527

Merged
merged 1 commit into from
Dec 21, 2020

Conversation

mattmoor
Copy link
Collaborator

Description

This picks up the latest GGCR version, which enables the use of estargz, and exposes an option to reduce the number of times a layer is gzipped when pushing.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Support for pushing images in the estargz format can be enabled by setting GGCR_EXPERIMENT_ESTARGZ=1 when invoking the executor image.

@google-cla google-cla bot added the cla: yes CLA signed by all commit authors label Dec 18, 2020
@mattmoor mattmoor changed the title Update ggcr to pick up estargz and caching option [WIP] Update ggcr to pick up estargz and caching option Dec 18, 2020
@mattmoor
Copy link
Collaborator Author

Mostly publishing to test things through CI concurrently. I've got a GCB build running to publish a version of this that I hope to use to confirm that GGCR_EXPERIMENT_ESTARGZ=1 works as intended.

cc @jonjohnsonjr @imjasonh

@mattmoor
Copy link
Collaborator Author

Here's an image digest produced via kaniko (see the author bits):

crane config ghcr.io/mattmoor/dockerfile@sha256:edf3843878c7edbaf56ba666f7235e021e17ef0637b62a232ff39a1b60364c81 | jq .
{
  "architecture": "amd64",
  "container": "6cb7658787e77979d777b9725147ac992230ccc7426e678c918c3144e5ccb78e",
  "created": "2020-12-18T04:55:24.847978219Z",
  "docker_version": "19.03.12",
  "history": [
    {
      "created": "2020-12-17T00:19:41.960367136Z",
      "created_by": "/bin/sh -c #(nop) ADD file:ec475c2abb2d46435286b5ae5efacf5b50b1a9e3b6293b69db3c0172b5b9658b in / "
    },
    {
      "created": "2020-12-17T00:19:42.11518025Z",
      "created_by": "/bin/sh -c #(nop)  CMD [\"/bin/sh\"]",
      "empty_layer": true
    },
    {
      "author": "kaniko",
      "created": "0001-01-01T00:00:00Z",
      "created_by": "RUN apk add --no-cache ca-certificates"
    },
    {
      "author": "kaniko",
      "created": "0001-01-01T00:00:00Z",
      "created_by": "COPY --from=builder /app/server /server"
    }
  ],
  "os": "linux",
  "rootfs": {
    "type": "layers",
    "diff_ids": [
      "sha256:777b2c648970480f50f5b4d0af8f9a8ea798eea43dbcf40ce4a8c7118736bdcf",
      "sha256:a32893c5c3db9078b13c534bc22b2278355d275345af8e795651d1189566f358",
      "sha256:10c69bcda35844f13b124498bd3fd089837714322ad58caac8ac1053a2c89439"
    ]
  },
  "config": {
    "Cmd": [
      "/server"
    ],
    "Env": [
      "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    ],
    "Image": "sha256:174c398109132a9b2fc879f752eeef1b25528a04b514a1e3ff1b5085bcf28f51"
  }
}

You can see the estargz annotations on the resulting image:

crane manifest ghcr.io/mattmoor/dockerfile@sha256:edf3843878c7edbaf56ba666f7235e021e17ef0637b62a232ff39a1b60364c81 | jq .
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "size": 1136,
    "digest": "sha256:576aeb9a1a78f79cd3b928fe3bd36b77e6f04f78da90ae5dcf475808ada15a4a"
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 2799066,
      "digest": "sha256:801bfaa63ef2094d770c809815b9e2b9c1194728e5e754ef7bc764030e140cea"
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 361391,
      "digest": "sha256:b60909e76edb58fd35a7e8b4503b70f3fe2e22a7e14aba025c3e929780e2974a",
      "annotations": {
        "containerd.io/snapshot/stargz/toc.digest": "sha256:da7bb79ef9033ee07b6be04052f6f983b9b71417b0e5de8a5d136e32dc3c4928"
      }
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 4136054,
      "digest": "sha256:18e416a532724bb32f92af8db60522ad01c4c847bd0005d5edfc0657de1463e8",
      "annotations": {
        "containerd.io/snapshot/stargz/toc.digest": "sha256:be824f6557ed9fc23e2c0b3c0910477d7a9c9e10113875b819047dccb8dceec3"
      }
    }
  ]
}

@mattmoor mattmoor changed the title [WIP] Update ggcr to pick up estargz and caching option Update ggcr to pick up estargz and caching option Dec 18, 2020
@mattmoor
Copy link
Collaborator Author

@jonjohnsonjr @tejal29 it looks like the wrong travis presubmit is marked as required 🤔

@mattmoor
Copy link
Collaborator Author

cc @ktock @AkihiroSuda FYI

Copy link
Contributor

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

👍

Copy link

@ktock ktock left a comment

Choose a reason for hiding this comment

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

Thanks!

@jonjohnsonjr
Copy link
Contributor

it looks like the wrong travis presubmit is marked as required

re-swizzled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants