From 7d384fc7ec9e6405a2041f1a27bb9e04d4215cf2 Mon Sep 17 00:00:00 2001 From: Joe Crypto Date: Mon, 1 Apr 2024 01:47:15 +0000 Subject: [PATCH 1/2] docker compose up #is all you need --- .dockerignore | 4 ++++ .env_example | 1 + .gitignore | 2 ++ Dockerfile | 10 ++++++++++ docker-compose.yml | 26 ++++++++++++++++++++++++++ 5 files changed, 43 insertions(+) create mode 100644 .dockerignore create mode 100644 .env_example create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1744b82 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +Dockerfile +docker-compose.yml +.env + diff --git a/.env_example b/.env_example new file mode 100644 index 0000000..7f64f62 --- /dev/null +++ b/.env_example @@ -0,0 +1 @@ +HF_TOKEN=hf_1234567890 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30bd623 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f8b12f3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM mosaicml/llm-foundry:2.2.1_cu121_flash2-latest + +ENV PYTHONUNBUFFERED 1 + +WORKDIR /usr/src/app + +COPY requirements-gpu.txt ./ +RUN pip install --no-cache-dir -r requirements-gpu.txt + +COPY . . diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0f3467b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +--- +version: "3.8" +services: + + dbrx: + build: + context: . + restart: on-failure + env_file: + - .env + environment: + - HF_HOME=/huggingface + command: python generate.py + volumes: + - huggingface:/huggingface + deploy: + resources: + reservations: + devices: + - driver: nvidia + device_ids: ['all'] + capabilities: [gpu] + +volumes: + - huggingface + From 840dbff3e2eb5ef1c8b477d0383677936973e8ef Mon Sep 17 00:00:00 2001 From: Joe Crypto Date: Mon, 1 Apr 2024 01:49:30 +0000 Subject: [PATCH 2/2] fixed docker volume --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0f3467b..97c7836 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,5 +22,5 @@ services: capabilities: [gpu] volumes: - - huggingface + huggingface: