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

Fix index info command with containerd content store #986

Merged

Conversation

austinvazquez
Copy link
Contributor

@austinvazquez austinvazquez commented Dec 8, 2023

Issue #, if available:
Fixes #983

Description of changes:
Previously SOCI CLI index info command would fail with context deadline exceeded error when the content store was set to containerd. The root cause was the default global duration for the app context is zero if not set. The result was Go context with an immediate deadline thus resulting in the error. The fix is to not set a deadline if no duration is provided.

Testing performed:
Before changes:

$ mysudo soci --content-store containerd index info sha256:8aad6c25d856dabc72284325e14dc5ea2df228c3fd6b5a96ab46854def73ea50
soci: context deadline exceeded
$ 

After changes:

$ mysudo soci --content-store containerd index info sha256:8aad6c25d856dabc72284325e14dc5ea2df228c3fd6b5a96ab46854def73ea50
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.amazon.soci.index.v1+json",
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "size": 2
  },
  "layers": [
    {
      "mediaType": "application/octet-stream",
      "digest": "sha256:d548f77fc4f9ad31bf390ccaab4c5ffa97f7319f921a3125e5d7daa865c0a8a1",
      "size": 1229704,
      "annotations": {
        "com.amazon.soci.image-layer-digest": "sha256:5e8117c0bd28aecad06f7e76d4d3b64734d59c1a0a44541d18060cd8fba30c50",
        "com.amazon.soci.image-layer-mediaType": "application/vnd.oci.image.layer.v1.tar+gzip"
      }
    }
  ],
  "subject": {
    "mediaType": "application/vnd.oci.image.manifest.v1+json",
    "digest": "sha256:149d67e29f765f4db62aa52161009e99e389544e25a8f43c8c89d4a445a7ca37",
    "size": 424
  },
  "annotations": {
    "com.amazon.soci.build-tool-identifier": "AWS SOCI CLI v0.1"
  }
}$ 

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Previously SOCI CLI index info command would fail with context deadline
exceeded error when the content store was set to containerd. The root
cause was the default global duration for the app context is zero if not
set. The result was Go context with an immediate deadline thus resulting
in the error. The fix is to not set a deadline if the duration is zero.

Signed-off-by: Austin Vazquez <[email protected]>
@austinvazquez austinvazquez force-pushed the fix-soci-index-info-containerd branch from c930445 to 78d77d6 Compare December 8, 2023 17:50
@austinvazquez austinvazquez marked this pull request as ready for review December 8, 2023 17:54
@austinvazquez austinvazquez requested a review from a team as a code owner December 8, 2023 17:54
@austinvazquez austinvazquez merged commit 7044591 into awslabs:main Dec 11, 2023
4 checks passed
@austinvazquez austinvazquez deleted the fix-soci-index-info-containerd branch December 11, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Unable to inspect a SOCI Index stored in the containerd content store with the SOCI CLI
3 participants