Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,49 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v4
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

build-llamacpp:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=llamacpp-latest
type=sha,prefix=llamacpp-

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v7
with:
context: ./images/llamacpp
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v4
with:
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,25 @@ jobs:
run: docker run --rm test-vllm-nightly id dstack

- name: Verify dstack user has sudo
run: docker run --rm test-vllm-nightly sudo -n true
run: docker run --rm test-vllm-nightly sudo -n true

check-llamacpp:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Build llamacpp image
run: docker build -t test-llamacpp ./images/llamacpp

- name: Verify openssh-server installed
run: docker run --rm test-llamacpp which sshd

- name: Verify sudo installed
run: docker run --rm test-llamacpp which sudo

- name: Verify dstack user exists
run: docker run --rm test-llamacpp id dstack

- name: Verify dstack user has sudo
run: docker run --rm test-llamacpp sudo -n true
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ Same as vllm but based on `vllm/vllm-openai:nightly` — bleeding edge vLLM buil
- **Tag**: `ghcr.io/plumelo/dstack-images:vllm-nightly-latest`
- **What's added**: openssh-server, sudo, dstack user (uid/gid 1000), `/dstack/run`

### llamacpp

Based on `ghcr.io/ggml-org/llama.cpp:server-cuda` with pre-installed dstack runner prerequisites. Includes MTP (multi-token prediction) support and the Jinja-based autoparser for automatic tool call detection.

- **Tag**: `ghcr.io/plumelo/dstack-images:llamacpp-latest`
- **What's added**: openssh-server, sudo, dstack user (uid/gid 1000), `/dstack/run`

## Usage

```yaml
Expand All @@ -36,6 +43,14 @@ image: ghcr.io/plumelo/dstack-images:vllm-nightly-latest
commands:
- |
vllm serve $MODEL_ID --host 0.0.0.0 --port 8000 ...

# llama.cpp
type: service
name: my-llamacpp
image: ghcr.io/plumelo/dstack-images:llamacpp-latest
commands:
- |
/app/llama-server --hf-repo $MODEL_REPO --hf-file $MODEL_FILE --port 8000 ...
```

## Cold start improvement
Expand All @@ -47,5 +62,5 @@ commands:

## CI/CD

- **Push to main**: builds and pushes both image tags + SHA tags
- **Push to main**: builds and pushes all image tags + SHA tags
- **PR**: builds and runs verification checks per image
14 changes: 14 additions & 0 deletions images/llamacpp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ghcr.io/ggml-org/llama.cpp:server-cuda

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
openssh-server sudo \
&& sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config \
&& mkdir /run/sshd \
&& rm -f /etc/ssh/ssh_host_* \
&& groupadd -g 1000 dstack \
&& useradd -u 1000 -g 1000 -G sudo -s /bin/bash -m dstack \
&& echo 'dstack ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/dstack \
&& mkdir -p /dstack/run && chmod a+rwx /dstack/run \
&& rm -rf /var/lib/apt/lists/*

EXPOSE 8000