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

Defer docker image URL accessibility check to srun when not caching locally #164

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/cloudai/util/docker_image_cache_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,9 @@ def check_docker_image_exists(
f"cache_docker_images_locally={self.cache_docker_images_locally}"
)

# If not caching locally, check URL accessibility
# If not caching locally, return True. Defer checking URL accessibility to srun.
if not self.cache_docker_images_locally:
accessibility_check = self._check_docker_image_accessibility(docker_image_url)
if accessibility_check.success:
return DockerImageCacheResult(True, docker_image_url, accessibility_check.message)
logging.error(
f"Accessibility check failed for Docker image URL: {docker_image_url}. "
f"Error: {accessibility_check.message}"
)
return DockerImageCacheResult(False, "", accessibility_check.message)
return DockerImageCacheResult(True, docker_image_url, "")

# Check if docker_image_url is a file path and exists
if os.path.isfile(docker_image_url) and os.path.exists(docker_image_url):
Expand Down