Jerry75AI commited on
Commit
d05f81e
·
verified ·
1 Parent(s): 6b5ad06

Upload 6 files

Browse files
Files changed (6) hide show
  1. Dockerfile +34 -36
  2. README.md +0 -5
  3. config.toml +7 -0
  4. login.html +3 -22
  5. requirements.txt +5 -2
  6. start_server.sh +2 -2
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  TZ=Europe/Paris
@@ -7,32 +7,23 @@ ENV DEBIAN_FRONTEND=noninteractive \
7
  # Install some basic utilities
8
  RUN rm -f /etc/apt/sources.list.d/*.list && \
9
  apt-get update && apt-get install -y --no-install-recommends \
10
- curl \
11
- ca-certificates \
12
- sudo \
13
- git \
14
- wget \
15
- procps \
16
- git-lfs \
17
  zip \
18
  unzip \
19
- htop \
20
- vim \
21
- nano \
22
- bzip2 \
23
- libx11-6 \
24
- build-essential \
25
- libsndfile-dev \
26
- software-properties-common \
27
  && rm -rf /var/lib/apt/lists/*
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_21.x | bash - && \
34
  apt-get install -y nodejs && \
35
- npm install -g configurable-http-proxy
 
 
 
 
 
 
 
 
36
 
37
  # Create a working directory
38
  WORKDIR /app
@@ -45,16 +36,16 @@ 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
@@ -83,23 +74,30 @@ RUN mkdir /data && chown user:user /data
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
  ENV PYTHONUNBUFFERED=1 \
98
- GRADIO_ALLOW_FLAGGING=never \
99
- GRADIO_NUM_PORTS=1 \
100
- GRADIO_SERVER_NAME=0.0.0.0 \
101
- GRADIO_THEME=huggingface \
102
  SYSTEM=spaces \
103
  SHELL=/bin/bash
104
 
105
- CMD ["./start_server.sh"]
 
1
+ FROM nvidia/cuda:12.9.1-base-ubuntu20.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  TZ=Europe/Paris
 
7
  # Install some basic utilities
8
  RUN rm -f /etc/apt/sources.list.d/*.list && \
9
  apt-get update && apt-get install -y --no-install-recommends \
10
+ curl ca-certificates sudo git wget procps git-lfs htop vim nano bzip2 libx11-6 build-essential libsndfile-dev software-properties-common \
 
 
 
 
 
 
11
  zip \
12
  unzip \
 
 
 
 
 
 
 
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ RUN curl -fsSL https://get.pnpm.io/install.sh | bash && \
16
+ curl -sL https://deb.nodesource.com/setup_24.x | bash && \
 
 
 
17
  apt-get install -y nodejs && \
18
+ npm install -g configurable-http-proxy && \
19
+ dpkg --add-architecture i386 && \
20
+ apt update && \
21
+ apt install -y nsis lld llvm && \
22
+ apt install -y default-jdk openjdk-11-jdk openjdk-17-jdk openjdk-21-jdk default-jre openjdk-11-jre openjdk-17-jre openjdk-21-jre && \
23
+ apt install -y wimtools p7zip-full p7zip-rar mkisofs && \
24
+ apt install -y aptitude && \
25
+ aptitude install -y wine64 wine32 && \
26
+ aptitude install -y aria2
27
 
28
  # Create a working directory
29
  WORKDIR /app
 
36
 
37
  # All users can use /home/user as their home directory
38
  ENV HOME=/home/user
39
+ RUN mkdir $HOME/.cache $HOME/.config $HOME/.cargo $HOME/.xwin \
40
  && chmod -R 777 $HOME
41
 
42
  # Set up the Conda environment
43
  ENV CONDA_AUTO_UPDATE_CONDA=false \
44
+ PATH=$HOME/anaconda/bin:$PATH
45
+ RUN curl -sLo ~/anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2025.12-2-Linux-x86_64.sh \
46
+ && chmod +x ~/anaconda.sh \
47
+ && ~/anaconda.sh -b -p ~/anaconda \
48
+ && rm ~/anaconda.sh \
49
  && conda clean -ya
50
 
51
  WORKDIR $HOME/app
 
74
 
75
  USER user
76
 
77
+ ENV PATH="$HOME/.cargo/bin:$PATH"
78
+ RUN curl -LsSf https://astral.org.cn/uv/install.sh | bash && \
79
+ curl -fsSL https://bun.com/install | bash && \
80
+ curl -fsSL https://deno.land/install.sh | sh -s - -y && \
81
+ curl -fsSL https://pixi.sh/install.sh | bash && \
82
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s - --default-toolchain beta --profile complete -y && \
83
+ rustup target add x86_64-pc-windows-msvc && \
84
+ cargo install --locked cargo-xwin && \
85
+ cargo xwin cache xwin && \
86
+ cargo xwin cache windows-msvc-sysroot
87
+
88
  # Python packages
89
  RUN --mount=target=requirements.txt,source=requirements.txt \
90
  pip install --no-cache-dir --upgrade -r requirements.txt
91
 
92
+ COPY --chown=user start_server.sh $HOME/start_server.sh
 
93
 
94
  RUN chmod +x start_server.sh
95
 
96
+ COPY --chown=user login.html /home/user/anaconda/lib/python3.13/site-packages/jupyter_server/templates/login.html
97
+ COPY --chown=user config.toml /home/user/.cargo/config.toml
98
 
99
  ENV PYTHONUNBUFFERED=1 \
 
 
 
 
100
  SYSTEM=spaces \
101
  SHELL=/bin/bash
102
 
103
+ CMD ["../start_server.sh"]
README.md CHANGED
@@ -5,10 +5,5 @@ colorFrom: gray
5
  colorTo: green
6
  sdk: docker
7
  pinned: false
8
- tags:
9
- - jupyterlab
10
- suggested_storage: small
11
  license: mit
12
  ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
5
  colorTo: green
6
  sdk: docker
7
  pinned: false
 
 
 
8
  license: mit
9
  ---
 
 
config.toml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ [target.x86_64-pc-windows-msvc]
2
+ linker = "lld"
3
+ rustflags = [
4
+ "-Lnative=/home/user/.xwin/crt/lib/x86_64",
5
+ "-Lnative=/home/user/.xwin/sdk/lib/um/x86_64",
6
+ "-Lnative=/home/user/.xwin/sdk/lib/ucrt/x86_64"
7
+ ]
login.html CHANGED
@@ -1,18 +1,8 @@
1
  {% extends "page.html" %}
2
-
3
-
4
  {% block stylesheet %}
5
  {% endblock %}
6
-
7
  {% block site %}
8
-
9
- <div id="jupyter-main-app" class="container">
10
-
11
- <img src="https://huggingface.co/front/assets/huggingface_logo-noborder.svg" alt="Hugging Face Logo">
12
- <h4>Welcome to JupyterLab</h4>
13
-
14
- <h5>The default token is <span style="color:orange;">huggingface</span></h5>
15
-
16
  {% if login_available %}
17
  {# login_available means password-login is allowed. Show the form. #}
18
  <div class="row">
@@ -23,10 +13,10 @@
23
  <form action="{{base_url}}login?next={{next}}" method="post" class="navbar-form pull-left">
24
  {{ xsrf_form_html() | safe }}
25
  {% if token_available %}
26
- <label for="password_input"><strong>{% trans %}Jupyter token <span title="This is the secret you set up when deploying your JupyterLab space">ⓘ</span> {% endtrans
27
  %}</strong></label>
28
  {% else %}
29
- <label for="password_input"><strong>{% trans %}Jupyter password:{% endtrans %}</strong></label>
30
  {% endif %}
31
  <input type="password" name="password" id="password_input" class="form-control">
32
  <button type="submit" class="btn btn-default" id="login_submit">{% trans %}Log in{% endtrans
@@ -40,11 +30,6 @@
40
  {% else %}
41
  <p>{% trans %}No login available, you shouldn't be seeing this page.{% endtrans %}</p>
42
  {% endif %}
43
-
44
- <h5>If you don't have the credentials for this Jupyter space, <a target="_blank" href="https://huggingface.co/spaces/SpacesExamples/jupyterlab?duplicate=true">create your own.</a></h5>
45
- <br>
46
-
47
- <p>This template was created by <a href="https://twitter.com/camenduru" target="_blank" >camenduru</a> and <a href="https://huggingface.co/nateraw" target="_blank" >nateraw</a>, with contributions of <a href="https://huggingface.co/osanseviero" target="_blank" >osanseviero</a> and <a href="https://huggingface.co/azzr" target="_blank" >azzr</a> </p>
48
  {% if message %}
49
  <div class="row">
50
  {% for key in message %}
@@ -56,13 +41,9 @@
56
  {% endif %}
57
  {% if token_available %}
58
  {% block token_message %}
59
-
60
  {% endblock token_message %}
61
  {% endif %}
62
  </div>
63
-
64
  {% endblock %}
65
-
66
-
67
  {% block script %}
68
  {% endblock %}
 
1
  {% extends "page.html" %}
 
 
2
  {% block stylesheet %}
3
  {% endblock %}
 
4
  {% block site %}
5
+ <div id="jupyter-main-app" class="container">
 
 
 
 
 
 
 
6
  {% if login_available %}
7
  {# login_available means password-login is allowed. Show the form. #}
8
  <div class="row">
 
13
  <form action="{{base_url}}login?next={{next}}" method="post" class="navbar-form pull-left">
14
  {{ xsrf_form_html() | safe }}
15
  {% if token_available %}
16
+ <label for="password_input"><strong>{% trans %}密码:{% endtrans
17
  %}</strong></label>
18
  {% else %}
19
+ <label for="password_input"><strong>{% trans %}Password:{% endtrans %}</strong></label>
20
  {% endif %}
21
  <input type="password" name="password" id="password_input" class="form-control">
22
  <button type="submit" class="btn btn-default" id="login_submit">{% trans %}Log in{% endtrans
 
30
  {% else %}
31
  <p>{% trans %}No login available, you shouldn't be seeing this page.{% endtrans %}</p>
32
  {% endif %}
 
 
 
 
 
33
  {% if message %}
34
  <div class="row">
35
  {% for key in message %}
 
41
  {% endif %}
42
  {% if token_available %}
43
  {% block token_message %}
 
44
  {% endblock token_message %}
45
  {% endif %}
46
  </div>
 
47
  {% endblock %}
 
 
48
  {% block script %}
49
  {% endblock %}
requirements.txt CHANGED
@@ -1,3 +1,6 @@
1
- jupyterlab==4.2.5
2
- tornado==6.2
 
 
 
3
  ipywidgets
 
1
+ jupyterlab
2
+ jupyterlab-language-pack-zh-CN
3
+ jupyterlab-system-monitor
4
+ jupyter-server
5
+ tornado
6
  ipywidgets
start_server.sh CHANGED
@@ -1,9 +1,9 @@
1
  #!/bin/bash
2
  JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
3
 
4
- NOTEBOOK_DIR="/data"
5
 
6
- jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
7
 
8
  jupyter-lab \
9
  --ip 0.0.0.0 \
 
1
  #!/bin/bash
2
  JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
3
 
4
+ echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
5
 
6
+ NOTEBOOK_DIR="/home/user/app"
7
 
8
  jupyter-lab \
9
  --ip 0.0.0.0 \