Cannot submit on Windows using proxy


#1

Hi,
I am on Windows behind a proxy and have env settings:

    http_proxy=http://proxy.xxx:8080/
    https_proxy=http://proxy.xxx:8080/

which allow me to communicate with outside world

When I tried to make submission by:

evalai push submission:latest --phase animalai-main-396

I got the following error:

evalai push submission:latest --phase animalai-main-396
Traceback (most recent call last):
  File "q:\anaconda\envs\animalai\lib\site-packages\docker\api\client.py", line 246, in _raise_for_status
    response.raise_for_status()
  File "q:\anaconda\envs\animalai\lib\site-packages\requests\models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://192.168.99.100:2376/v1.35/auth

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "q:\anaconda\envs\animalai\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "q:\anaconda\envs\animalai\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "Q:\Anaconda\envs\animalai\Scripts\evalai.exe\__main__.py", line 9, in <module>
  File "q:\anaconda\envs\animalai\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "q:\anaconda\envs\animalai\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "q:\anaconda\envs\animalai\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "q:\anaconda\envs\animalai\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "q:\anaconda\envs\animalai\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "q:\anaconda\envs\animalai\lib\site-packages\evalai\submissions.py", line 141, in push
    username, password, registry=registry, dockercfg_path=os.getcwd()
  File "q:\anaconda\envs\animalai\lib\site-packages\docker\client.py", line 183, in login
    return self.api.login(*args, **kwargs)
  File "q:\anaconda\envs\animalai\lib\site-packages\docker\api\daemon.py", line 152, in login
    return self._result(response, json=True)
  File "q:\anaconda\envs\animalai\lib\site-packages\docker\api\client.py", line 252, in _result
    self._raise_for_status(response)
  File "q:\anaconda\envs\animalai\lib\site-packages\docker\api\client.py", line 248, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "q:\anaconda\envs\animalai\lib\site-packages\docker\errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("Get https://937891341272.dkr.ecr.us-east-1.amazonaws.com/v2/: dial tcp 52.72.245.37:443: connect: connection refused")

I had the similar problem with my Dockerfile (see:
https://github.com/beyretb/AnimalAI-Olympics/issues/50)
which I resolved by adding ENV setting inside the Dockerfile:

ENV http_proxy "http://proxy.xxx:8080"
ENV https_proxy "http://proxy.xxx:8080"

I am sure that these two lines should be added somewhere in some config file and I need your help.


#2

I tried to add http_proxy settings in .docker\config.json at several “default” Windows places without any success.
I needed the environment variables to be set automatically within the container when a new container was started. I achieved this by adding http_proxy settings to internal docker profile.

Thus the solution is:

sudo vi /var/lib/boot2docker/profile
export HTTP_PROXY=http://proxy.xxx:8080
export HTTPS_PROXY=http://proxy.xxx:8080
$ sudo /etc/init.d/docker restart

After that I was able to make a submission by evalai push <image>:<tag>