Open digger18 opened 4 years ago
porter publish
is not working as well:
$ porter publish
Pushing CNAB invocation image...
The push refers to repository [gcr.io/rec-repo/infra-install-cnab-installer]
ec03c7172184: Preparing
49cb89f64712: Preparing
65b8f8742880: Preparing
7ff5a03c4b77: Preparing
219410cd4347: Preparing
90ca8ca0957c: Preparing
8e7363b9dcd4: Preparing
9b7657a76455: Preparing
4e38024e7e09: Preparing
8e7363b9dcd4: Waiting
9b7657a76455: Waiting
4e38024e7e09: Waiting
90ca8ca0957c: Waiting
7ff5a03c4b77: Layer already exists
65b8f8742880: Layer already exists
ec03c7172184: Layer already exists
49cb89f64712: Layer already exists
219410cd4347: Layer already exists
4e38024e7e09: Layer already exists
8e7363b9dcd4: Layer already exists
90ca8ca0957c: Layer already exists
9b7657a76455: Layer already exists
1.1.4: digest: sha256:f38bc637d97e47762c8625069a12ba2380e3164eed0b3a6bba6f6e5b129080c6 size: 2214
Rewriting CNAB bundle.json...
Starting to copy image gcr.io/rec-repo/infra-install-cnab-installer:1.1.4...
Completed image gcr.io/rec-repo/infra-install-cnab-installer:1.1.4 copy
Starting to copy image chartmuseum/chartmuseum:v0.11.0...
Completed image chartmuseum/chartmuseum:v0.11.0 copy
Starting to copy image quay.io/coreos/prometheus-config-reloader:v0.31.1...
Failed to copy image quay.io/coreos/prometheus-config-reloader:v0.31.1: failed commit on ref "unknown-sha256:5e508e2e0aba161359caad284b6974fa11119a55c2d5786d024ad32cffc61634": unexpected status: 400 Bad Request
Error: failed commit on ref "unknown-sha256:5e508e2e0aba161359caad284b6974fa11119a55c2d5786d024ad32cffc61634": unexpected status: 400 Bad Request
Thanks for the issue @digger18 . Alas, last we checked, Quay isn't a CNAB-compatible registry. This unfortunately means that these errors are currently expected.
An issue around improving Porter's UX in this area is currently being tracked in https://github.com/deislabs/porter/issues/822.
Thanks for the issue @digger18 . Alas, last we checked, Quay isn't a CNAB-compatible registry. This unfortunately means that these errors are currently expected.
An issue around improving Porter's UX in this area is currently being tracked in #822.
I am not trying to push to quay.io, just pull images from it. Is it still not compatible just for pulls?
May I suggest taking a look at this PR for go-containerregistry: https://github.com/google/go-containerregistry/pull/408 which should fix this issue, I assume that Porter uses go-containerregistry under the hood?
Ah, I see. Thank you for the PR link. Porter is currently on the following commit of go-containerregistry from Oct 15, '19: https://github.com/google/go-containerregistry/commit/71da34e4d9b3b67878449570720ad1d66466345b ... which appears to be more recent than the commit in https://github.com/google/go-containerregistry/pull/408, so I'm assuming we have that particular change as well.
I'm also intrigued by the error from porter publish
: failed commit on ref "unknown-sha256:5e508e2...
This is also a new error to me. Will see what I can find.
Another strange error while publishing to a local docker registry v2:
$ porter publish --tag localhost:5000/rec-repo/infra-install-cnab-installer:1.1.6 --debug
DEBUG name: arm
DEBUG pkgDir: /root/.porter/mixins/arm
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/arm/arm version --output json --debug
DEBUG name: aws
DEBUG pkgDir: /root/.porter/mixins/aws
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/aws/aws version --output json --debug
DEBUG name: az
DEBUG pkgDir: /root/.porter/mixins/az
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/az/az version --output json --debug
DEBUG name: exec
DEBUG pkgDir: /root/.porter/mixins/exec
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/exec/exec version --output json --debug
DEBUG name: gcloud
DEBUG pkgDir: /root/.porter/mixins/gcloud
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/gcloud/gcloud version --output json --debug
DEBUG name: helm
DEBUG pkgDir: /root/.porter/mixins/helm
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/helm/helm version --output json --debug
DEBUG name: kubernetes
DEBUG pkgDir: /root/.porter/mixins/kubernetes
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/kubernetes/kubernetes version --output json --debug
DEBUG name: terraform
DEBUG pkgDir: /root/.porter/mixins/terraform
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/terraform/terraform version --output json --debug
Building bundle ===>
Running linters for each mixin used in the manifest...
not all mixins responded successfully: 1 error occurred:
* error encountered from mixin "helm": exit status 1
Copying porter runtime ===>
Copying mixins ===>
Copying mixin exec ===>
Copying mixin helm ===>
Generating Dockerfile =======>
DEBUG name: helm
DEBUG pkgDir: /root/.porter/mixins/helm
DEBUG file:
DEBUG stdin:
actions:
install: []
uninstall: []
upgrade: []
/root/.porter/mixins/helm/helm build --debug
DEBUG name: exec
DEBUG pkgDir: /root/.porter/mixins/exec
DEBUG file:
DEBUG stdin:
actions:
install:
- exec:
command: ./install.sh
description: Install Infra Charts
uninstall:
- exec:
command: ./uninstall.sh
description: Uninstall Infra Charts
upgrade: []
/root/.porter/mixins/exec/exec build --debug
DEBUG Parsed Input:
&helm.BuildInput{Config:helm.MixinConfig{ClientVersion:"", Repositories:map[string]helm.Repository(nil)}}
FROM debian:stretch
ARG BUNDLE_DIR
RUN apt-get update && apt-get install -y ca-certificates
RUN apt-get update && \
apt-get install -y curl && \
curl -o helm.tgz https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz && \
tar -xzf helm.tgz && \
mv linux-amd64/helm /usr/local/bin && \
rm helm.tgz
RUN helm init --client-only
RUN apt-get update && \
apt-get install -y apt-transport-https curl && \
curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.15.3/bin/linux/amd64/kubectl && \
mv kubectl /usr/local/bin && \
chmod a+x /usr/local/bin/kubectl
# exec mixin has no buildtime dependencies
COPY . $BUNDLE_DIR
RUN rm -fr $BUNDLE_DIR/.cnab
COPY .cnab /cnab
COPY porter.yaml $BUNDLE_DIR/porter.yaml
WORKDIR $BUNDLE_DIR
CMD ["/cnab/app/run"]
Writing Dockerfile =======>
FROM debian:stretch
ARG BUNDLE_DIR
RUN apt-get update && apt-get install -y ca-certificates
RUN apt-get update && \
apt-get install -y curl && \
curl -o helm.tgz https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz && \
tar -xzf helm.tgz && \
mv linux-amd64/helm /usr/local/bin && \
rm helm.tgz
RUN helm init --client-only
RUN apt-get update && \
apt-get install -y apt-transport-https curl && \
curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.15.3/bin/linux/amd64/kubectl && \
mv kubectl /usr/local/bin && \
chmod a+x /usr/local/bin/kubectl
# exec mixin has no buildtime dependencies
COPY . $BUNDLE_DIR
RUN rm -fr $BUNDLE_DIR/.cnab
COPY .cnab /cnab
COPY porter.yaml $BUNDLE_DIR/porter.yaml
WORKDIR $BUNDLE_DIR
CMD ["/cnab/app/run"]
Starting Invocation Image Build =======>
Step 1/12 : FROM debian:stretch
---> 6d935b41319b
Step 2/12 : ARG BUNDLE_DIR
---> Using cache
---> 3ea32e8297a3
Step 3/12 : RUN apt-get update && apt-get install -y ca-certificates
---> Using cache
---> b0d1ddad9678
Step 4/12 : RUN apt-get update && apt-get install -y curl && curl -o helm.tgz https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz && tar -xzf helm.tgz && mv linux-amd64/helm /usr/local/bin && rm helm.tgz
---> Using cache
---> b8b063ed5d65
Step 5/12 : RUN helm init --client-only
---> Using cache
---> 640cbf401027
Step 6/12 : RUN apt-get update && apt-get install -y apt-transport-https curl && curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.15.3/bin/linux/amd64/kubectl && mv kubectl /usr/local/bin && chmod a+x /usr/local/bin/kubectl
---> Using cache
---> 903d94f9ea98
Step 7/12 : COPY . $BUNDLE_DIR
---> 59ae86030246
Step 8/12 : RUN rm -fr $BUNDLE_DIR/.cnab
---> Running in be222fa9a0c3
Removing intermediate container be222fa9a0c3
---> a1d524fb2b65
Step 9/12 : COPY .cnab /cnab
---> 35a831b7220b
Step 10/12 : COPY porter.yaml $BUNDLE_DIR/porter.yaml
---> 75a96a9af4ed
Step 11/12 : WORKDIR $BUNDLE_DIR
---> Running in 1eafb61febb0
Removing intermediate container 1eafb61febb0
---> 5c2f9dccc2ff
Step 12/12 : CMD ["/cnab/app/run"]
---> Running in 3582ddf1738d
Removing intermediate container 3582ddf1738d
---> 220b2361b12e
Successfully built 220b2361b12e
Successfully tagged localhost:5000/rec-repo/infra-install-cnab-installer-installer:1.1.6
DEBUG name: arm
DEBUG pkgDir: /root/.porter/mixins/arm
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/arm/arm version --output json --debug
DEBUG name: aws
DEBUG pkgDir: /root/.porter/mixins/aws
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/aws/aws version --output json --debug
DEBUG name: az
DEBUG pkgDir: /root/.porter/mixins/az
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/az/az version --output json --debug
DEBUG name: exec
DEBUG pkgDir: /root/.porter/mixins/exec
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/exec/exec version --output json --debug
DEBUG name: gcloud
DEBUG pkgDir: /root/.porter/mixins/gcloud
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/gcloud/gcloud version --output json --debug
DEBUG name: helm
DEBUG pkgDir: /root/.porter/mixins/helm
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/helm/helm version --output json --debug
DEBUG name: kubernetes
DEBUG pkgDir: /root/.porter/mixins/kubernetes
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/kubernetes/kubernetes version --output json --debug
DEBUG name: terraform
DEBUG pkgDir: /root/.porter/mixins/terraform
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/terraform/terraform version --output json --debug
Pushing CNAB invocation image...
The push refers to repository [localhost:5000/rec-repo/infra-install-cnab-installer-installer]
c73d9b1c28b6: Preparing
ee467518f309: Preparing
b343dced50d8: Preparing
c98aa429c2e9: Preparing
219410cd4347: Preparing
90ca8ca0957c: Preparing
8e7363b9dcd4: Preparing
9b7657a76455: Preparing
4e38024e7e09: Preparing
90ca8ca0957c: Waiting
8e7363b9dcd4: Waiting
9b7657a76455: Waiting
4e38024e7e09: Waiting
219410cd4347: Layer already exists
90ca8ca0957c: Layer already exists
8e7363b9dcd4: Layer already exists
9b7657a76455: Layer already exists
4e38024e7e09: Layer already exists
b343dced50d8: Pushed
c73d9b1c28b6: Pushed
ee467518f309: Pushed
c98aa429c2e9: Pushed
1.1.6: digest: sha256:1cc5fba733388f43410ef670d4714431546b92f99c1ce538a29d3b18c3332c3f size: 2214
Rewriting CNAB bundle.json...
DEBUG name: arm
DEBUG pkgDir: /root/.porter/mixins/arm
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/arm/arm version --output json --debug
DEBUG name: aws
DEBUG pkgDir: /root/.porter/mixins/aws
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/aws/aws version --output json --debug
DEBUG name: az
DEBUG pkgDir: /root/.porter/mixins/az
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/az/az version --output json --debug
DEBUG name: exec
DEBUG pkgDir: /root/.porter/mixins/exec
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/exec/exec version --output json --debug
DEBUG name: gcloud
DEBUG pkgDir: /root/.porter/mixins/gcloud
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/gcloud/gcloud version --output json --debug
DEBUG name: helm
DEBUG pkgDir: /root/.porter/mixins/helm
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/helm/helm version --output json --debug
DEBUG name: kubernetes
DEBUG pkgDir: /root/.porter/mixins/kubernetes
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/kubernetes/kubernetes version --output json --debug
DEBUG name: terraform
DEBUG pkgDir: /root/.porter/mixins/terraform
DEBUG file:
DEBUG stdin:
/root/.porter/mixins/terraform/terraform version --output json --debug
Starting to copy image localhost:5000/rec-repo/infra-install-cnab-installer-installer:1.1.6...
Completed image localhost:5000/rec-repo/infra-install-cnab-installer-installer:1.1.6 copy
Starting to copy image chartmuseum/chartmuseum:v0.11.0...
Completed image chartmuseum/chartmuseum:v0.11.0 copy
Starting to copy image quay.io/gravitational/debian-tall:stretch...
Completed image quay.io/gravitational/debian-tall:stretch copy
Starting to copy image grafana/grafana:6.3.5...
Completed image grafana/grafana:6.3.5 copy
Starting to copy image jettech/kube-webhook-certgen:v1.0.0...
Completed image jettech/kube-webhook-certgen:v1.0.0 copy
Starting to copy image rancher/rancher:v2.3.5...
Completed image rancher/rancher:v2.3.5 copy
Starting to copy image rancher/rancher-agent:v2.3.5...
Failed to copy image rancher/rancher-agent:v2.3.5: failed commit on ref "manifest-sha256:94c4d5e47eb8119242ba0afc45b05a421669ed1a63a1b782ba1da3a34c4a2df9": unexpected status: 500 Internal Server Error
Error: failed commit on ref "manifest-sha256:94c4d5e47eb8119242ba0afc45b05a421669ed1a63a1b782ba1da3a34c4a2df9": unexpected status: 500 Internal Server Error
I've created a repro bundle in https://github.com/vdice/porter-bundles/blob/master/wip/publish-repro/porter.yaml.
Indeed, I see the same (and other) errors from some of the images attempted to be copied. For testing, I've been publishing against a local Docker registry (via docker run -d -p 5000:5000 --name registry registry:2
). In that linked Porter manifest, I've added the errors around each problematic image (if it failed, I commented it out).
The errors seen in the registry logs either seem to be:
I'm surprised that these errors are encountered on well-known/supported images. I'm not sure if there's a setting we can flip in either go-containerregistry or cnab-to-oci to forgo these errors -- if even advisable. (Oh, by the way, I built/used a local Porter binary with the go-containerregistry dep bumped to their latest v0.1.2 release; Porter is already on the latest cnab-to-oci release).
Any experience in this area @radu-matei ?
Any update on this?
Unfortunately, no updates here. These are errors coming straight from the referenced libraries (go-containerregistry and cnab-to-oci), both of which were tested with their latest variants. We would need to spend some time with both to debug the issues and/or inquire with the upstream dependencies.
Unfortunately, no updates here. These are errors coming straight from the referenced libraries (go-containerregistry and cnab-to-oci), both of which were tested with their latest variants. We would need to spend some time with both to debug the issues and/or inquire with the upstream dependencies.
Should I create the issue there?
@digger18 I had some spare cycles this morning to revisit.
When reviewing my repro bundle (based on the bundle provided in this issue), the two main errors produced by the stock docker registry (v2) are/were:
My hunch was that the first class of errors was due to problematic image tags, so I looked up each affected image and bumped to a more recent tag. These images now succeeded in pushing/copying when publishing the bundle.
The second class only occurred for one image in the repro bundle: rancher/rancher-agent:v2.3.5
. In looking at this v2.3.5 tag I see that it is a multi-os/multi-arch tag with support for both Windows and Linux arch combos. My theory is that tags like this may be an issue for certain registries (apparently, the stock docker v2 registry... and perhaps Harbor?) So, I changed the tag to v2.3.5-linux-amd64
and it then succeeded in publishing.
(One additional note on multi-arch tags: publishing didn't have an issue with tags with Linux-only multi-arch images, such as the configmap-reload v0.4.0 tag.)
For an updated porter.yaml of this repro bundle, see: https://github.com/vdice/porter-bundles/blob/ref/publish-repro/wip/publish-repro/porter.yaml
Can you try publishing this updated bundle (or your variant with similar bumped/changed tags) and see if you have better luck publishing?
Thank you!
@vdice Assuming that your thoughts on multi-os/arch are correct, is this a bug with porter that needs fixing? Perhaps something that we need to document?
I revisited the same publish-repro bundle. While I still encounter similar errors when publishing to a local registry (using the same registry:2
image), I don't encounter the errors when publishing to my DockerHub account (and I'm able to install from this docker.io/vdice/publish-repro:v0.1.0
reference.) I'm confused as to the discrepancy.
Since it works for one but not the other, I'm not thinking it is a bug with Porter. As for documenting, it still seems like we'd need to pin down the real issue first, unfortunately.
I am making a new issue label, stumped
, just for this issue and removing from the 1.0 milestone. If anyone runs into something that looks like this and has more information, please comment! 😀
Describe the bug
Unable to bundle several images from quay.io, probably related to https://github.com/google/go-containerregistry/issues/377 Getting error
Error preparing artifacts: unsupported MediaType: "application/vnd.docker.distribution.manifest.v1+prettyjws"
duringporter archive
.Porter Command and Output
My porter.yaml
Version
porter v0.27.2 (aee93e98)