Kulathuna23 commited on
Commit
f258476
·
verified ·
1 Parent(s): 0d1ca22

Upload 9 files

Browse files
Files changed (9) hide show
  1. Dockerfile +105 -0
  2. README.md +8 -4
  3. gitattributes.txt +34 -0
  4. login.html +54 -0
  5. login.html.bak +54 -0
  6. on_startup.sh +5 -0
  7. packages.txt +1 -0
  8. requirements.txt +3 -0
  9. start_server.sh +19 -0
Dockerfile ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ TZ=Europe/Paris
5
+
6
+ # Remove any third-party apt sources to avoid issues with expiring keys.
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
39
+
40
+ # Create a non-root user and switch to it
41
+ RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
42
+ && chown -R user:user /app
43
+ RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
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
+ 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"]
README.md CHANGED
@@ -1,11 +1,15 @@
1
  ---
2
- title: Gehs
3
- emoji: 🏃
4
- colorFrom: purple
5
- colorTo: purple
6
  sdk: docker
7
  pinned: false
 
 
 
8
  license: mit
 
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: Asitha
3
+ emoji: 💻🐳
4
+ colorFrom: gray
5
+ colorTo: green
6
  sdk: docker
7
  pinned: false
8
+ tags:
9
+ - jupyterlab
10
+ suggested_storage: small
11
  license: mit
12
+ short_description: making it easy to do pro
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
gitattributes.txt ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
login.html ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "page.html" %}
2
+
3
+ {% block stylesheet %}
4
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
5
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
6
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
7
+ <style>
8
+ body {
9
+ font-family: 'Poppins', sans-serif;
10
+ background-color: #f8f9fa;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ height: 100vh;
15
+ }
16
+ .login-container {
17
+ background: white;
18
+ border-radius: 10px;
19
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
20
+ padding: 30px;
21
+ max-width: 400px;
22
+ width: 100%;
23
+ }
24
+ .login-container img {
25
+ max-width: 150px;
26
+ margin-bottom: 20px;
27
+ }
28
+ .btn-primary {
29
+ width: 100%;
30
+ }
31
+ </style>
32
+ {% endblock stylesheet %}
33
+
34
+ {% block site %}
35
+ <div class="login-container text-center">
36
+ <img src="https://i.ibb.co/0GhKf6N/20241120-113020.jpg" alt="Mr Asitha Logo">
37
+ <h4 class="mb-3">Login to MRAsitha'Md VPS</h4>
38
+
39
+ <form action="{{ base_url }}login?next={{ next }}" method="post">
40
+ {{ xsrf_form_html() | safe }}
41
+ <div class="mb-3">
42
+ <label for="password_input" class="form-label">
43
+ <strong>{% if token_available %}Jupyter token{% else %}Password{% endif %}:</strong>
44
+ </label>
45
+ <input type="password" id="password_input" name="password" class="form-control" required>
46
+ </div>
47
+ <button type="submit" class="btn btn-primary" id="login_submit">Log In</button>
48
+ </form>
49
+ </div>
50
+ {% endblock site %}
51
+
52
+ {% block script %}
53
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
54
+ {% endblock script %}
login.html.bak ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "page.html" %}
2
+
3
+ {% block stylesheet %}
4
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
5
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
6
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
7
+ <style>
8
+ body {
9
+ font-family: 'Poppins', sans-serif;
10
+ background-color: #f8f9fa;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ height: 100vh;
15
+ }
16
+ .login-container {
17
+ background: white;
18
+ border-radius: 10px;
19
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
20
+ padding: 30px;
21
+ max-width: 400px;
22
+ width: 100%;
23
+ }
24
+ .login-container img {
25
+ max-width: 150px;
26
+ margin-bottom: 20px;
27
+ }
28
+ .btn-primary {
29
+ width: 100%;
30
+ }
31
+ </style>
32
+ {% endblock stylesheet %}
33
+
34
+ {% block site %}
35
+ <div class="login-container text-center">
36
+ <img src="https://api.arabdullah.top/img/logo.png" alt="ARAbdulla-Dev Logo">
37
+ <h4 class="mb-3">Login to ARAbdulla-Dev's VPS</h4>
38
+
39
+ <form action="{{ base_url }}login?next={{ next }}" method="post">
40
+ {{ xsrf_form_html() | safe }}
41
+ <div class="mb-3">
42
+ <label for="password_input" class="form-label">
43
+ <strong>{% if token_available %}Jupyter token{% else %}Password{% endif %}:</strong>
44
+ </label>
45
+ <input type="password" id="password_input" name="password" class="form-control" required>
46
+ </div>
47
+ <button type="submit" class="btn btn-primary" id="login_submit">Log In</button>
48
+ </form>
49
+ </div>
50
+ {% endblock site %}
51
+
52
+ {% block script %}
53
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
54
+ {% endblock script %}
on_startup.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1 @@
 
 
1
+ tree
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ jupyterlab==4.2.5
2
+ tornado==6.2
3
+ ipywidgets
start_server.sh ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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