Open Niksko opened 4 years ago
I am having similar issues that I'll detail here to possibly give some additional info for the devs. All of these interactions are with a private ECR repository, which I have used with the docker
command line utility without issue.
Login attempts to ECR give a 404.
$ wasme login -s <aws_ecr_url> -u AWS -p <really_long_pw>
Error: non-200 status code: 404L: 404 Not Found
Using an OCI image with a path-prefixed name for organizational purposes, eg myfilters
, will error with a 404.
$ wasme push <aws_ecr_url>/myfilters/mytestfilter:0.0.1 -u AWS -p <really_long_pw>
#1: oras push failed: unexpected response: 404 Not Found
This is not ideal, as larger organizations tend to organize images by product, team, or department in the above way. Having folders is better supported in products like JFrog Artifactory, but still functions in ECR, so it is likely wasme
running into an issue in this case.
Eliminating the prefix path and creating a new repo location with just the root name, and rebuilding the filter to match, we then get the above 405 error.
$ wasme push <aws_ecr_url>/mytestfilter:0.0.1 -u AWS -p <really_long_pw>
Error: All attempts fail:
#1: oras push failed: failed commit on ref "manifest-sha256:<hash>": unexpected status: 405 Method Not Allowed
I have also tried to extract more information using the -v
flag, to no avail.
I will make another ticket, but it would also be nice if these commands could take the password from stdin, similar to the docker and aws tools. This would also coincide nicely with the AWS examples for using docker.
Some additional info. I was able to log into my ECR repository with ORAS, oras login
, so it's possible that wasme
(which is wrapping oras
at the moment) is not providing some configuration to the library, or an upgrade may alleviate it.
Using oras push
, I get an equivalent/identical error to the wasme push
errors above.
I also played around with wasm-to-oci, which also wraps the oras
go library. I was able to log in with the raw oras login [...]
sequence, since wasm-to-oci
does not provide a login method. I figured out that this works, as the oras
library seems to store the credential cache in a well known location. I also figured out that this appears to work (or to at least get as far as the above 405 error) in concert with wasme push [...]
(without credentials provided).
The biggest difference, however, is that wasm-to-oci
can actually push successfully to ECR. I don't believe the format it creates is compatible with what Envoy/Gloo expect in this case, but it is able to push images up using the oras
library. This again seems to reinforce that it's a matter of configuration parameters sent to the oras
library before initiating a push that determines success or failure in this case.
For completeness, I was able to push a wasme
built binary using oras
up to an ECR repository.
After creating and building the filter with wasme
, navigate to ~/.wasme/store/<some_hash>
. You should have a filter.wasm
and runtime-config.json
file in there already (along with some others).
To use oras
properly, we need to create an annotations.json
file with the metadata for the OCI image. For test purposes, this is basically static, but the abi versions can be adjusted from what you find in runtime-config.json
:
{
"$manifest": {
"module.wasm.runtime/abi_version": "v0-541b2c1155fffb15ccde92b8324f3e38f7339ba6,v0-097b7f2e4cc1fb490cc1943d0d633655ac3c522f,v0-4689a30309abf31aee9ae36e73d34b1bb182685f,v0.2.1",
"module.wasm.runtime/type": "envoy_proxy"
}
}
Then we log oras
into our ECR repo using the aws
command line tool.
aws ecr get-login-password --region <region> | oras login -u AWS --password-stdin <your_account_id>.ecr.<region>.amazonaws.com
Finally, push the repo:
oras push --manifest-annotations annotations.json \
<your_account_id>.dkr.ecr.<region>.amazonaws.com/<filter_name>:<version> \
runtime-config.json:application/vnd.module.wasm.config.v1+json \
filter.wasm:application/vnd.module.wasm.content.layer.v1+wasm
This assumes you have a repository created in ECR that matches what you put above for <filter_name>
.
Is pushing to ECR supported? The docs say that images can be pushed to OCI compatible registries, and ECR is OCI compatible. When I try and tag and push an image to an ECR registry that I am authenticated to, I get an error with status 405 Method Not Allowed. Below is a verbose run of the
wame push
with the name of my registry redactedI've also tried passing username and password via the
-u
and-p
flags