Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable docker push timeout #711

Closed
betatim opened this issue Jun 20, 2019 · 6 comments · Fixed by #1124
Closed

Configurable docker push timeout #711

betatim opened this issue Jun 20, 2019 · 6 comments · Fixed by #1124

Comments

@betatim
Copy link
Member

betatim commented Jun 20, 2019

via https://discourse.jupyter.org/t/i-get-read-timed-out-errors-on-when-pushing-image-ovh/1394/7?u=betatim

Is there a way we can control/increase the timeout for the push operation at the end of the build? We are getting timeouts for this step on the OVH deployment and a potential way to help here is to increase (or make configurable) the push timeout.

The first step here is to find out how to control the timeout in the docker python client library we use.

@mael-le-gal
Copy link

I succeed in reproducing the error locally.

When we create a docker docker.APIClient there is a timeout parameter that we could give to the constructor.

Documentation say :

timeout (int): Default timeout for API calls, in seconds.

I let you now if changing this parameter fix the issue.

@mael-le-gal
Copy link

Indeed increasing that timeout fixed the issue.

The line of code is that one

It needs to be changed to something like that :

client = docker.APIClient(version="auto", timeout=CHOSEN_TIMEOUT, **kwargs_from_env())

Maybe this would be great to make it configurable. In this initial command line (like --push-timeout xxx) ?

@mael-le-gal
Copy link

Or by changing the kwargs_from_env() function to take the parameter from environment variables.

What do you think ?

@betatim betatim changed the title Connfigurable docker push timeout Configurable docker push timeout Jun 21, 2019
@betatim
Copy link
Member Author

betatim commented Jun 21, 2019

Taking it from the environment sounds like a good idea to me. Mostly because we have a huge number of CLI flags already :-/ and my guess is this would be mostly used by deployments like BinderHub and not humans.

I think kwargs_from_env() is part of the docker-py library so maybe it already looks at an environment variable for this?

@mael-le-gal
Copy link

Taking it from the environment sounds like a good idea to me. Mostly because we have a huge number of CLI flags already :-/ and my guess is this would be mostly used by deployments like BinderHub and not humans.

agree

I think kwargs_from_env() is part of the docker-py library so maybe it already looks at an environment variable for this?

Indeed, I didn't saw that it was from docker-py but sadly the timeout parameter is not set in the function.

I'll then write my own function to get this parameter from env variables.

@betatim
Copy link
Member Author

betatim commented Jun 21, 2019

Something like this sounds like a good idea or maybe we can contribute to docker-py to get kwargs_from_env() changed?

def get_timeout():
  return value_from_env

client = docker.APIClient(version="auto", timeout=get_timeout(), **kwargs_from_env())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants