narugo commited on
Commit
32d7e67
1 Parent(s): 6c30fa8

dev(narugo): init jupyter lab

Browse files
Files changed (7) hide show
  1. .bashrc +1 -0
  2. .gitattributes +0 -1
  3. .gitignore +1 -0
  4. Dockerfile +35 -0
  5. README.md +6 -4
  6. requirements.txt +3 -0
  7. run.sh +15 -0
.bashrc ADDED
@@ -0,0 +1 @@
 
 
1
+ export PATH=$HOME/.local/bin:$PATH
.gitattributes CHANGED
@@ -25,7 +25,6 @@
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
- *.tar filter=lfs diff=lfs merge=lfs -text
29
  *.tflite filter=lfs diff=lfs merge=lfs -text
30
  *.tgz filter=lfs diff=lfs merge=lfs -text
31
  *.wasm 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
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ venv
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.8.1
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN apt-get update && \
8
+ apt-get install -y sudo tmux wget curl htop make tree && \
9
+ apt-get install -y iputils-ping telnet && \
10
+ apt-get install -y git git-lfs
11
+
12
+ RUN --mount=type=secret,id=PASSWORD,mode=0444,required=true \
13
+ useradd -m -u 1000 user && \
14
+ echo "user:$(cat /run/secrets/PASSWORD)" | chpasswd && \
15
+ adduser user sudo
16
+
17
+ RUN pip install -U pip pysocks
18
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
19
+
20
+ USER user
21
+ ENV HOME=/home/user
22
+ ENV PATH=$HOME/.local/bin:$PATH
23
+ ENV SHELL=/bin/bash
24
+
25
+ WORKDIR $HOME
26
+
27
+ COPY --chown=user . $HOME/app
28
+
29
+ COPY .bashrc $HOME/.bashrc_append
30
+ RUN cat $HOME/.bashrc_append >> $HOME/.bashrc && \
31
+ rm $HOME/.bashrc_append
32
+
33
+ EXPOSE 7860
34
+ ENTRYPOINT []
35
+ CMD ["/bin/bash", "./app/run.sh"]
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Tb Log Info Demo
3
- emoji: 📈
4
- colorFrom: green
5
- colorTo: yellow
6
  sdk: docker
7
  pinned: false
 
 
8
  ---
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: JupyterLab
3
+ emoji: 💹
4
+ colorFrom: blue
5
+ colorTo: red
6
  sdk: docker
7
  pinned: false
8
+ license: mit
9
+ app_port: 7860
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ jupyterlab==3.6.1
2
+ jupyter-server==2.3.0
3
+ tornado==6.2
run.sh ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ PASSWORD="${PASSWORD:=huggingface}"
4
+ echo "Starting Jupyter Lab with token $PASSWORD"
5
+
6
+ jupyter lab \
7
+ --ip=0.0.0.0 \
8
+ --port=7860 \
9
+ --no-browser \
10
+ --allow-root \
11
+ --NotebookApp.token=$PASSWORD \
12
+ --NotebookApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
13
+ --NotebookApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
14
+ --NotebookApp.disable_check_xsrf=True
15
+