mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-16 06:22:56 +00:00
Fix applying tags in local development (#1939)
This commit is contained in:
4
Makefile
4
Makefile
@@ -69,8 +69,8 @@ linkcheck-docs: ## check broken links
|
|||||||
|
|
||||||
hook/%: ## run post-build hooks for an image
|
hook/%: ## run post-build hooks for an image
|
||||||
python3 -m tagging.write_tags_file --short-image-name "$(notdir $@)" --tags-dir /tmp/jupyter/tags/ --owner "$(OWNER)" && \
|
python3 -m tagging.write_tags_file --short-image-name "$(notdir $@)" --tags-dir /tmp/jupyter/tags/ --owner "$(OWNER)" && \
|
||||||
python3 -m tagging.apply_tags --short-image-name "$(notdir $@)" --tags-dir /tmp/jupyter/tags/ --platform "$(shell uname -m)" --owner "$(OWNER)" && \
|
python3 -m tagging.write_manifest --short-image-name "$(notdir $@)" --hist-line-dir /tmp/jupyter/hist_lines/ --manifest-dir /tmp/jupyter/manifests/ --owner "$(OWNER)" && \
|
||||||
python3 -m tagging.write_manifest --short-image-name "$(notdir $@)" --hist-line-dir /tmp/jupyter/hist_lines/ --manifest-dir /tmp/jupyter/manifests/ --owner "$(OWNER)"
|
python3 -m tagging.apply_tags --short-image-name "$(notdir $@)" --tags-dir /tmp/jupyter/tags/ --platform "$(shell uname -m)" --owner "$(OWNER)"
|
||||||
hook-all: $(foreach I, $(ALL_IMAGES), hook/$(I)) ## run post-build hooks for all images
|
hook-all: $(foreach I, $(ALL_IMAGES), hook/$(I)) ## run post-build hooks for all images
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,6 +7,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import plumbum
|
import plumbum
|
||||||
|
|
||||||
|
from tagging.get_platform import unify_aarch64
|
||||||
|
|
||||||
docker = plumbum.local["docker"]
|
docker = plumbum.local["docker"]
|
||||||
|
|
||||||
LOGGER = logging.getLogger(__name__)
|
LOGGER = logging.getLogger(__name__)
|
||||||
@@ -55,7 +57,7 @@ if __name__ == "__main__":
|
|||||||
"--platform",
|
"--platform",
|
||||||
required=True,
|
required=True,
|
||||||
type=str,
|
type=str,
|
||||||
choices=["x86_64", "aarch64"],
|
choices=["x86_64", "aarch64", "arm64"],
|
||||||
help="Image platform",
|
help="Image platform",
|
||||||
)
|
)
|
||||||
arg_parser.add_argument(
|
arg_parser.add_argument(
|
||||||
@@ -64,5 +66,6 @@ if __name__ == "__main__":
|
|||||||
help="Owner of the image",
|
help="Owner of the image",
|
||||||
)
|
)
|
||||||
args = arg_parser.parse_args()
|
args = arg_parser.parse_args()
|
||||||
|
args.platform = unify_aarch64(args.platform)
|
||||||
|
|
||||||
apply_tags(args.short_image_name, args.owner, args.tags_dir, args.platform)
|
apply_tags(args.short_image_name, args.owner, args.tags_dir, args.platform)
|
||||||
|
@@ -5,10 +5,14 @@ import platform
|
|||||||
ALL_PLATFORMS = {"x86_64", "aarch64"}
|
ALL_PLATFORMS = {"x86_64", "aarch64"}
|
||||||
|
|
||||||
|
|
||||||
def get_platform() -> str:
|
def unify_aarch64(platform: str) -> str:
|
||||||
machine = platform.machine()
|
|
||||||
return {
|
return {
|
||||||
"aarch64": "aarch64",
|
"aarch64": "aarch64",
|
||||||
"arm64": "aarch64", # To support local building on aarch64 Macs
|
"arm64": "aarch64", # To support local building on aarch64 Macs
|
||||||
"x86_64": "x86_64",
|
"x86_64": "x86_64",
|
||||||
}[machine]
|
}[platform]
|
||||||
|
|
||||||
|
|
||||||
|
def get_platform() -> str:
|
||||||
|
machine = platform.machine()
|
||||||
|
return unify_aarch64(machine)
|
||||||
|
Reference in New Issue
Block a user