singularityhub / sregistry

server for storage and management of singularity images
https://singularityhub.github.io/sregistry
Mozilla Public License 2.0
103 stars 42 forks source link

sregistry under https #403

Closed imerelli closed 1 year ago

imerelli commented 1 year ago

After installing sregistry, I'm now struggling with http/https. I'm trying to push an image to the registry with this command:

singularity push -U centos7-python3-r4-deg.sif library://imerelli/rnaseq/centos7-python3-r4-deg FATAL: Unable to get library client configuration: unable to get library service URI: error making request to server: Get "https://131.175.207.216/assets/config/config.prod.json": dial tcp 131.175.207.216:443: connect: connection refused

I noticed that
https://131.175.207.216/assets/config/config.prod.json is not available, but http://131.175.207.216/assets/config/config.prod.json is correctly available.

Is it possibile to push an image using "singularity push" without https? Otherwise, how can I run sregistry using https?

vsoch commented 1 year ago

Is it possibile to push an image using singularity push without https?

Yes, this is the default, and it should work out of the box, with the caveat you usually need a special compiled version of the client.

When I made sregistry it meant compiling singularity with an adjustment to a file, which is described here https://singularityhub.github.io/sregistry/docs/client#singularity-push. That code, however, I think is old, and my guess is that now it's controlled by how you login to the remote: https://github.com/sylabs/singularity/blob/f1477058a25cddedb0ca5b2377b6f9ef827865a7/internal/pkg/remote/credential/login_handler.go. It's 1:30 am here so I can't look into this for you, but if you don't figure it out I'd ping the Singularity slack (Sylabs) and ask about how to get http for push.

For pull, they now have a no https --nohttps flag . With push I think it's still required, and you'll need to compile this special version.

Otherwise, how can I run sregistry using https?

This is what I'd consider a production deployment. We have ample docs here: https://singularityhub.github.io/sregistry/docs/install/https for both faux (development) and production https.

imerelli commented 1 year ago

Ok, thank you for the suggestions.

I'm trying to move sregistry under https. I was able to generate the certificates (that are now on the host server) and I moved the https/docker-compose.yml and https/nginx.conf files to the sregistry root directory (moving the other to http as suggested). I also modified the indicated section in the config.py as follows:

DOMAIN_NAME = "https://sregistry.bioinfotiget.it" DOMAIN_NAME_HTTP = "http://sregistry.bioinfotiget.it" DOMAIN_NAKED = DOMAIN_NAME_HTTP.replace("http://", "")

The docker compose run smoothly but the nginx server is not running properly, because the site is down and also checking the port the server is not running:

nmap localhost Starting Nmap 7.70 ( https://nmap.org ) at 2022-09-09 13:56 UTC Nmap scan report for localhost (127.0.0.1) Host is up (0.000012s latency). Other addresses for localhost (not scanned): ::1 Not shown: 995 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 111/tcp open rpcbind 631/tcp open ipp 8090/tcp open opsmessaging

Any hints on what the error can be? Is there any log I can check?

vsoch commented 1 year ago

Can you check the nginx logs? usually docker-compose logs or docker logs against the container can give us a hint.

imerelli commented 1 year ago

Looking at the logs it was clear that the file dhparam.pem was missing. Thanks

vsoch commented 1 year ago

Sure! You reported https working in your other thread so let's close this issue.