CMalone-Jupiter commited on
Commit
9ce4550
·
verified ·
1 Parent(s): a37f5d3

Upload folder using huggingface_hub

Browse files
Files changed (6) hide show
  1. Dockerfile +0 -95
  2. login.html +0 -68
  3. on_startup.sh +0 -5
  4. packages.txt +0 -1
  5. requirements.txt +0 -3
  6. start_server.sh +0 -19
Dockerfile DELETED
@@ -1,95 +0,0 @@
1
- FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu22.04
2
-
3
- ENV DEBIAN_FRONTEND=noninteractive \
4
- TZ=Europe/Paris \
5
- CONDA_AUTO_UPDATE_CONDA=false \
6
- HOME=/home/user \
7
- PATH=/home/user/miniconda/bin:$PATH \
8
- PYTHONUNBUFFERED=1 \
9
- GRADIO_ALLOW_FLAGGING=never \
10
- GRADIO_NUM_PORTS=1 \
11
- GRADIO_SERVER_NAME=0.0.0.0 \
12
- GRADIO_THEME=huggingface \
13
- SYSTEM=spaces \
14
- SHELL=/bin/bash
15
-
16
- # Base utilities
17
- RUN rm -f /etc/apt/sources.list.d/*.list && \
18
- apt-get update && apt-get install -y --no-install-recommends \
19
- curl \
20
- ca-certificates \
21
- sudo \
22
- git \
23
- wget \
24
- procps \
25
- git-lfs \
26
- zip \
27
- unzip \
28
- htop \
29
- vim \
30
- nano \
31
- bzip2 \
32
- libx11-6 \
33
- build-essential \
34
- libsndfile-dev \
35
- software-properties-common \
36
- && rm -rf /var/lib/apt/lists/*
37
-
38
- # nvtop
39
- RUN add-apt-repository ppa:flexiondotorg/nvtop && \
40
- apt-get update && \
41
- apt-get install -y --no-install-recommends nvtop && \
42
- rm -rf /var/lib/apt/lists/*
43
-
44
- # Node.js 21
45
- RUN curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && \
46
- apt-get update && \
47
- apt-get install -y nodejs && \
48
- npm install -g configurable-http-proxy && \
49
- rm -rf /var/lib/apt/lists/*
50
-
51
- # Working directory
52
- WORKDIR /app
53
-
54
- # User setup
55
- RUN adduser --disabled-password --gecos '' --shell /bin/bash user && \
56
- mkdir -p /home/user/.cache /home/user/.config /home/user/app && \
57
- chown -R user:user /home/user /app && \
58
- echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
59
-
60
- # Miniconda Python 3.12 (latest stable)
61
- USER user
62
- RUN curl -fsSL -o /home/user/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py312_24.7.1-0-Linux-x86_64.sh && \
63
- bash /home/user/miniconda.sh -b -p /home/user/miniconda && \
64
- rm -f /home/user/miniconda.sh && \
65
- conda clean -ya
66
-
67
- WORKDIR /home/user/app
68
-
69
- # Back to root for system packages / startup
70
- USER root
71
-
72
- RUN --mount=target=/root/packages.txt,source=packages.txt \
73
- apt-get update && \
74
- xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends && \
75
- rm -rf /var/lib/apt/lists/*
76
-
77
- RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
78
- bash /root/on_startup.sh
79
-
80
- RUN mkdir -p /data && chown user:user /data
81
-
82
- # Python packages
83
- USER user
84
- RUN --mount=target=requirements.txt,source=requirements.txt \
85
- pip install --no-cache-dir --upgrade -r requirements.txt
86
-
87
- # App files
88
- COPY --chown=user:user . /home/user/app
89
-
90
- RUN chmod +x /home/user/app/start_server.sh
91
-
92
- # Jupyter template path for Python 3.12
93
- COPY --chown=user:user login.html /home/user/miniconda/lib/python3.12/site-packages/jupyter_server/templates/login.html
94
-
95
- CMD ["./start_server.sh"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
login.html DELETED
@@ -1,68 +0,0 @@
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">
19
- <div class="navbar col-sm-8">
20
- <div class="navbar-inner">
21
- <div class="container">
22
- <div class="center-nav">
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
33
- %}</button>
34
- </form>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- </div>
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 %}
51
- <div class="message {{key}}">
52
- {{message[key]}}
53
- </div>
54
- {% endfor %}
55
- </div>
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 %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
on_startup.sh DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
- # Write some commands here that will run on root user before startup.
3
- # For example, to clone transformers and install it in dev mode:
4
- # git clone https://github.com/huggingface/transformers.git
5
- # cd transformers && pip install -e ".[dev]"
 
 
 
 
 
 
packages.txt DELETED
@@ -1 +0,0 @@
1
- tree
 
 
requirements.txt DELETED
@@ -1,3 +0,0 @@
1
- jupyterlab==4.5.7
2
- tornado==6.5.5
3
- ipywidgets==8.1.8
 
 
 
 
start_server.sh DELETED
@@ -1,19 +0,0 @@
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 \
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