Skip to content

Commit

Permalink
capture no matching manifest and trying AMD
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelduranfrigola committed Dec 1, 2023
1 parent c46b816 commit ef661d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
14 changes: 12 additions & 2 deletions ersilia/hub/pull/pull.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import requests
import subprocess
import tempfile
import os

from ... import ErsiliaBase
from ...utils.terminal import yes_no_input, run_command
Expand Down Expand Up @@ -102,11 +104,19 @@ def pull(self):
self.logger.debug(
"Trying to pull image {0}/{1}".format(DOCKERHUB_ORG, self.model_id)
)
tmp_file = os.path.join(
tempfile.mkdtemp(prefix="ersilia-"), "docker_pull.log"
)
run_command(
"docker pull {0}/{1}:{2}".format(
DOCKERHUB_ORG, self.model_id, DOCKERHUB_LATEST_TAG
"docker pull {0}/{1}:{2} 2>&1 > {3}".format(
DOCKERHUB_ORG, self.model_id, DOCKERHUB_LATEST_TAG, tmp_file
)
)
with open(tmp_file, "r") as f:
pull_log = f.read()
self.logger.log(pull_log)
if "no matching manifest" in pull_log:
raise Exception
self.logger.debug("Image pulled succesfully!")
except:
self.logger.warning(
Expand Down
12 changes: 10 additions & 2 deletions ersilia/io/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,19 @@ def __expand_output_keys(self, vals, output_keys):
t = current_pure_dtype[ok]
self.logger.debug("Datatype: {0}".format(t))
if t in self._array_types:
self.logger.debug("Datatype has been matched: {0} over {1}".format(t, self._array_types))
self.logger.debug(
"Datatype has been matched: {0} over {1}".format(
t, self._array_types
)
)
assert m is not None
if v is not None:
if len(m) > len(v):
self.logger.debug("Metadata {0} is longer than values {1}".format(len(m), len(v)))
self.logger.debug(
"Metadata {0} is longer than values {1}".format(
len(m), len(v)
)
)
v = list(v) + [None] * (len(m) - len(v))
assert len(m) == len(v)
if merge_key:
Expand Down

0 comments on commit ef661d8

Please sign in to comment.