Skip to content

Commit

Permalink
adding estimated remote image size on disk when pulling an image
Browse files Browse the repository at this point in the history
  • Loading branch information
ShutdownRepo committed Oct 17, 2023
1 parent 068ea05 commit 09ce9e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions exegol/model/ExegolImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,10 @@ def getRealSize(self) -> str:
"""On-Disk size getter"""
return self.__disk_size if self.__is_install else f"[bright_black]~{self.__remote_est_size}[/bright_black]"

def getRealSizeRaw(self) -> str:
"""On-Disk size getter"""
return self.__disk_size if self.__is_install else self.__remote_est_size

def getDownloadSize(self) -> str:
"""Remote size getter"""
if not self.__is_remote:
Expand Down
4 changes: 3 additions & 1 deletion exegol/utils/DockerUtils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import logging
from datetime import datetime
from typing import List, Optional, Union, cast

Expand Down Expand Up @@ -446,7 +447,8 @@ def downloadImage(cls, image: ExegolImage, install_mode: bool = False) -> bool:
logger.info(f"{'Installing' if install_mode else 'Updating'} exegol image : {image.getName()}")
name = image.updateCheck()
if name is not None:
logger.info(f"Starting download. Please wait, this might be (very) long.")
logger.raw(f"[bold blue][*][/bold blue] Pulling compressed image, starting a [cyan1]{image.getDownloadSize()}[/cyan1] download :satellite:{os.linesep}", level=logging.INFO, markup=True, emoji=True)
logger.raw(f"[bold blue][*][/bold blue] Once downloaded and uncompressed, the image will take [cyan1]~{image.getRealSizeRaw()}[/cyan1] on disk :floppy_disk:{os.linesep}", level=logging.INFO, markup=True, emoji=True)
logger.debug(f"Downloading {ConstantConfig.IMAGE_NAME}:{name} ({image.getArch()})")
try:
ExegolTUI.downloadDockerLayer(
Expand Down

0 comments on commit 09ce9e8

Please sign in to comment.