-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: append 'grader-' outside of image exists check
chore: make local orchestrator containers work with bottlenose
- Loading branch information
1 parent
bd82c58
commit cc69d15
Showing
5 changed files
with
37 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import os | ||
import subprocess | ||
from orca_grader.common.services.download_file import download_file | ||
from orca_grader.config import APP_CONFIG | ||
|
||
|
||
def retrieve_image_tgz_from_url(container_sha: str, images_url: str) -> None: | ||
file_name = "{0}.tgz".format(container_sha) | ||
download_file(images_url, file_name) | ||
file_name = "{0}.tgz".format(container_sha) | ||
download_file(images_url, file_name) | ||
|
||
|
||
def load_image_from_tgz(tgz_file_path: str) -> None: | ||
program_args = [ | ||
"docker", | ||
"load", | ||
"-i", | ||
tgz_file_path | ||
] | ||
with open(tgz_file_path, 'rb') as container_tgz_fp: | ||
program_args = [ | ||
"docker", | ||
"load", | ||
"-i", | ||
tgz_file_path | ||
] | ||
subprocess.run(program_args, stdout=subprocess.DEVNULL, | ||
stderr=subprocess.STDOUT, | ||
check=True) | ||
os.remove(tgz_file_path) # To save resources, clean up tgz after load. | ||
stderr=subprocess.STDOUT, | ||
check=True) | ||
os.remove(tgz_file_path) # To save resources, clean up tgz after load. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why is this duplicating the
program_args
array and process call? Shouldn't it just be