IBM / MAX-Image-Resolution-Enhancer

Upscale an image by a factor of 4, while generating photo-realistic details.
https://developer.ibm.com/exchanges/models/all/max-image-resolution-enhancer/
Apache License 2.0
989 stars 162 forks source link

`wget` unable to resolve #59

Closed haykh closed 2 years ago

haykh commented 2 years ago

hi! thanks for making this product open-source.

trying to deploy locally with docker. when doing docker build .... it pulls everything, but then fails to download the assets.

> docker build -t max-image-resolution-enhancer .
Sending build context to Docker daemon  16.36MB
Step 1/10 : FROM quay.io/codait/max-base:v1.5.1
v1.5.1: Pulling from codait/max-base
33847f680f63: Pull complete
ff810a0db00f: Pull complete
2cb7a358a8ff: Pull complete
1c77cb174e52: Pull complete
c22d4f38b378: Pull complete
3bf0e48704e3: Pull complete
0a190a0824c1: Pull complete
75c4005c73c5: Pull complete
1da59b80543d: Pull complete
fa242c43983c: Pull complete
Digest: sha256:d1331f18b84febe076526cf6d079e45de6f9daecb4df37dd97ac5324b4c757fc
Status: Downloaded newer image for quay.io/codait/max-base:v1.5.1
 ---> f6ca74aba0b7
Step 2/10 : ARG model_bucket=https://codait-cos-max.s3.us.cloud-object-storage.appdomain.cloud/max-image-resolution-enhancer/1.0.0
 ---> Running in 593c8ea2caaa
Removing intermediate container 593c8ea2caaa
 ---> a3d4e363f456
Step 3/10 : ARG model_file=assets.tar.gz
 ---> Running in 75ffd55f0628
Removing intermediate container 75ffd55f0628
 ---> 0e11453e5096
Step 4/10 : RUN wget -nv --show-progress --progress=bar:force:noscroll ${model_bucket}/${model_file} --output-document=assets/${model_file} &&   tar -x -C assets/ -f assets/${model_file} -v && rm assets/${model_file}
 ---> Running in bcb27805ecb3
wget: unable to resolve host address ‘codait-cos-max.s3.us.cloud-object-storage.appdomain.cloud’
The command '/bin/sh -c wget -nv --show-progress --progress=bar:force:noscroll ${model_bucket}/${model_file} --output-document=assets/${model_file} &&   tar -x -C assets/ -f assets/${model_file} -v && rm assets/${model_file}' returned a non-zero code: 4

here's my docker version:

> docker -v
Docker version 20.10.14, build a224086

the link seems to work, if i just run wget on these assets outside the docker.

thank you in advance!

haykh commented 2 years ago

I think it's related to #54. But seems like the problem still persists (at least for me) even after the fix. Is there a way to tweak the code minimally so I can feed the assets.tar.gz manually?

haykh commented 2 years ago

so what i ended up doing is to comment out lines 22 & 23 in the Dockerfile, and just manually wget the file:

mkdir -p assets/
wget https://codait-cos-max.s3.us.cloud-object-storage.appdomain.cloud/max-image-resolution-enhancer/1.0.0/assets.tar.gz --directory-prefix=assets/
tar -x -C assets/ -f assets/assets.tar.gz -v

i now have issues with pip. is there a way to make it use a custom python (say, from virtualenv)?

haykh commented 2 years ago

Ok, so the problem was indeed on my side. I was using the docker on wsl, which probably complicates things a bit, especially network access. I was able to resolve the issue by reinstalling the docker completely and then starting it following this instruction.