skypilot-org / skypilot

SkyPilot: Run AI and batch jobs on any infra (Kubernetes or 12+ clouds). Get unified execution, cost savings, and high GPU availability via a simple interface.
https://skypilot.readthedocs.io
Apache License 2.0
6.78k stars 509 forks source link

[docker] Custom environment variables defined in docker image are not populated #3321

Closed romilbhardwaj closed 3 months ago

romilbhardwaj commented 8 months ago

Repro

Specify dockerfile:

# Dockerfile
FROM continuumio/miniconda3:23.3.1-0

ENV GIT_SSH_COMMAND="ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa"

Build image:

docker buildx build --push --platform linux/amd64,linux/arm64 -t myrepo/customenv:latest -f Dockerfile_test .

Launch cluster on GCP using this image:

sky launch -c customenv --cloud gcp --image-id docker:myrepo/customenv:latest -- 'echo ${GIT_SSH_COMMAND};printenv'

Output (doesn't contain GIT_SSH_COMMAND):

(sky-cmd, pid=3169)
(sky-cmd, pid=3169) SHELL=/bin/bash
(sky-cmd, pid=3169) PYTHONUNBUFFERED=1
(sky-cmd, pid=3169) CONDA_EXE=/opt/conda/bin/conda
(sky-cmd, pid=3169) _CE_M=
(sky-cmd, pid=3169) SSH_AUTH_SOCK=/tmp/ssh-UraSdhFQrg/agent.2678
(sky-cmd, pid=3169) HABANA_VISIBLE_MODULES=
(sky-cmd, pid=3169) SKYPILOT_NODE_IPS=10.128.0.3
(sky-cmd, pid=3169) SKYPILOT_TASK_ID=sky-2024-03-17-15-18-42-337812_customenvgcp_id-1
(sky-cmd, pid=3169) TPU_VISIBLE_CHIPS=
(sky-cmd, pid=3169) PWD=/root/sky_workdir
(sky-cmd, pid=3169) LOGNAME=root
(sky-cmd, pid=3169) CONDA_PREFIX=/opt/conda
(sky-cmd, pid=3169) ASCEND_VISIBLE_DEVICES=
(sky-cmd, pid=3169) RAY_RAYLET_PID=2829
(sky-cmd, pid=3169) RAY_SCHEDULER_EVENTS=0
(sky-cmd, pid=3169) RAY_CLIENT_MODE=0
(sky-cmd, pid=3169) MOTD_SHOWN=pam
(sky-cmd, pid=3169) RAY_JOB_ID=ffffffff
(sky-cmd, pid=3169) HOME=/root
(sky-cmd, pid=3169) LANG=en_US.UTF-8
(sky-cmd, pid=3169) SKY_NUM_GPUS_PER_NODE=0
(sky-cmd, pid=3169) RAY_USAGE_STATS_ENABLED=0
(sky-cmd, pid=3169) CONDA_PROMPT_MODIFIER=(base)
(sky-cmd, pid=3169) LC_TERMINAL=iTerm2
(sky-cmd, pid=3169) SKY_NODE_IPS=10.128.0.3
(sky-cmd, pid=3169) SSH_CONNECTION=::1 42072 ::1 10022
(sky-cmd, pid=3169) SPT_NOENV=1
(sky-cmd, pid=3169) CUDA_VISIBLE_DEVICES=
(sky-cmd, pid=3169) SKYPILOT_NODE_RANK=0
(sky-cmd, pid=3169) _CE_CONDA=
(sky-cmd, pid=3169) SKY_NODE_RANK=0
(sky-cmd, pid=3169) SKYPILOT_NUM_GPUS_PER_NODE=0
(sky-cmd, pid=3169) NEURON_RT_VISIBLE_CORES=
(sky-cmd, pid=3169) USER=root
(sky-cmd, pid=3169) CONDA_SHLVL=1
(sky-cmd, pid=3169) LC_TERMINAL_VERSION=3.4.23
(sky-cmd, pid=3169) SHLVL=3
(sky-cmd, pid=3169) SKYPILOT_INTERNAL_JOB_ID=1
(sky-cmd, pid=3169) CONDA_PYTHON_EXE=/opt/conda/bin/python
(sky-cmd, pid=3169) LC_CTYPE=C.UTF-8
(sky-cmd, pid=3169) PYTHONBREAKPOINT=ray.util.rpdb.set_trace
(sky-cmd, pid=3169) SSH_CLIENT=::1 42072 10022
(sky-cmd, pid=3169) CONDA_DEFAULT_ENV=base
(sky-cmd, pid=3169) OMP_NUM_THREADS=1
(sky-cmd, pid=3169) PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
(sky-cmd, pid=3169) SKY_INTERNAL_JOB_ID=1
(sky-cmd, pid=3169) PYTHONWARNINGS=ignore
(sky-cmd, pid=3169) RAY_DEDUP_LOGS=0
(sky-cmd, pid=3169) RAY_LD_PRELOAD=1
(sky-cmd, pid=3169) DEBIAN_FRONTEND=noninteractive
(sky-cmd, pid=3169) OLDPWD=/root
(sky-cmd, pid=3169) BASH_FUNC_conda%%=() {  \local cmd="${1-__missing__}";
(sky-cmd, pid=3169)  case "$cmd" in
(sky-cmd, pid=3169)  activate | deactivate)
(sky-cmd, pid=3169)  __conda_activate "$@"
(sky-cmd, pid=3169)  ;;
(sky-cmd, pid=3169)  install | update | upgrade | remove | uninstall)
(sky-cmd, pid=3169)  __conda_exe "$@" || \return;
(sky-cmd, pid=3169)  __conda_reactivate
(sky-cmd, pid=3169)  ;;
(sky-cmd, pid=3169)  *)
(sky-cmd, pid=3169)  __conda_exe "$@"
(sky-cmd, pid=3169)  ;;
(sky-cmd, pid=3169)  esac
(sky-cmd, pid=3169) }
(sky-cmd, pid=3169) BASH_FUNC___conda_exe%%=() {  ( "$CONDA_EXE" $_CE_M $_CE_CONDA "$@" )
(sky-cmd, pid=3169) }
(sky-cmd, pid=3169) BASH_FUNC___conda_reactivate%%=() {  \local ask_conda;
(sky-cmd, pid=3169)  ask_conda="$(PS1="${PS1:-}" __conda_exe shell.posix reactivate)" || \return;
(sky-cmd, pid=3169)  \eval "$ask_conda";
(sky-cmd, pid=3169)  __conda_hashr
(sky-cmd, pid=3169) }
(sky-cmd, pid=3169) BASH_FUNC___conda_hashr%%=() {  if [ -n "${ZSH_VERSION:+x}" ]; then
(sky-cmd, pid=3169)  \rehash;
(sky-cmd, pid=3169)  else
(sky-cmd, pid=3169)  if [ -n "${POSH_VERSION:+x}" ]; then
(sky-cmd, pid=3169)  :;
(sky-cmd, pid=3169)  else
(sky-cmd, pid=3169)  \hash -r;
(sky-cmd, pid=3169)  fi;
(sky-cmd, pid=3169)  fi
(sky-cmd, pid=3169) }
(sky-cmd, pid=3169) BASH_FUNC___conda_activate%%=() {  if [ -n "${CONDA_PS1_BACKUP:+x}" ]; then
(sky-cmd, pid=3169)  PS1="$CONDA_PS1_BACKUP";
(sky-cmd, pid=3169)  \unset CONDA_PS1_BACKUP;
(sky-cmd, pid=3169)  fi;
(sky-cmd, pid=3169)  \local ask_conda;
(sky-cmd, pid=3169)  ask_conda="$(PS1="${PS1:-}" __conda_exe shell.posix "$@")" || \return;
(sky-cmd, pid=3169)  \eval "$ask_conda";
(sky-cmd, pid=3169)  __conda_hashr
(sky-cmd, pid=3169) }
(sky-cmd, pid=3169) _=/usr/bin/printenv
github-actions[bot] commented 4 months ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 10 days with no activity.