From e6937e884be0bfcbf1aeec9d51e6d2791883b424 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Wed, 15 May 2024 19:41:45 -0400 Subject: [PATCH] fix symlinks for axolotl outputs (#1625) --- docker/Dockerfile-cloud | 4 +--- outputs/.gitignore | 1 - scripts/cloud-entrypoint.sh | 7 +++++++ 3 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 outputs/.gitignore diff --git a/docker/Dockerfile-cloud b/docker/Dockerfile-cloud index cc8c58415..69ce143bb 100644 --- a/docker/Dockerfile-cloud +++ b/docker/Dockerfile-cloud @@ -21,9 +21,7 @@ RUN apt install --yes --no-install-recommends openssh-server tmux && \ printf "\n[[ -z \"\$TMUX\" ]] && { tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux; exit; }\n" >> ~/.bashrc && \ printf "[ ! -z \"\$TERM\" -a -r /etc/motd ] && cat /etc/motd\n" >> ~/.bashrc && \ chmod +x /workspace/axolotl/scripts/cloud-entrypoint.sh && \ - chmod +x /root/cloud-entrypoint.sh && \ - mkdir -p /workspace/data/axolotl-artifacts && \ - ln -sf /workspace/data/axolotl-artifacts /workspace/axolotl/outputs + chmod +x /root/cloud-entrypoint.sh ENTRYPOINT ["/root/cloud-entrypoint.sh"] CMD ["sleep", "infinity"] diff --git a/outputs/.gitignore b/outputs/.gitignore deleted file mode 100644 index 72e8ffc0d..000000000 --- a/outputs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/scripts/cloud-entrypoint.sh b/scripts/cloud-entrypoint.sh index 3a15a884a..0d4021336 100755 --- a/scripts/cloud-entrypoint.sh +++ b/scripts/cloud-entrypoint.sh @@ -36,5 +36,12 @@ if [ "$JUPYTER_DISABLE" != "1" ]; then jupyter lab --port=8888 --ip=* --allow-root --ServerApp.allow_origin=* & fi +if [ ! -d "/workspace/data/axolotl-artifacts" ]; then + mkdir -p /workspace/data/axolotl-artifacts +fi +if [ ! -L "/workspace/axolotl/outputs" ]; then + ln -sf /workspace/data/axolotl-artifacts /workspace/axolotl/outputs +fi + # Execute the passed arguments (CMD) exec "$@"