k-l-lambda/stylegan-web

Interested in dockerizing the app?

valentinvieriu opened this issue · 6 comments

This is an amazing work you are doing here!
I've forked your code and thought of adding Docker and Docker-compose for making it way more easy to start.
See https://github.com/valentinvieriu/stylegan-web

Are you interested in having this approach in you repo?

Thank you. Interesting. I'm not familiar with docker, what to do to test if this works?

Docker offers isolation and a reproducible environment. This will allow people to test and run your app without having all the needed dependencies.
You have to have docker and docker-compose installed. And then just clone the repo and docker-compose build and docker-compose up.

Docker makes it easy to run the app, and also if you use it with the nvidia drivers, you can have teh setup running on your machine in minutes

Sound good. I have a machine learning workstation with linux OS, and once docker and docker-compose installed, will your repository can work directly now?

gu-ma commented

Hi, I've forked the repo to work with Stylegan2-ada, I've also added Docker container.
This commit should be pretty much everything you need to build and run Docker image:
gu-ma@f686c36
and this one is to use Docker + SSL:
gu-ma@9078953

Hi, I've forked the repo to work with Stylegan2-ada, I've also added Docker container.
This commit should be pretty much everything you need to build and run Docker image:
gu-ma@f686c36
and this one is to use Docker + SSL:
gu-ma@9078953

Thank you. It has been a while I didn't pay attention to this area. It's time to study.

@k-l-lambda / @gu-ma - cool / @valentinvieriu - thank you for submitting this / can use all of this. BTW - there's a bump for dec docker base image / worth checking this for januar or later too to overcome problems with 3090 card.
https://github.com/NVlabs/stylegan2-ada/pull/51/files

may not be helpful - but I added some tweaks to dockerfile https://gist.github.com/johndpope/7f4c2a6065ca6b30cd6b285ed87eeadd

UPDATE
Maybe we can add SSL generation when Dockerfile boots

https://stackoverflow.com/questions/44047315/generate-a-self-signed-certificate-in-docker

Or maybe this is better

openssl genrsa -des3 -passout pass:PASSWORD -out server.pass.key 2048
openssl rsa -passin pass:PASSWORD -in server.pass.key -out stylegan-web.key
rm server.pass.key
openssl req -new -key stylegan-web.key -out server.csr \
    -subj "/C=UK/ST=Warwickshire/L=Leamington/O=OrgName/OU=IT Department/CN=example.com"
openssl x509 -req -days 365 -in server.csr -signkey stylegan-web.key -out stylegan-web.crt

fyi running this generation of certs - will resolve this error

python http_server.py
2020-12-20 02:58:35.958207: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
 * Serving Flask app "http_server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
server interrupted: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'No such file or directory'), <traceback object at 0x7fd910b0b300>)

find IP address of docker container
docker ps (FIND CONTAINERID)
docker inspect CONTAINERID | grep "IPAddress"
"IPAddress": "172.17.0.2",

On your host
code /etc/hosts

172.17.0.2 example.com

Then where it says

Use a production WSGI server instead.

goto
HTTPS://example.com:8186/