From e93508b2fed1dc401d7349e115ddcb4d5684659f Mon Sep 17 00:00:00 2001 From: Kye Date: Fri, 16 Feb 2024 15:22:08 -0800 Subject: [PATCH] [README] --- Dockerfile | 23 +++++++++++++++++++++++ README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..91b75cae --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use an official CUDA runtime as a parent image +FROM nvidia/cuda:11.4.2-runtime-ubuntu20.04 + +# Set the working directory in the container to /app +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +# Install any needed packages specified in requirements.txt +RUN apt-get update && apt-get install -y \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* +RUN pip3 install --no-cache-dir -r requirements.txt + +# Make port 80 available to the world outside this container +EXPOSE 80 + +# Define environment variable +# ENV NAME World + +# Run app.py when the container launches +CMD ["python3", "example.py"] \ No newline at end of file diff --git a/README.md b/README.md index cc5ed987..4afad1b6 100644 --- a/README.md +++ b/README.md @@ -1210,6 +1210,32 @@ The swarms package has been meticlously crafted for extreme use-ability and unde └── workers ``` +## Docker Instructions + +This application uses Docker with CUDA support. To build and run the Docker container, follow these steps: + +### Prerequisites + +- Make sure you have [Docker installed](https://docs.docker.com/get-docker/) on your machine. +- Ensure your machine has an NVIDIA GPU and [NVIDIA Docker support](https://github.com/NVIDIA/nvidia-docker) installed. + +### Building the Docker Image + +To build the Docker image, navigate to the root directory containing the `Dockerfile` and run the following command: + +```bash +docker build --gpus all -t swarms +``` +### Running the Docker Container +To run the Docker container, use the following command: + +`docker run --gpus all -p 4000:80 your-image-name` + +Replace your-image-name with the name of your Docker image, and replace 4000:80 with your actual port mapping. The format is hostPort:containerPort. + +Now, your application should be running with CUDA support! + + ## Swarm Newsletter 🤖 🤖 🤖 📧 Sign up to the Swarm newsletter to receive updates on the latest Autonomous agent research papers, step by step guides on creating multi-agent app, and much more Swarmie goodiness 😊