3v324v23 commited on
Commit
deea2e4
·
1 Parent(s): 566e936

rclone and root default

Browse files
.history/Dockerfile_20240520143908 ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.3.1-base-ubuntu20.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Paris
4
+
5
+ # Remove any third-party apt sources to avoid issues with expiring keys.
6
+ # Install some basic utilities
7
+ RUN rm -f /etc/apt/sources.list.d/*.list && \
8
+ apt-get update && apt-get install -y --no-install-recommends \
9
+ curl \
10
+ ca-certificates \
11
+ sudo \
12
+ git \
13
+ git-lfs \
14
+ zip \
15
+ unzip \
16
+ htop \
17
+ bzip2 \
18
+ libx11-6 \
19
+ build-essential \
20
+ libsndfile-dev \
21
+ software-properties-common \
22
+ openssh-server \
23
+ fuse \
24
+ && rm -rf /var/lib/apt/lists/*
25
+
26
+ # Install rclone
27
+ RUN curl https://rclone.org/install.sh | bash
28
+
29
+ RUN add-apt-repository ppa:flexiondotorg/nvtop && \
30
+ apt-get upgrade -y && \
31
+ apt-get install -y --no-install-recommends nvtop
32
+
33
+ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
34
+ apt-get install -y nodejs && \
35
+ npm install -g configurable-http-proxy
36
+
37
+ # Set up the Conda environment
38
+ ENV CONDA_AUTO_UPDATE_CONDA=false \
39
+ PATH=/root/miniconda/bin:$PATH
40
+ RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
41
+ && chmod +x ~/miniconda.sh \
42
+ && ~/miniconda.sh -b -p /root/miniconda \
43
+ && rm ~/miniconda.sh \
44
+ && conda clean -ya
45
+
46
+ WORKDIR /root/app
47
+
48
+ # Python packages
49
+ RUN --mount=target=requirements.txt,source=requirements.txt \
50
+ pip install --no-cache-dir --upgrade -r requirements.txt
51
+
52
+ # Copy the current directory contents into the container at /root/app
53
+ COPY . /root/app
54
+
55
+ RUN chmod +x start_server.sh
56
+
57
+ COPY login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
58
+
59
+ # Set dark theme for JupyterLab
60
+ RUN mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
61
+ echo '{ "theme": "JupyterLab Dark" }' > /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings
62
+
63
+ ENV PYTHONUNBUFFERED=1 \
64
+ GRADIO_ALLOW_FLAGGING=never \
65
+ GRADIO_NUM_PORTS=1 \
66
+ GRADIO_SERVER_NAME=0.0.0.0 \
67
+ GRADIO_THEME=huggingface \
68
+ SYSTEM=spaces \
69
+ SHELL=/bin/bash
70
+
71
+ CMD ["./start_server.sh"]
.history/Dockerfile_20240520144314 ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.3.1-base-ubuntu20.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Paris
4
+
5
+ # Remove any third-party apt sources to avoid issues with expiring keys.
6
+ # Install some basic utilities
7
+ RUN rm -f /etc/apt/sources.list.d/*.list && \
8
+ apt-get update && apt-get install -y --no-install-recommends \
9
+ curl \
10
+ ca-certificates \
11
+ sudo \
12
+ git \
13
+ git-lfs \
14
+ zip \
15
+ unzip \
16
+ htop \
17
+ bzip2 \
18
+ libx11-6 \
19
+ build-essential \
20
+ libsndfile-dev \
21
+ software-properties-common \
22
+ openssh-server \
23
+ fuse \
24
+ && rm -rf /var/lib/apt/lists/*
25
+
26
+ # Install rclone
27
+ RUN curl https://rclone.org/install.sh | bash
28
+
29
+ RUN add-apt-repository ppa:flexiondotorg/nvtop && \
30
+ apt-get upgrade -y && \
31
+ apt-get install -y --no-install-recommends nvtop
32
+
33
+ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
34
+ apt-get install -y nodejs && \
35
+ npm install -g configurable-http-proxy
36
+
37
+ # Set up the Conda environment
38
+ ENV CONDA_AUTO_UPDATE_CONDA=false \
39
+ PATH=/root/miniconda/bin:$PATH
40
+ RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
41
+ && chmod +x ~/miniconda.sh \
42
+ && ~/miniconda.sh -b -p /root/miniconda \
43
+ && rm ~/miniconda.sh \
44
+ && conda clean -ya
45
+
46
+ WORKDIR /root/app
47
+
48
+ # Python packages
49
+ RUN --mount=target=requirements.txt,source=requirements.txt \
50
+ pip install --no-cache-dir --upgrade -r requirements.txt
51
+
52
+ # Copy the current directory contents into the container at /root/app
53
+ COPY . /root/app
54
+
55
+ RUN chmod +x start_server.sh
56
+
57
+ COPY login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
58
+
59
+ # Set dark theme for JupyterLab
60
+ RUN mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
61
+ echo '{ "theme": "JupyterLab Dark" }' > /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings
62
+
63
+ ENV PYTHONUNBUFFERED=1 \
64
+ GRADIO_ALLOW_FLAGGING=never \
65
+ GRADIO_NUM_PORTS=1 \
66
+ GRADIO_SERVER_NAME=0.0.0.0 \
67
+ GRADIO_THEME=huggingface \
68
+ SYSTEM=spaces \
69
+ SHELL=/bin/bash
70
+
71
+ CMD ["./start_server.sh"]
.history/start_server_20240520012211.sh ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
3
+
4
+ echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
5
+
6
+ NOTEBOOK_DIR="/data"
7
+
8
+ jupyter-lab \
9
+ --ip 0.0.0.0 \
10
+ --port 7860 \
11
+ --no-browser \
12
+ --allow-root \
13
+ --ServerApp.token="$JUPYTER_TOKEN" \
14
+ --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
15
+ --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
16
+ --ServerApp.disable_check_xsrf=True \
17
+ --LabApp.news_url=None \
18
+ --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
19
+ --notebook-dir=$NOTEBOOK_DIR
.history/start_server_20240520143920.sh ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
3
+
4
+ echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
5
+
6
+ NOTEBOOK_DIR="/data"
7
+
8
+ # Mount Google Drive
9
+ rclone mount gdrive: /root/GoogleDrive --daemon
10
+
11
+ jupyter-lab \
12
+ --ip 0.0.0.0 \
13
+ --port 7860 \
14
+ --no-browser \
15
+ --allow-root \
16
+ --ServerApp.token="$JUPYTER_TOKEN" \
17
+ --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
18
+ --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
19
+ --ServerApp.disable_check_xsrf=True \
20
+ --LabApp.news_url=None \
21
+ --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
22
+ --notebook-dir=$NOTEBOOK_DIR
.history/start_server_20240520144328.sh ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
3
+
4
+ echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
5
+
6
+ NOTEBOOK_DIR="/data"
7
+
8
+ # Mount Google Drive
9
+ rclone mount gdrive: /root/GoogleDrive --daemon
10
+
11
+ jupyter-lab \
12
+ --ip 0.0.0.0 \
13
+ --port 7860 \
14
+ --no-browser \
15
+ --allow-root \
16
+ --ServerApp.token="$JUPYTER_TOKEN" \
17
+ --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
18
+ --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
19
+ --ServerApp.disable_check_xsrf=True \
20
+ --LabApp.news_url=None \
21
+ --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
22
+ --notebook-dir=$NOTEBOOK_DIR
Dockerfile CHANGED
@@ -20,83 +20,45 @@ RUN rm -f /etc/apt/sources.list.d/*.list && \
20
  libsndfile-dev \
21
  software-properties-common \
22
  openssh-server \
 
23
  && rm -rf /var/lib/apt/lists/*
24
 
 
 
 
25
  RUN add-apt-repository ppa:flexiondotorg/nvtop && \
26
  apt-get upgrade -y && \
27
  apt-get install -y --no-install-recommends nvtop
28
 
29
- RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
30
  apt-get install -y nodejs && \
31
  npm install -g configurable-http-proxy
32
 
33
- # Create a working directory
34
- WORKDIR /app
35
-
36
- # Create a non-root user and switch to it
37
- RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
38
- && chown -R user:user /app
39
- RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
40
-
41
- # Enable sudo for user
42
- RUN chmod 4755 /usr/bin/sudo
43
-
44
- USER user
45
-
46
- # All users can use /home/user as their home directory
47
- ENV HOME=/home/user
48
- RUN mkdir $HOME/.cache $HOME/.config \
49
- && chmod -R 777 $HOME
50
-
51
  # Set up the Conda environment
52
  ENV CONDA_AUTO_UPDATE_CONDA=false \
53
- PATH=$HOME/miniconda/bin:$PATH
54
  RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
55
  && chmod +x ~/miniconda.sh \
56
- && ~/miniconda.sh -b -p ~/miniconda \
57
  && rm ~/miniconda.sh \
58
  && conda clean -ya
59
 
60
- WORKDIR $HOME/app
61
-
62
- #######################################
63
- # Start root user section
64
- #######################################
65
-
66
- USER root
67
-
68
- # User Debian packages
69
- ## Security warning : Potential user code executed as root (build time)
70
- RUN --mount=target=/root/packages.txt,source=packages.txt \
71
- apt-get update && \
72
- xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
73
- && rm -rf /var/lib/apt/lists/*
74
-
75
- RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
76
- bash /root/on_startup.sh
77
-
78
- RUN mkdir /data && chown user:user /data
79
-
80
- #######################################
81
- # End root user section
82
- #######################################
83
-
84
- USER user
85
 
86
  # Python packages
87
  RUN --mount=target=requirements.txt,source=requirements.txt \
88
  pip install --no-cache-dir --upgrade -r requirements.txt
89
 
90
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
91
- COPY --chown=user . $HOME/app
92
 
93
  RUN chmod +x start_server.sh
94
 
95
- COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
96
 
97
  # Set dark theme for JupyterLab
98
- RUN mkdir -p $HOME/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
99
- echo '{ "theme": "JupyterLab Dark" }' > $HOME/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings
100
 
101
  ENV PYTHONUNBUFFERED=1 \
102
  GRADIO_ALLOW_FLAGGING=never \
 
20
  libsndfile-dev \
21
  software-properties-common \
22
  openssh-server \
23
+ fuse \
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
+ # Install rclone
27
+ RUN curl https://rclone.org/install.sh | bash
28
+
29
  RUN add-apt-repository ppa:flexiondotorg/nvtop && \
30
  apt-get upgrade -y && \
31
  apt-get install -y --no-install-recommends nvtop
32
 
33
+ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
34
  apt-get install -y nodejs && \
35
  npm install -g configurable-http-proxy
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  # Set up the Conda environment
38
  ENV CONDA_AUTO_UPDATE_CONDA=false \
39
+ PATH=/root/miniconda/bin:$PATH
40
  RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
41
  && chmod +x ~/miniconda.sh \
42
+ && ~/miniconda.sh -b -p /root/miniconda \
43
  && rm ~/miniconda.sh \
44
  && conda clean -ya
45
 
46
+ WORKDIR /root/app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  # Python packages
49
  RUN --mount=target=requirements.txt,source=requirements.txt \
50
  pip install --no-cache-dir --upgrade -r requirements.txt
51
 
52
+ # Copy the current directory contents into the container at /root/app
53
+ COPY . /root/app
54
 
55
  RUN chmod +x start_server.sh
56
 
57
+ COPY login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
58
 
59
  # Set dark theme for JupyterLab
60
+ RUN mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
61
+ echo '{ "theme": "JupyterLab Dark" }' > /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings
62
 
63
  ENV PYTHONUNBUFFERED=1 \
64
  GRADIO_ALLOW_FLAGGING=never \
start_server.sh CHANGED
@@ -5,6 +5,9 @@ echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
5
 
6
  NOTEBOOK_DIR="/data"
7
 
 
 
 
8
  jupyter-lab \
9
  --ip 0.0.0.0 \
10
  --port 7860 \
 
5
 
6
  NOTEBOOK_DIR="/data"
7
 
8
+ # Mount Google Drive
9
+ rclone mount gdrive: /root/GoogleDrive --daemon
10
+
11
  jupyter-lab \
12
  --ip 0.0.0.0 \
13
  --port 7860 \