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

Open
wants to merge 7 commits 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
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

24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only for stable;

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

## Build docker images
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the home page. Users care more about usage of docker image instead of creating it.

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. For more information, please see: https://qlib.readthedocs.io/en/latest/start/installation.html

## 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this in the README or docs.


# 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:<version stable or nightly>

# Push the Docker image to Docker Hub
sudo docker push <Your docker hub username, not your email>/qlib_image:<version stable or nightly>
20 changes: 20 additions & 0 deletions docs/start/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,23 @@ Use the following code to make sure the installation successful:
>>> import qlib
>>> qlib.__version__
<LATEST VERSION>


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.
.. code-block:: 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:<version stable or nightly>

# Push the Docker image to Docker Hub
sudo docker push <Your docker hub username, not your email>/qlib_image:<version stable or nightly>
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def get_version(rel_path: str) -> str:
"numpy>=1.12.0, <1.24",
"pandas>=0.25.1",
"scipy>=1.7.3",
# scs is a dependency package,
# and the latest version of scs: scs-3.2.4.post3.tar.gz causes the documentation build to fail,
# so we have temporarily limited the version of scs.
"scs<=3.2.4",
"requests>=2.18.0",
"sacred>=0.7.4",
"python-socketio",
Expand Down
Loading