winglian commited on
Commit
729740d
1 Parent(s): 08b8ba0

Dockerfile cloud ports (#1148)

Browse files

* explicitly expose ports 8888 and 22

* support for SSH_KEY from latitude

docker/Dockerfile-cloud CHANGED
@@ -7,6 +7,9 @@ ENV TRANSFORMERS_CACHE="/workspace/data/huggingface-cache/hub"
7
  ENV HF_HOME="/workspace/data/huggingface-cache/hub"
8
  ENV HF_HUB_ENABLE_HF_TRANSFER="1"
9
 
 
 
 
10
  COPY scripts/cloud-entrypoint.sh /root/cloud-entrypoint.sh
11
 
12
  RUN pip install jupyterlab notebook && \
 
7
  ENV HF_HOME="/workspace/data/huggingface-cache/hub"
8
  ENV HF_HUB_ENABLE_HF_TRANSFER="1"
9
 
10
+ EXPOSE 8888
11
+ EXPOSE 22
12
+
13
  COPY scripts/cloud-entrypoint.sh /root/cloud-entrypoint.sh
14
 
15
  RUN pip install jupyterlab notebook && \
scripts/cloud-entrypoint.sh CHANGED
@@ -7,14 +7,24 @@ echo 'source /etc/rp_environment' >> ~/.bashrc
7
 
8
  if [[ $PUBLIC_KEY ]]
9
  then
 
10
  mkdir -p ~/.ssh
11
  chmod 700 ~/.ssh
12
  echo $PUBLIC_KEY >> ~/.ssh/authorized_keys
13
  chmod 700 -R ~/.ssh
14
  # Start the SSH service in the background
15
  service ssh start
 
 
 
 
 
 
 
 
 
16
  else
17
- echo "No PUBLIC_KEY ENV variable provided, not starting openSSH daemon"
18
  fi
19
 
20
  # Check if JUPYTER_PASSWORD is set and not empty
 
7
 
8
  if [[ $PUBLIC_KEY ]]
9
  then
10
+ # runpod
11
  mkdir -p ~/.ssh
12
  chmod 700 ~/.ssh
13
  echo $PUBLIC_KEY >> ~/.ssh/authorized_keys
14
  chmod 700 -R ~/.ssh
15
  # Start the SSH service in the background
16
  service ssh start
17
+ elif [[ $SSH_KEY ]]
18
+ then
19
+ # latitude.sh
20
+ mkdir -p ~/.ssh
21
+ chmod 700 ~/.ssh
22
+ echo $SSH_KEY >> ~/.ssh/authorized_keys
23
+ chmod 700 -R ~/.ssh
24
+ # Start the SSH service in the background
25
+ service ssh start
26
  else
27
+ echo "No PUBLIC_KEY or SSH_KEY environment variable provided, not starting openSSH daemon"
28
  fi
29
 
30
  # Check if JUPYTER_PASSWORD is set and not empty