Skip to content

Commit

Permalink
fix(BA-484): Missing architceture name lookup in LocalRegistry (#3420)
Browse files Browse the repository at this point in the history
Co-authored-by: octodog <[email protected]>
  • Loading branch information
achimnol and lablup-octodog authored Jan 9, 2025
1 parent 94a0c3e commit c9b342f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/3420.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix missing CPU architecture name lookup in `LocalRegistry` to directly scan and load container images from the local Docker daemon in dev setups
6 changes: 3 additions & 3 deletions src/ai/backend/manager/container_registry/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import sqlalchemy as sa
import yarl

from ai.backend.common.docker import get_docker_connector
from ai.backend.common.docker import arch_name_aliases, get_docker_connector
from ai.backend.logging import BraceStyleAdapter

from ..models.image import ImageRow
Expand Down Expand Up @@ -71,13 +71,13 @@ async def _read_image_info(
self.registry_url / "images" / f"{image}:{digest}" / "json"
) as response:
data = await response.json()
architecture = data["Architecture"]
architecture = arch_name_aliases.get(data["Architecture"], data["Architecture"])
summary = {
"Id": data["Id"],
"RepoDigests": data.get("RepoDigests", []),
"Config.Image": data["Config"]["Image"],
"ContainerConfig.Image": data.get("ContainerConfig", {}).get("Image", None),
"Architecture": data["Architecture"],
"Architecture": architecture,
}
log.debug("scanned image info: {}:{}\n{}", image, digest, json.dumps(summary, indent=2))
already_exists = 0
Expand Down

0 comments on commit c9b342f

Please sign in to comment.