Spaces:
Paused
Paused
Synced repo using 'sync_with_huggingface' Github Action
Browse filesFiles changed (6)
- DockerfileAdded+100
- login.htmlAdded+67
- on_startup.shAdded+5
- packages.txtAdded+1
- requirements.txtAdded+1
- start_server.shAdded+16
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100FROM nvidia/cuda:11.3.1-base-ubuntu20.04
# Remove any third-party apt sources to avoid issues with expiring keys.RUN rm -f /etc/apt/sources.list.d/*.list
ENV DEBIAN_FRONTEND=noninteractive \ TZ=Europe/Paris
# Install some basic utilitiesRUN apt-get update && apt-get install -y \ curl \ ca-certificates \ sudo \ git \ git-lfs \ zip \ unzip \ htop \ bzip2 \ libx11-6 \ build-essential \ libsndfile-dev \ software-properties-common \ && rm -rf /var/lib/apt/lists/*
RUN add-apt-repository ppa:flexiondotorg/nvtopRUN apt-get upgrade -yRUN apt-get install -y nvtop
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -RUN apt-get install -y nodejsRUN npm install -g configurable-http-proxy
# Create a working directoryRUN mkdir /appWORKDIR /app
# Create a non-root user and switch to itRUN adduser --disabled-password --gecos '' --shell /bin/bash user \ && chown -R user:user /appRUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-userUSER user
# All users can use /home/user as their home directoryENV HOME=/home/userRUN mkdir $HOME/.cache $HOME/.config \ && chmod -R 777 $HOME
# Set up the Conda environmentENV CONDA_AUTO_UPDATE_CONDA=false \ PATH=$HOME/miniconda/bin:$PATHRUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \ && chmod +x ~/miniconda.sh \ && ~/miniconda.sh -b -p ~/miniconda \ && rm ~/miniconda.sh \ && conda clean -ya
WORKDIR $HOME/app
######################################## Start root user section#######################################
USER root
# User Debian packages## Security warning : Potential user code executed as root (build time)COPY --chown=root packages.txt /root/packages.txtRUN apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
COPY --chown=root on_startup.sh /root/on_startup.shRUN chmod +x /root/on_startup.shRUN /root/on_startup.sh
# Rerun chmod on home dir in case any new files need permisisonsRUN chmod -R 777 $HOME
######################################## End root user section#######################################
USER user
# Copy the current directory contents into the container at $HOME/app setting the owner to the userCOPY --chown=user . $HOME/app
RUN chmod +x start_server.sh
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txtCOPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
ENV PYTHONUNBUFFERED=1 \ GRADIO_ALLOW_FLAGGING=never \ GRADIO_NUM_PORTS=1 \ GRADIO_SERVER_NAME=0.0.0.0 \ GRADIO_THEME=huggingface \ SYSTEM=spaces \ SHELL=/bin/bash
CMD ["./start_server.sh"]12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667{% extends "page.html" %}
{% block stylesheet %}{% endblock %}
{% block site %}
<div id="jupyter-main-app" class="container"> <img src="https://huggingface.co/front/assets/huggingface_logo-noborder.svg" alt="Hugging Face Logo"> <h4>You can duplicate this Space to run it private.</h4> <br> <a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/DockerTemplates/jupyterlab?duplicate=true"> <img style="margin: 0" src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a> <br> <br> <h4>Token is <span style="color:orange;">huggingface</span></h4> {% if login_available %} {# login_available means password-login is allowed. Show the form. #} <div class="row"> <div class="navbar col-sm-8"> <div class="navbar-inner"> <div class="container"> <div class="center-nav"> <form action="{{base_url}}login?next={{next}}" method="post" class="navbar-form pull-left"> {{ xsrf_form_html() | safe }} {% if token_available %} <label for="password_input"><strong>{% trans %}Token:{% endtrans %}</strong></label> {% else %} <label for="password_input"><strong>{% trans %}Password:{% endtrans %}</strong></label> {% endif %} <input type="password" name="password" id="password_input" class="form-control"> <button type="submit" class="btn btn-default" id="login_submit">{% trans %}Log in{% endtrans %}</button> </form> </div> </div> </div> </div> </div> {% else %} <p>{% trans %}No login available, you shouldn't be seeing this page.{% endtrans %}</p> {% endif %} {% if message %} <div class="row"> {% for key in message %} <div class="message {{key}}"> {{message[key]}} </div> {% endfor %} </div> {% endif %} {% if token_available %} {% block token_message %} {% endblock token_message %} {% endif %}</div>
{% endblock %}
{% block script %}{% endblock %}12345#!/bin/bash# Write some commands here that will run on root user before startup.# For example, to clone transformers and install it in dev mode:# git clone https://github.com/huggingface/transformers.git# cd transformers && pip install -e ".[dev]"1tree1jupyterlab12345678910111213141516#!/bin/bashJUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
jupyter-lab \ --ip 0.0.0.0 \ --port 7860 \ --no-browser \ --allow-root \ --ServerApp.token="$JUPYTER_TOKEN" \ --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \ --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \ --ServerApp.disable_check_xsrf=True \ --LabApp.news_url=None \ --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate"DockerfileAdded+100
login.htmlAdded+67
on_startup.shAdded+5
packages.txtAdded+1
requirements.txtAdded+1
start_server.shAdded+16