Skip to content

Commit 1f08bec

Browse files
committed
changes
1 parent 753a496 commit 1f08bec

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

devtools/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ shell: setup-tilt
250250
"$$user_shell" -i; \
251251
fi'
252252

253-
# TODO: This can be done away with in a while since we now have metaflow-dev command.
254-
#
253+
255254
# @echo '$(MAKE_CMD) create-dev-shell' >> $(DEVTOOLS_DIR)/start.sh
256255
# @echo 'rm -f /tmp/metaflow-devshell-*' >> $(DEVTOOLS_DIR)/start.sh
257256
create-dev-shell: setup-tilt

devtools/Tiltfile

+13
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ if "minio" in enabled_components:
9999
set=[
100100
'rootUser=rootuser',
101101
'rootPassword=rootpass123',
102+
# TODO: perturb the bucket name to avoid conflicts
102103
'buckets[0].name=metaflow-test',
103104
'buckets[0].policy=none',
104105
'buckets[0].purge=false',
@@ -600,6 +601,18 @@ if "ui" in enabled_components:
600601
config_resources.append('metaflow-ui')
601602
config_resources.append('metaflow-ui-static')
602603

604+
cmd = '''
605+
ARCH=$(kubectl get nodes -o jsonpath='{.items[0].status.nodeInfo.architecture}')
606+
case "$ARCH" in
607+
arm64) echo linux-aarch64 ;;
608+
amd64) echo linux-64 ;;
609+
*) echo linux-64 ;;
610+
esac
611+
'''
612+
613+
# For @conda/@pypi emulation
614+
metaflow_config["METAFLOW_KUBERNETES_CONDA_ARCH"] = str(local(cmd)).strip()
615+
603616
local_resource(
604617
name="generate-configs",
605618
cmd=write_config_files(),

metaflow/metaflow_config.py

+2
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@
381381
# Default kubernetes QoS class
382382
KUBERNETES_QOS = from_conf("KUBERNETES_QOS", "burstable")
383383

384+
# Architecture of kubernetes nodes - used for @conda/@pypi in metaflow-dev
385+
KUBERNETES_CONDA_ARCH = from_conf("KUBERNETES_CONDA_ARCH")
384386
ARGO_WORKFLOWS_KUBERNETES_SECRETS = from_conf("ARGO_WORKFLOWS_KUBERNETES_SECRETS", "")
385387
ARGO_WORKFLOWS_ENV_VARS_TO_SKIP = from_conf("ARGO_WORKFLOWS_ENV_VARS_TO_SKIP", "")
386388

metaflow/plugins/kubernetes/kubernetes_decorator.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
KUBERNETES_SHARED_MEMORY,
3030
KUBERNETES_TOLERATIONS,
3131
KUBERNETES_QOS,
32+
KUBERNETES_CONDA_ARCH,
3233
)
3334
from metaflow.plugins.resources_decorator import ResourcesDecorator
3435
from metaflow.plugins.timeout_decorator import get_run_time_limit_for_task
@@ -158,7 +159,7 @@ class KubernetesDecorator(StepDecorator):
158159

159160
# Conda environment support
160161
supports_conda_environment = True
161-
target_platform = "linux-aarch64"
162+
target_platform = KUBERNETES_CONDA_ARCH or "linux-64"
162163

163164
def init(self):
164165
super(KubernetesDecorator, self).init()

metaflow/plugins/pypi/conda_environment.py

-2
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ def get_environment(self, step):
315315
# 5. All resolved packages (Conda or PyPI) are cached
316316
# 6. PyPI packages are only installed for local platform
317317

318-
# Resolve `linux-64` Conda environments if @batch or @kubernetes are in play
319318
target_platform = conda_platform()
320319
for decorator in step.decorators:
321320
# NOTE: Keep the list of supported decorator names for backward compatibility purposes.
@@ -329,7 +328,6 @@ def get_environment(self, step):
329328
"snowpark",
330329
"slurm",
331330
]:
332-
# TODO: Support arm architectures
333331
target_platform = getattr(decorator, "target_platform", "linux-64")
334332
break
335333

0 commit comments

Comments
 (0)