Skip to content

Commit

Permalink
Catch more errors when pushing a Docker image (ucbrise#663)
Browse files Browse the repository at this point in the history
* Add new ReadTimeoutError to the 'retry' decorator(_push_model)

* Add more errors
  • Loading branch information
Sungjun.Kim authored and rkooo567 committed Apr 28, 2019
1 parent afc10dc commit d1114dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clipper_admin/clipper_admin/clipper_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from docker import errors
import tempfile
import requests
from requests.exceptions import RequestException
from urllib3.exceptions import TimeoutError
from requests.exceptions import (RequestException, Timeout)
import json
import pprint
import time
Expand Down Expand Up @@ -524,7 +525,8 @@ def build_model(self,

self.logger.info("Pushing model Docker image to {}".format(image))

@retry(docker.errors.APIError, tries=5, logger=self.logger)
@retry((docker.errors.APIError, TimeoutError, Timeout),
tries=5, logger=self.logger)
def _push_model():
for line in docker_client.images.push(repository=image, stream=True):
self.logger.debug(line)
Expand Down

0 comments on commit d1114dc

Please sign in to comment.