centurion icon indicating copy to clipboard operation
centurion copied to clipboard

is Registry 2.0 unsupported?

Open telamon opened this issue 10 years ago • 4 comments

Hi! I'm trying to deploy using an private docker/registry-2.0 (docker-distribution)

Have I misconfigured my registry or is there simply no support for /v2/ api yet?

$ centurion -p myApp -e production 
** Invoke environment:production (first_time)
** Invoke environment:common (first_time)
** Execute environment:common
** Execute environment:production
** Invoke centurion:setup (first_time)
** Invoke centurion:clean_environment (first_time)
** Execute centurion:clean_environment
** Execute centurion:setup
** Invoke list (first_time)
** Execute list
** Invoke list:tags (first_time)
** Execute list:tags
GET: "https://registry.mydomain.com/v1/repositories/myapp/tags"
E, [2015-09-21T11:42:34.014356 #4959] ERROR -- : Couldn't communicate with Registry: #<Excon::Response:0x0000000195d188 @data={:body=>"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.9.4</center>\r\n</body>\r\n</html>\r\n", :headers=>{"Server"=>"nginx/1.9.4", "Date"=>"Mon, 21 Sep 2015 09:51:43 GMT", "Content-Type"=>"text/html", "Content-Length"=>"168", "Connection"=>"keep-alive"}, :status=>404, :status_line=>"HTTP/1.1 404 Not Found\r\n", :reason_phrase=>"Not Found"}, @body="<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.9.4</center>\r\n</body>\r\n</html>\r\n", @headers={"Server"=>"nginx/1.9.4", "Date"=>"Mon, 21 Sep 2015 09:51:43 GMT", "Content-Type"=>"text/html", "Content-Length"=>"168", "Connection"=>"keep-alive"}, @status=404, @remote_ip="x.x.x.x", @local_port=39801, @local_address="x.x.x.x">

Note: If i do try to replace the v1 to a v2 and visit the link manually: https://registry.mydomain.com/v2/repositories/myapp/tags I do indeed get to the place i should be, instead of a 404.

telamon avatar Sep 21 '15 09:09 telamon

It looks like the V2 registry is not backward compatible in API with the V1 registry. We've never implemented the V2 calls so it looks like that doesn't work, unfortunately. Since our production code uses either the public registries or Dogestry, we've not had to implement V2 yet. The public registries all still work with the V1 API calls.

From your testing it looks like we could try to just substitute V2 everywhere and see what breaks but my guess is a lot breaks. If you want to work on that we'd appreciate the contribution. Otherwise it will probably be awhile.

relistan avatar Sep 24 '15 14:09 relistan

I took a stab at this about a month ago due to this being a block for us using centurion for deployments. I made the API version a config parameter with a default of 1 to keep backwards-compatibility. FWIW, we've been using this fork in production for a few weeks now without any issues.

I would certainly not mind creating a pull request with these changes if people are interested. It would require a bit of refactoring at this point due to some of the recent changes here that conflict with some of the changes I made.

imdevin567 avatar Dec 10 '15 14:12 imdevin567

Will definatly need v2 support to roll this out. Be happy to exercise your PR

deedubs avatar Dec 13 '15 14:12 deedubs

Pull request for this referenced in #153

imdevin567 avatar Dec 16 '15 15:12 imdevin567