Skip to content

Commit 560d384

Browse files
Address Docker deployment review feedback
1 parent 8e5ded7 commit 560d384

5 files changed

Lines changed: 26 additions & 16 deletions

File tree

.github/workflows/docker.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ on:
44
push:
55
branches:
66
- main
7-
# - fix/docker-deployment
87

98
pull_request:
109
branches:
1110
- main
12-
workflow_dispatch:
11+
workflow_dispatch:
1312

1413
env:
15-
IMAGE_NAME: fabnemepfl/mmirage
14+
IMAGE_NAMESPACE: fabnemepfl
1615
REGISTRY: docker.io
1716

1817
jobs:
@@ -25,10 +24,6 @@ jobs:
2524
path: docker/Dockerfile
2625
tag_base: amd64
2726
name: mmirage-git
28-
- platform: ubuntu-24.04-arm
29-
path: docker/Dockerfile
30-
tag_base: arm64
31-
name: mmirage-git
3227
- platform: ubuntu-latest
3328
path: docker/Dockerfile.cpu
3429
tag_base: amd64
@@ -39,7 +34,7 @@ jobs:
3934
name: mmirage-git-cpu
4035

4136
runs-on: ${{ matrix.platform }}
42-
environment: docker
37+
environment: ${{ github.event_name != 'pull_request' && 'docker' || 'docker-ci' }}
4338

4439
steps:
4540
- name: Free space (ARM)
@@ -89,5 +84,5 @@ jobs:
8984
file: ${{ matrix.path }}
9085
push: ${{ github.event_name != 'pull_request' }}
9186
tags: |
92-
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest-${{ matrix.tag_base }}
93-
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:${{ github.sha }}-${{ matrix.tag_base }}
87+
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.name }}:latest-${{ matrix.tag_base }}
88+
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.name }}:${{ github.sha }}-${{ matrix.tag_base }}

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ MMIRAGE, which stands for **M**odular **M**ultimodal **I**ntelligent **R**eforma
1010

1111
## How to install
1212

13-
To install the library, you can clone it from GitHub and then use pip to install it directly. It is recommended to have already installed `torch` and `sglang` to take advantage of GPU acceleration.
13+
To install the library, clone it from GitHub and install it with pip. The base
14+
install does not include the local SGLang runtime:
1415

1516
```bash
1617
git clone git@github.com:EPFLiGHT/MMIRAGE.git
18+
pip install -e ./MMIRAGE
19+
```
20+
21+
Install the GPU extra when using the SGLang-backed `llm` processor for local
22+
GPU inference:
23+
24+
```bash
1725
pip install -e './MMIRAGE[gpu]'
1826
```
1927

@@ -43,9 +51,13 @@ The container requires an NVIDIA GPU. The `docker-compose.yml` is configured to
4351

4452
Without these host-side prerequisites, `docker compose run` may fail to detect or use the GPU.
4553

46-
### CPU-only (API-based LLMs)
54+
### CPU-only
4755

48-
For API-based LLMs that do not require a GPU:
56+
The CPU image installs MMIRAGE without the GPU extra. It is suitable for
57+
workflows that do not instantiate the SGLang-backed `llm` processor, and is
58+
intended to support API-backed processors once they are available. Current
59+
configs that use `type: llm` require the GPU image or an install with the
60+
`[gpu]` extra.
4961

5062
```bash
5163
docker compose run --rm mmirage-cpu --config configs/your_config.yaml

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ WORKDIR /workspace/MMIRAGE
88

99
RUN pip install --no-cache-dir .[gpu]
1010

11-
ENTRYPOINT ["python3", "-c", "import mmirage.core.process, runpy; runpy.run_module('mmirage.shard_process', run_name='__main__')"]
11+
ENTRYPOINT ["python3", "-m", "mmirage.shard_process"]

docker/Dockerfile.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ WORKDIR /workspace/MMIRAGE
55

66
RUN pip install --no-cache-dir .
77

8-
ENTRYPOINT ["python3", "-c", "import mmirage.core.process, runpy; runpy.run_module('mmirage.shard_process', run_name='__main__')"]
8+
ENTRYPOINT ["python3", "-m", "mmirage.shard_process"]

src/mmirage/core/process/processors/llm/llm_processor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def __init__(self, engine_args: SGLangLLMConfig, **kwargs) -> None:
6363
"""
6464
super().__init__(engine_args, **kwargs)
6565
if not SGLANG_AVAILABLE:
66-
raise RuntimeError("SGLang is not installed. Install with: pip install '.[gpu]'")
66+
raise RuntimeError(
67+
"SGLang is not installed. Install with: pip install 'mmirage[gpu]' "
68+
"or, from a source checkout, pip install -e '.[gpu]'"
69+
)
6770
self.llm = sgl.Engine(**asdict(engine_args.server_args))
6871
self.tokenizer = AutoTokenizer.from_pretrained(
6972
engine_args.server_args.model_path,

0 commit comments

Comments
 (0)