Skip to content
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

Add Docker deployment capability #562

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,30 @@ jobs:
- store_test_results:
path: test-results

build_docker_image:
docker:
- image: circleci/python:3.12
steps:
- checkout
- setup_remote_docker:
version: 20.10.7
- run:
name: Build Docker image
command: |
docker build -t exo:latest .
- run:
name: Tag Docker image
command: |
docker tag exo:latest your-dockerhub-username/exo:latest
- run:
name: Login to DockerHub
command: |
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- run:
name: Push Docker image
command: |
docker push your-dockerhub-username/exo:latest

workflows:
version: 2
build_and_test:
Expand All @@ -344,3 +368,4 @@ workflows:
- chatgpt_api_integration_test_tinygrad
- chatgpt_api_integration_test_dummy
- measure_pip_sizes
- build_docker_image
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use a base image with Python 3.12
FROM python:3.12-slim

# Set the working directory
WORKDIR /app

# Copy the project files into the Docker image
COPY . .

# Install the project dependencies
RUN pip install --upgrade pip
RUN pip install -e .

# Set the entry point to run the project
ENTRYPOINT ["exo"]
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,31 @@ pip install -e .
source install.sh
```

### Using Docker

You can also build and run exo using Docker.

#### Build the Docker image

```sh
docker build -t exo:latest .
```

#### Run the Docker container

```sh
docker run -p 52415:52415 exo:latest
```

### Using Docker Compose

You can use Docker Compose to run exo with multiple services.

#### Build and run the services

```sh
docker-compose up --build
```

### Troubleshooting

Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.8'

services:
exo:
build:
context: .
dockerfile: Dockerfile
ports:
- "52415:52415"
environment:
- DEBUG=1
- TINYGRAD_DEBUG=2