Skip to content

Commit 0f497b0

Browse files
authored
bugfix/ads_opctl_build_image (#460)
1 parent 2060741 commit 0f497b0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ads/opctl/utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,16 @@ def build_image(image_type: str, gpu: bool = False) -> None:
150150
else:
151151
# https://stackoverflow.com/questions/66842004/get-the-processor-type-using-python-for-apple-m1-processor-gives-me-an-intel-pro
152152
import cpuinfo
153+
153154
# Just get the manufacturer of the processors
154-
manufacturer = cpuinfo.get_cpu_info().get('brand_raw')
155-
arch = 'arm' if re.search("apple m\d ", manufacturer, re.IGNORECASE) else 'other'
155+
manufacturer = cpuinfo.get_cpu_info().get("brand_raw")
156+
arch = (
157+
"arm" if re.search("apple m\d ", manufacturer, re.IGNORECASE) else "other"
158+
)
156159
print(f"The local machine's platform is {arch}.")
157-
image, dockerfile, target = _get_image_name_dockerfile_target(image_type, gpu, arch)
160+
image, dockerfile, target = _get_image_name_dockerfile_target(
161+
image_type, gpu, arch
162+
)
158163
print(f"dockerfile used is {dockerfile}")
159164
command = [
160165
"docker",
@@ -186,8 +191,6 @@ def _get_image_name_dockerfile_target(type: str, gpu: bool, arch: str) -> str:
186191
("job-local", False, "arm"): (ML_JOB_IMAGE, "Dockerfile.job.arm", None),
187192
("job-local", False, "other"): (ML_JOB_IMAGE, "Dockerfile.job", None),
188193
("job-local", True, "other"): (ML_JOB_GPU_IMAGE, "Dockerfile.job.gpu", None),
189-
("ads-ops-base", False, "other"): (OPS_IMAGE_BASE, "Dockerfile", "base"),
190-
("ads-ops-base", True, "other"): (OPS_IMAGE_GPU_BASE, "Dockerfile.gpu", "base"),
191194
}
192195
return look_up[(type, gpu, arch)]
193196

0 commit comments

Comments
 (0)