-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/add hermes template #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e2b5627
632016c
29c3acc
ed31eaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,374 @@ | ||||||||||||||
| # ============================== | ||||||||||||||
| # Global Args | ||||||||||||||
| # ============================== | ||||||||||||||
| ARG BASE_IMAGE="nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04" | ||||||||||||||
| ARG PYTHON_VERSION="3.11" | ||||||||||||||
| ARG HERMES_MODEL="NousResearch/Hermes-3-Llama-3.1-8B" | ||||||||||||||
|
|
||||||||||||||
| # ============================== | ||||||||||||||
| # Base Image | ||||||||||||||
| # ============================== | ||||||||||||||
| FROM ${BASE_IMAGE} | ||||||||||||||
|
|
||||||||||||||
| WORKDIR / | ||||||||||||||
|
|
||||||||||||||
| SHELL ["/bin/bash","-o","pipefail","-c"] | ||||||||||||||
|
|
||||||||||||||
| # ============================== | ||||||||||||||
| # Env | ||||||||||||||
| # ============================== | ||||||||||||||
| ENV DEBIAN_FRONTEND=noninteractive \ | ||||||||||||||
| LANG=C.UTF-8 \ | ||||||||||||||
| LC_ALL=C.UTF-8 \ | ||||||||||||||
| TZ=UTC \ | ||||||||||||||
| PIP_NO_CACHE_DIR=1 \ | ||||||||||||||
| PYTHONUNBUFFERED=1 \ | ||||||||||||||
| SHELL=/bin/bash \ | ||||||||||||||
| CUDA_HOME=/usr/local/cuda \ | ||||||||||||||
| PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/bin:$PATH \ | ||||||||||||||
| LD_LIBRARY_PATH=/usr/local/nvidia/lib64:$LD_LIBRARY_PATH \ | ||||||||||||||
| TORCH_CUDA_ARCH_LIST="12.0" \ | ||||||||||||||
| CMAKE_CUDA_ARCHITECTURES="120" \ | ||||||||||||||
| PYTORCH_ALLOC_CONF="expandable_segments:True" \ | ||||||||||||||
| PYTHON_VERSION="3.11" \ | ||||||||||||||
| JUPYTER_PASSWORD=yotta \ | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to generate random secrets and don't use hardcoded one? |
||||||||||||||
| \ | ||||||||||||||
| # HuggingFace | ||||||||||||||
| HF_HOME=/workspace/.cache/huggingface \ | ||||||||||||||
| HF_HUB_ENABLE_HF_TRANSFER=1 \ | ||||||||||||||
| \ | ||||||||||||||
| # vLLM runtime defaults | ||||||||||||||
| HERMES_MODEL="NousResearch/Hermes-3-Llama-3.1-8B" \ | ||||||||||||||
| VLLM_HOST="0.0.0.0" \ | ||||||||||||||
|
Comment on lines
+31
to
+42
|
||||||||||||||
| VLLM_PORT="8000" \ | ||||||||||||||
| VLLM_SERVED_MODEL_NAME="hermes" \ | ||||||||||||||
| VLLM_MAX_MODEL_LEN="32768" \ | ||||||||||||||
| VLLM_GPU_MEMORY_UTILIZATION="0.90" \ | ||||||||||||||
| VLLM_TRUST_REMOTE_CODE="true" \ | ||||||||||||||
| VLLM_EXTRA_ARGS="--enable-prefix-caching --enable-auto-tool-choice --tool-call-parser hermes --no-enable-log-requests" \ | ||||||||||||||
| VLLM_LOG="/workspace/vllm.log" \ | ||||||||||||||
| OPENAI_BASE_URL=http://localhost:8000/v1 | ||||||||||||||
|
|
||||||||||||||
| RUN mkdir -p /workspace "$HF_HOME" && chmod -R 777 /workspace "$HF_HOME" | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use 700? |
||||||||||||||
|
|
||||||||||||||
| # ============================== | ||||||||||||||
| # System packages | ||||||||||||||
| # ============================== | ||||||||||||||
| RUN set -eux; \ | ||||||||||||||
| apt-get update -y; \ | ||||||||||||||
| apt-get install -y --no-install-recommends --allow-change-held-packages \ | ||||||||||||||
| git git-lfs curl wget ca-certificates locales tzdata \ | ||||||||||||||
| build-essential pkg-config ninja-build \ | ||||||||||||||
| ffmpeg libgl1 libglib2.0-0 \ | ||||||||||||||
| software-properties-common \ | ||||||||||||||
| nginx \ | ||||||||||||||
| openssh-server openssh-client \ | ||||||||||||||
| tmux vim zsh zip unzip less procps net-tools htop \ | ||||||||||||||
| tini sudo lsof gnupg2; \ | ||||||||||||||
| git lfs install; \ | ||||||||||||||
| echo "en_US.UTF-8 UTF-8" > /etc/locale.gen; \ | ||||||||||||||
| locale-gen; \ | ||||||||||||||
| update-locale; \ | ||||||||||||||
| ln -sf /usr/share/zoneinfo/UTC /etc/localtime; \ | ||||||||||||||
| echo "Etc/UTC" > /etc/timezone; \ | ||||||||||||||
| dpkg-reconfigure -f noninteractive tzdata; \ | ||||||||||||||
| mkdir -p /var/run/sshd; \ | ||||||||||||||
| apt-get clean; \ | ||||||||||||||
| rm -rf /var/lib/apt/lists/* | ||||||||||||||
|
|
||||||||||||||
| # root SSH directory | ||||||||||||||
| RUN mkdir -p /root/.ssh && chmod 700 /root/.ssh | ||||||||||||||
|
|
||||||||||||||
| # ============================== | ||||||||||||||
| # SSH config | ||||||||||||||
| # ============================== | ||||||||||||||
| RUN sed -i "s/#PasswordAuthentication yes/PasswordAuthentication yes/" /etc/ssh/sshd_config && \ | ||||||||||||||
| sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config && \ | ||||||||||||||
| sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config | ||||||||||||||
|
Comment on lines
+85
to
+87
|
||||||||||||||
| RUN sed -i "s/#PasswordAuthentication yes/PasswordAuthentication yes/" /etc/ssh/sshd_config && \ | |
| sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config && \ | |
| sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config | |
| RUN sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config && \ | |
| sed -i "s/PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config && \ | |
| sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin prohibit-password/" /etc/ssh/sshd_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vllm==${VLLM_VERSION}
lock the version?
Copilot
AI
Apr 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jupyter is configured for remote access with a fixed, well-known token ("yotta") and an empty password. If this container can be reached from untrusted networks, this is easy to guess and increases risk of unauthorized access. Consider generating a random token when JUPYTER_PASSWORD isn’t explicitly set (or disabling Jupyter by default) and avoid allow_origin="*" unless required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin to a specific commit or release tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
700 is sufficient
Copilot
AI
Apr 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hermes-agent is installed from a shallow clone of the repo’s default branch, which makes builds non-reproducible and can break unexpectedly if upstream changes. Consider pinning to a specific tag/commit (or a published PyPI version if available) and using that in the build so images are repeatable.
Copilot
AI
Apr 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export_env_vars appends (>>) to /etc/rp_environment and ~/.bashrc every container start, so restarts will continually duplicate exports/source lines. Make this idempotent by overwriting /etc/rp_environment (use >), and only adding the source line to ~/.bashrc if it isn’t already present.
| printenv | grep -E '^YOTTA_|^PATH=|^_=' | awk -F = '{ print "export " $1 "=\"" $2 "\"" }' >> /etc/rp_environment | |
| echo 'export PATH=/usr/local/nvidia/bin:/usr/local/cuda-12.8/bin:~/.local/bin:$PATH' >> /etc/rp_environment | |
| echo 'source /etc/rp_environment' >> ~/.bashrc | |
| printenv | grep -E '^YOTTA_|^PATH=|^_=' | awk -F = '{ print "export " $1 "=\"" $2 "\"" }' > /etc/rp_environment | |
| echo 'export PATH=/usr/local/nvidia/bin:/usr/local/cuda-12.8/bin:~/.local/bin:$PATH' >> /etc/rp_environment | |
| grep -qxF 'source /etc/rp_environment' ~/.bashrc 2>/dev/null || echo 'source /etc/rp_environment' >> ~/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for Blackwell? Is it possible to support "8.0;9.0;12.0" as well