From bd3f80cc2166d7decd5e868da18cb719ce7faa4a Mon Sep 17 00:00:00 2001 From: Naymul Islam Date: Fri, 15 Sep 2023 12:02:06 +0600 Subject: [PATCH 1/2] Dockerfile is added to the codebase The dockerfile is added which use the Gurobi docker image --- dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dockerfile diff --git a/dockerfile b/dockerfile new file mode 100644 index 00000000..3b372239 --- /dev/null +++ b/dockerfile @@ -0,0 +1,20 @@ +# Use the Gurobi Docker image as a base +FROM gurobi/python + +# Install any additional dependencies for dingo +RUN apt-get update && apt-get install -y \ + cmake \ + lp-solve \ + && rm -rf /var/lib/apt/lists/* + +# Install dingo +RUN pip install dingo + +# Set the working directory +WORKDIR /app + +# Copy the current directory contents into the container at /app +ADD . /app + +# Run dingo when the container launches +CMD ["python", "setup.py"] \ No newline at end of file From 8a07f8babe563f5979d6fd18f1e98efc7a65c00e Mon Sep 17 00:00:00 2001 From: Naymul Islam Date: Sat, 23 Sep 2023 16:03:15 +0600 Subject: [PATCH 2/2] docker file is updated and instruction added into readme file Due to unavailability the docker file is failed to run before now that sloved and instruction for using the dockerfile is added --- README.md | 20 ++++++++++++++++++++ dockerfile | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9d0e5c03..59e73263 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,27 @@ pip3 install -i https://pypi.gurobi.com gurobipy Then, you will need a [license](https://www.gurobi.com/downloads/end-user-license-agreement-academic/). For more information, we refer to the Gurobi [download center](https://www.gurobi.com/downloads/). +## Running the Application with Docker +1. **Build the Docker Image** + + Open a terminal in the directory containing the Dockerfile and build the Docker image using the following command: + ````bash + docker build -t my_dingo_app . + ```` + + Replace `my_dingo_app` with the name you want to give to your Docker image. + +2. **Run the Docker Container** + + After the image has been built, you can run a container from it using the following command: + ````bash + docker run -it my_dingo_app + ```` + + The `-it` option is used to run the Docker container in interactive mode. + +Please note that Docker must be installed on your system to build and run Docker images and containers. You can download Docker from [here](https://www.docker.com/products/docker-desktop). ## Unit tests diff --git a/dockerfile b/dockerfile index 3b372239..edf9bc5b 100644 --- a/dockerfile +++ b/dockerfile @@ -3,18 +3,38 @@ FROM gurobi/python # Install any additional dependencies for dingo RUN apt-get update && apt-get install -y \ - cmake \ - lp-solve \ - && rm -rf /var/lib/apt/lists/* + cmake \ + lp-solve \ + git \ + wget \ + vim \ + bzip2 \ + g++ \ + && rm -rf /var/lib/apt/lists/* -# Install dingo -RUN pip install dingo +# Install dependencies +RUN apt-get update && apt-get install -y libsuitesparse-dev +RUN pip install sparseqr \ + Cython \ + cobra \ + kaleido -# Set the working directory WORKDIR /app -# Copy the current directory contents into the container at /app -ADD . /app +# Get dingo +RUN git clone https://github.com/GeomScale/dingo.git && \ + cd dingo && \ + git submodule update --init + +# Get boost library +WORKDIR /app/dingo +RUN wget -O boost_1_76_0.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 && \ + tar xjf boost_1_76_0.tar.bz2 && \ + rm boost_1_76_0.tar.bz2 -# Run dingo when the container launches -CMD ["python", "setup.py"] \ No newline at end of file +# Get PySQR +RUN apt-get install libsuitesparse-dev + +# Install dingo +RUN pip install matplotlib plotly +RUN ["python", "setup.py", "install", "--user"] \ No newline at end of file