From 08d1283834db523a0d4601d2f9663b7883ac9570 Mon Sep 17 00:00:00 2001 From: Ashley Kleynhans Date: Wed, 21 Feb 2024 16:49:58 +0200 Subject: [PATCH] Added OhMyRunPod and RunPod File Uploader --- Dockerfile | 15 +++++++++++---- README.md | 35 +++++++++++++++++++++++++++++++++++ nginx/template-readme.md | 16 ++++++++++------ scripts/start.sh | 9 ++++++++- 4 files changed, 64 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index c044bc7..283a8b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -107,12 +107,18 @@ RUN curl https://getcroc.schollz.com | bash RUN curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash && \ apt install speedtest -# Install Jupyter +# Install Jupyter, gdown and OhMyRunPod RUN pip3 install -U --no-cache-dir jupyterlab \ jupyterlab_widgets \ ipykernel \ ipywidgets \ - gdown + gdown \ + OhMyRunPod + +# Install RunPod File Uploader +RUN curl -sSL https://github.com/kodxana/RunPod-FilleUploader/raw/main/scripts/installer.sh -o installer.sh && \ + chmod +x installer.sh && \ + ./installer.sh # NGINX Proxy COPY nginx/nginx.conf /etc/nginx/nginx.conf @@ -129,12 +135,13 @@ COPY --chmod=755 scripts/start_textgen_server.sh /text-generation-webui/ COPY fetch_model.py /text-generation-webui/ COPY download_model.py /text-generation-webui/ -WORKDIR / +# Set template version +ENV TEMPLATE_VERSION=1.12.4 # Copy the scripts +WORKDIR / COPY --chmod=755 scripts/* ./ # Start the container -ENV TEMPLATE_VERSION=1.12.3 SHELL ["/bin/bash", "--login", "-c"] CMD [ "/start.sh" ] diff --git a/README.md b/README.md index 02e3c43..493347b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,10 @@ https://github.com/oobabooga/text-generation-webui) * Torch 2.1.2 * xformers 0.0.23.post1 +* Jupyter Lab * [runpodctl](https://github.com/runpod/runpodctl) +* [OhMyRunPod](https://github.com/kodxana/OhMyRunPod) +* [RunPod File Uploader](https://github.com/kodxana/RunPod-FilleUploader) * [croc](https://github.com/schollz/croc) * [rclone](https://rclone.org/) * speedtest-cli @@ -47,12 +50,44 @@ docker run -d \ -p 3000:3001 \ -p 5000:5001 \ -p 8888:8888 \ + -p 2999:2999 \ -e JUPYTER_PASSWORD=Jup1t3R! \ ashleykza/oobabooga:latest ``` You can obviously substitute the image name and tag with your own. +### Ports + +| Connect Port | Internal Port | Description | +|--------------|---------------|------------------------| +| 3000 | 3001 | Text Generation Web UI | +| 5000 | 5001 | Open AI Compatible API | +| 8888 | 8888 | Jupyter Lab | +| 2999 | 2999 | RunPod File Uploader | + +### Environment Variables + +| Variable | Description | Default | +|--------------------|---------------------------------------------|-----------| +| JUPYTER_PASSWORD | Password for Jupyter Lab | Jup1t3R! | +| DISABLE_AUTOLAUNCH | Disable Web UI from launching automatically | (not set) | + +## Logs + +Text Generation Web UI creates a log file, and you can tail the log instead of +killing the service to view the logs. + +| Application | Log file | +|-----------------------|-----------------------------| +| Text Generation Web UI | /workspace/logs/textgen.log | + +For example: + +```bash +tail -f /workspace/logs/textgen.log +``` + ## Community and Contributing Pull requests and issues on [GitHub](https://github.com/ashleykleynhans/text-generation-docker) diff --git a/nginx/template-readme.md b/nginx/template-readme.md index 8190b3f..ad83d65 100644 --- a/nginx/template-readme.md +++ b/nginx/template-readme.md @@ -1,6 +1,6 @@ ## Text Generation Web UI: A Gradio web UI for Large Language Models. Supports transformers, GPTQ, llama.cpp (GGUF), Llama models -### Version 1.12.3 +### Version 1.12.4 ### Included in this Template @@ -12,7 +12,10 @@ * Text Generation API * Torch 2.1.2 * xformers 0.0.23.post1 +* Jupyter Lab * [runpodctl](https://github.com/runpod/runpodctl) +* [OhMyRunPod](https://github.com/kodxana/OhMyRunPod) +* [RunPod File Uploader](https://github.com/kodxana/RunPod-FilleUploader) * [croc](https://github.com/schollz/croc) * [rclone](https://rclone.org/) * speedtest-cli @@ -21,11 +24,12 @@ ### Ports -| Port | Description | -|------|--------------------------------| -| 3000 | Text Generation Web UI | -| 5000 | Open AI Compatible API | -| 8888 | Jupyter Lab | +| Port | Description | +|------|-----------------------------| +| 3000 | Text Generation Web UI | +| 5000 | Open AI Compatible API | +| 8888 | Jupyter Lab | +| 2999 | RunPod File Uploader | ### Environment Variables diff --git a/scripts/start.sh b/scripts/start.sh index 99a026e..0931b6b 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -56,7 +56,7 @@ export_env_vars() { start_jupyter() { if [[ $JUPYTER_PASSWORD ]]; then echo "Starting Jupyter Lab..." - mkdir -p /workspace/logs && \ + mkdir -p /workspace/logs cd / && \ nohup jupyter lab --allow-root \ --no-browser \ @@ -72,6 +72,12 @@ start_jupyter() { fi } +start_runpod_uploader() { + echo "Starting RunPod Uploader..." + nohup /usr/local/bin/runpod-uploader &> /workspace/logs/runpod-uploader.log & + echo "RunPod Uploader started" +} + configure_filezilla() { # Only proceed if there is a public IP if [[ ! -z "${RUNPOD_PUBLIC_IP}" ]]; then @@ -140,6 +146,7 @@ echo "Container Started, configuration in progress..." start_nginx setup_ssh start_jupyter +start_runpod_uploader execute_script "/pre_start.sh" "Running pre-start script..." configure_filezilla export_env_vars