Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Show container image manifest for pods #2695

Closed
wants to merge 6 commits into from

Conversation

mklanjsek
Copy link
Contributor

Added two new fields to Pod Container section: Image Manifest and Image Configuration as shown here in partially expanded state:

Screen Shot 2021-07-29 at 10 11 19 AM

The output for these two fields is generated by containers\image go library, same library used for containers\skopeo tool. Image Manifest corresponds to output of following skopeo command:
skopeo inspect --raw docker://nginx:1.16.1

Image configuration is showing image configuration based on current OS, similar to output of:
skopeo inspect --config --override-os linux docker://alpine:3.14.0

Note that for Mac library only supports linux OS setting, so it has to be set manually to override the OS value.

Tested only on Mac, need help testing it on other operating systems.

Signed-off-by: Milan Klanjsek mklanjsek@pivotal.io

@karayim
Copy link

karayim commented Jul 29, 2021

The green looks much better in the dark mode. Thanks for taking a look at it!

@wwitzel3
Copy link
Contributor

I'm worried about the dependencies here, specifically with building for Windows and in our CI pipeline. I don't have any answers. We can probably get this building under ubuntu by adding a call to sudo apt-get install libbtrfs or something on those lines.

Unsure about Mac and Windows.

@mklanjsek mklanjsek force-pushed the manifest-official branch 6 times, most recently from 9d7ac68 to 289e8a6 Compare July 30, 2021 20:53
@mklanjsek
Copy link
Contributor Author

mklanjsek commented Jul 30, 2021

After adding additional tags to all go build commands (-tags exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp) everything is working except the verification of generated code. Looks like the go generate is behaving differently in terms how tags are passed in. That's the only operation that's executed from.sh script, so that may play role in that particular failure.

Additionally, windows tests were failing due to inability to locate windows alpine and nginx images. Temporarily fixed that by always overriding OS to linux. Not sure that's the right thing to do, we need to discuss that and do more testing on Windows.

@wwitzel3
Copy link
Contributor

If we want to use thing library, we are going to have to do some work upstream to support Windows. As mentioned in the issue, currently Windows just has stubs for the methods.

containers/storage#503 (comment)

@wwitzel3
Copy link
Contributor

I think at this point we may want to see if there are any library alternatives that get us what we need across platforms or look in to how much of a lift it is to get this working correctly on Windows.

@wwitzel3
Copy link
Contributor

wwitzel3 commented Jul 31, 2021

@wwitzel3
Copy link
Contributor

Did some more investigating after @mklanjsek pointed out the issue in question, that code path wasn't being called with his use of the the library and so this should all be working under Windows.

Found that configuring mingw64 and the appropriate deps using MSYS resulting in a successful compilation under Windows.

I think for our windows build, we can add https://github.com/marketplace/actions/install-mingw

We will want to configure the Windows job with on of the extra actions below

@wwitzel3
Copy link
Contributor

Let's roll back the always use Linux commit and then we can start tweaking the Windows workflow to get it passing.

@wwitzel3
Copy link
Contributor

For the verify generated code, add - run: sudo apt-get update && sudo apt install -y libgpgme-dev libassuan-dev libdevmapper-dev btrfs-progs-devel as a step to https://github.com/vmware-tanzu/octant/blob/5163d0f17f41f99b8f8a72de936224998228aabd/.github/workflows/verify-generated.yaml#L16

Should fix that up.

Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>

Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>
Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>
Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>
Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>
Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>
Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>
sections.Add("Image Manifest", component.NewJSONEditor(manifest, true))
sections.Add("Image Configuration", component.NewJSONEditor(configuration, true))
} else {
sections.Add("Image Manifest", component.NewText(fmt.Sprintf("Unable to load image manifest %s", err)))
Copy link
Contributor

Choose a reason for hiding this comment

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

The error shown in the UI is hard to read when all the errors from the error chain are concatenated together.
An easy way to reproduce this is to kill the internet before caching and see the error in the pod summary.
It shows something like:
Unable to load image manifest error creating image source for image docker://nginx:1.14.2: pinging container registry registry-1.docker.io: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: no such host.
The error from https://github.com/vmware-tanzu/octant/pull/2695/files#diff-85fedc5e144e89139dc0296c0fb2574d2576d493b8bad648bd79c31d32dbd73bR63 and others in the manifest.go and any subsequent errors can be formatted a little better with some delimiters.

Copy link
Contributor

Choose a reason for hiding this comment

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

This change is not a huge blocker and can be made afterwards.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show image manifest for containers
4 participants