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 dockerfile #1817

Merged
merged 11 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.env
.git

26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM continuumio/miniconda3:latest

WORKDIR /qlib

COPY . .

RUN apt-get update && \
apt-get install -y build-essential

RUN conda create --name qlib_source python=3.8
RUN echo "conda activate qlib_source" >> ~/.bashrc
ENV PATH /opt/conda/envs/qlib_source/bin:$PATH

RUN python -m pip install --upgrade pip

RUN python -m pip install numpy==1.23.5
RUN python -m pip install pandas==1.5.3
RUN python -m pip install importlib-metadata==5.2.0
RUN python -m pip install "cloudpickle<3"
RUN python -m pip install scikit-learn==1.3.2

RUN python -m pip install cython packaging tables matplotlib statsmodels

RUN python -m pip install pyqlib
SunsetWolf marked this conversation as resolved.
Show resolved Hide resolved

EXPOSE 10050
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,25 @@ We recommend users to prepare their own data if they have a high-quality dataset
```
-->

## Build docker images
SunsetWolf marked this conversation as resolved.
Show resolved Hide resolved
Running `build_docker_image.sh` is the right choice when you want to create a docker image for qlib. Of course, before running it, please open this file and make some necessary changes according to your docker hub account.
```bash
#!/bin/bash

# Build the Docker image
sudo docker build -t qlib_image -f ./Dockerfile .

# Log in to Docker Hub
# If you are a new docker hub user, please verify your email address before proceeding with this step.
sudo docker login

# Tag the Docker image
sudo docker tag qlib_image <Your docker hub username, not your email>/qlib_image:stable

# Push the Docker image to Docker Hub
sudo docker push <Your docker hub username, not your email>/qlib_image:stable
```

## Auto Quant Research Workflow
Qlib provides a tool named `qrun` to run the whole workflow automatically (including building dataset, training models, backtest and evaluation). You can start an auto quant research workflow and have a graphical reports analysis according to the following steps:

Expand Down
14 changes: 14 additions & 0 deletions build_docker_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
SunsetWolf marked this conversation as resolved.
Show resolved Hide resolved

# Build the Docker image
sudo docker build -t qlib_image -f ./Dockerfile .

# Log in to Docker Hub
# If you are a new docker hub user, please verify your email address before proceeding with this step.
sudo docker login

# Tag the Docker image
sudo docker tag qlib_image <Your docker hub username, not your email>/qlib_image:stable

# Push the Docker image to Docker Hub
sudo docker push <Your docker hub username, not your email>/qlib_image:stable
Loading