Skip to content

Commit

Permalink
docker image size
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelduranfrigola committed Aug 21, 2023
1 parent 4152b6a commit 95352da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ersilia/hub/fetch/actions/sniff.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _get_size_in_mb(self):
dest_dir = self._model_path(self.model_id)
repo_dir = self._get_bundle_location(self.model_id)
size = self._get_directory_size(dest_dir) + self._get_directory_size(repo_dir)
mbytes = size / (1024**2)
mbytes = size / (1024 ** 2)
return mbytes

def _get_schema(self, results):
Expand Down
4 changes: 4 additions & 0 deletions ersilia/hub/pull/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def pull(self):
self.logger.debug(
"Pulling image {0} from DockerHub...".format(self.image_name)
)
img = self.client.images.get("{0}/{1}".format(DOCKERHUB_ORG, self.model_id))
self.logger.debug(
f"Size of image: {img.attrs['Size'] / (1024*1024):.2f} MB"
)
try:
self.client.images.pull(
"{0}/{1}".format(DOCKERHUB_ORG, self.model_id),
Expand Down

0 comments on commit 95352da

Please sign in to comment.