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

Add command pack manifest annotate to update information on manifest list #1718

Closed
1 task
Tracked by #294
jjbustamante opened this issue Apr 10, 2023 · 0 comments · Fixed by #1705
Closed
1 task
Tracked by #294

Add command pack manifest annotate to update information on manifest list #1718

jjbustamante opened this issue Apr 10, 2023 · 0 comments · Fixed by #1705
Labels
epic/multi-arch experimental Issue or PR refers to an experimental feature. good for mentorship A good issue for a mentorship project. type/enhancement Issue that requests a new feature or improvement.
Milestone

Comments

@jjbustamante
Copy link
Member

jjbustamante commented Apr 10, 2023

Context

We've been working on the idea to add multi-arch support on CNB. A mentorship project was created on LFX and this feature is part of the efforts to build the Minimal Viable Product (MVP) during the program duration.

More information can be found:

Description

When a manifest list is created using the pack manifest create command it will be saved in the local daemon, sometimes it is required to add the platform information os, architecture, or variant. A new command to modify a manifest list (Image index) and update the platform information for an image included in the manifest list.

Proposed solution

A new feature on Pack can be implemented to help our users. The feature is inspired by the similar functionality in docker or podman

pack manifest annotate [OPTIONS] <manifest-list> <manifest> 

Add additional information to a local image manifest

  options:
      --arch string           Set the architecture
      --os string              Set the operating system
      --variant string       Set the architecture variant

Example

Let's suppose we have a manifest list saved in the docker daemon with the following information

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "size": 940,
      "digest": "sha256:87a832fd6a8d6995d336c740eb6f3da015401a6e564fcbe95ee1bf37557a8225",
      "platform": {
        "architecture": "",
        "os": "linux"
      }
    },
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "size": 1148,
      "digest": "sha256:670d62fbee841d256a706801a03be9c84d37fc2cd6ef7538a7af9985c3d2ed8b",
      "platform": {
        "architecture": "",
        "os": "windows"
      }
    }
  ]
}

As we can see, the manifests included in this list do not have architecture defined.

Executing

 pack manifest annotate  --arch amd64 cnbs/sample-package:hello-multiarch-universe cnbs/sample-package:hello-universe

It should output:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "size": 940,
      "digest": "sha256:87a832fd6a8d6995d336c740eb6f3da015401a6e564fcbe95ee1bf37557a8225",
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    },
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "size": 1148,
      "digest": "sha256:670d62fbee841d256a706801a03be9c84d37fc2cd6ef7538a7af9985c3d2ed8b",
      "platform": {
        "architecture": "",
        "os": "windows"
      }
    }
  ]
}

Describe alternatives you've considered

Additional context

  • This feature should be documented somewhere
@jjbustamante jjbustamante added type/enhancement Issue that requests a new feature or improvement. status/triage Issue or PR that requires contributor attention. experimental Issue or PR refers to an experimental feature. good for mentorship A good issue for a mentorship project. labels Apr 10, 2023
@jjbustamante jjbustamante added status/in-progress Issue or PR that is currently in progress. and removed status/triage Issue or PR that requires contributor attention. labels Aug 15, 2023
@jjbustamante jjbustamante added this to the 0.31.0 milestone Aug 17, 2023
@jjbustamante jjbustamante modified the milestones: 0.32.0, 0.33.0 Oct 17, 2023
@natalieparellano natalieparellano modified the milestones: 0.33.0, 0.34.0 Dec 13, 2023
@jjbustamante jjbustamante modified the milestones: 0.34.0, 0.35.0 Mar 8, 2024
@jjbustamante jjbustamante modified the milestones: 0.35.0, 0.34.0 May 8, 2024
@jjbustamante jjbustamante removed the status/in-progress Issue or PR that is currently in progress. label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/multi-arch experimental Issue or PR refers to an experimental feature. good for mentorship A good issue for a mentorship project. type/enhancement Issue that requests a new feature or improvement.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants