# This is a version of DockerfileLeanFoundation for ARM # Some packages from the AMD image are excluded because they are not available on ARM or take too long to build # Use base system for cleaning up wayward processes FROM phusion/baseimage:focal-1.0.0 MAINTAINER QuantConnect # Use baseimage-docker's init system. CMD ["/sbin/my_init"] # Install OS Packages: # Misc tools for running Python.NET and IB inside a headless container. RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update \ && apt-get install -y git libgtk2.0.0 cmake bzip2 curl unzip wget python3-pip python-opengl zlib1g-dev \ xvfb libxrender1 libxtst6 libxi6 libglib2.0-dev libopenmpi-dev libstdc++6 openmpi-bin \ r-base pandoc libcurl4-openssl-dev \ openjdk-11-jdk openjdk-11-jre bbe \ && apt-get clean && apt-get autoclean && apt-get autoremove --purge -y \ && rm -rf /var/lib/apt/lists/* # Install dotnet 6 sdk & runtime # The .deb packages don't support ARM, the install script does ENV PATH="/root/.dotnet:${PATH}" RUN wget https://dot.net/v1/dotnet-install.sh && \ chmod 777 dotnet-install.sh && \ ./dotnet-install.sh -c 6.0 && \ rm dotnet-install.sh ENV DOTNET_ROOT="/root/.dotnet" # Set PythonDLL variable for PythonNet ENV PYTHONNET_PYDLL="/opt/miniconda3/lib/libpython3.8.so" # Install miniconda ENV CONDA="Miniconda3-py38_23.1.0-1-Linux-aarch64.sh" ENV PATH="/opt/miniconda3/bin:${PATH}" RUN wget -q https://cdn.quantconnect.com/miniconda/${CONDA} && \ bash ${CONDA} -b -p /opt/miniconda3 && rm -rf ${CONDA} # Avoid pip install read timeouts ENV PIP_DEFAULT_TIMEOUT=120 # Install numpy first to avoid it not being resolved when installing libraries that depend on it next RUN pip install --no-cache-dir numpy==1.23.5 # The list of packages in this image is shorter than the list in the AMD images # This list only includes packages that can be installed within 2 minutes on ARM RUN pip install --no-cache-dir \ cython==0.29.35 \ pandas==1.5.3 \ scipy==1.10.1 \ numpy==1.23.5 \ wrapt==1.14.1 \ astropy==5.2.2 \ beautifulsoup4==4.12.2 \ dill==0.3.6 \ jsonschema==4.17.3 \ lxml==4.9.2 \ msgpack==1.0.5 \ numba==0.56.4 \ xarray==2023.1.0 \ plotly==5.15.0 \ jupyterlab==3.4.4 \ tensorflow==2.12.0 \ docutils==0.20.1 \ gensim==4.3.1 \ keras==2.12.0 \ lightgbm==3.3.5 \ mpi4py==3.1.4 \ nltk==3.8.1 \ graphviz==0.20.1 \ cmdstanpy==1.1.0 \ copulae==0.7.8 \ featuretools==1.26.0 \ PuLP==2.7.0 \ pymc==5.5.0 \ rauth==0.7.3 \ scikit-learn==1.2.2 \ scikit-multiflow==0.5.3 \ scikit-optimize==0.9.0 \ aesara==2.9.0 \ tsfresh==0.20.1 \ tslearn==0.5.3.2 \ tweepy==4.14.0 \ PyWavelets==1.4.1 \ umap-learn==0.5.3 \ fastai==2.7.12 \ arch==5.6.0 \ copulas==0.9.0 \ creme==0.6.1 \ cufflinks==0.17.3 \ gym==0.21 \ ipywidgets==8.0.6 \ deap==1.3.3 \ cvxpy==1.3.2 \ pykalman==0.9.5 \ pyro-ppl==1.8.5 \ sklearn-json==0.1.0 \ dtw-python==1.3.0 \ gluonts==0.13.2 \ gplearn==0.4.2 \ jax==0.4.12 \ pennylane==0.30.0 \ PennyLane-Lightning==0.31.0 \ pennylane-qiskit==0.29.0 \ mplfinance==0.12.9b7 \ hmmlearn==0.3.0 \ ta==0.10.2 \ seaborn==0.12.2 \ optuna==3.2.0 \ findiff==0.9.2 \ sktime==0.20.0 \ hyperopt==0.2.7 \ bayesian-optimization==1.4.3 \ matplotlib==3.7.1 \ sdeint==0.3.0 \ pandas_market_calendars==4.1.4 \ ruptures==1.1.8 \ simpy==4.0.1 \ scikit-learn-extra==0.3.0 \ ray==2.5.0 \ "ray[tune]"==2.5.0 \ "ray[rllib]"==2.5.0 \ fastText==0.9.2 \ h2o==3.40.0.4 \ prophet==1.1.4 \ Riskfolio-Lib==4.0.3 \ torch==2.0.1 \ torchvision==0.15.2 \ ax-platform==0.3.3 \ alphalens-reloaded==0.4.3 \ pyfolio-reloaded==0.9.5 \ altair==5.0.1 \ stellargraph==1.2.1 \ modin==0.22.2 \ persim==0.3.1 \ ripser==0.6.4 \ pydmd==0.4.1.post2306 \ EMD-signal==1.5.1 \ spacy==3.5.3 \ pandas-ta==0.3.14b \ pytorch-ignite==0.4.12 \ tensorly==0.8.1 \ mlxtend==0.22.0 \ shap==0.41.0 \ lime==0.2.0.1 \ mpmath==1.3.0 \ polars==0.18.4 \ stockstats==0.5.4 \ QuantStats==0.0.61 \ hurst==0.0.5 \ numerapi==2.14.0 \ pymdptoolbox==4.0-b3 \ panel==1.1.1 \ hvplot==0.8.4 \ py-heat==0.0.6 \ py-heat-magic==0.0.2 \ bokeh==3.1.1 \ river==0.14.0 \ stumpy==1.11.1 \ pyvinecopulib==0.6.2 \ ijson==3.2.2 \ jupyter-resource-usage==0.7.2 \ injector==0.20.1 \ openpyxl==3.1.2 \ xlrd==2.0.1 \ mljar-supervised==1.0.0 \ dm-tree==0.1.8 \ lz4==4.3.2 \ ortools==9.6.2534 \ py_vollib==1.0.1 \ thundergbm==0.3.17 \ yellowbrick==1.5 \ livelossplot==0.5.5 \ gymnasium==0.26.3 \ interpret==0.4.2 \ DoubleML==0.6.3 \ jupyter-bokeh==3.0.7 \ imbalanced-learn==0.10.1 \ scikeras==0.11.0 \ openai==0.27.8 \ openai[embeddings]==0.27.8 \ openai[wandb]==0.27.8 \ lazypredict==0.2.12 \ fracdiff==0.9.0 \ darts==0.24.0 \ fastparquet==2023.4.0 \ tables==3.8.0 \ dimod==0.12.3 \ dwave-samplers==1.0.0 \ python-statemachine==2.1.0 \ pymannkendall==1.4.3 \ Pyomo==6.6.1 \ gpflow==2.8.1 \ pyarrow==12.0.1 \ dwave-ocean-sdk==6.1.1 \ chardet==5.1.0 \ stable-baselines3==1.8.0 \ FixedEffectModel==0.0.5 \ transformers==4.30.2 \ langchain==0.0.218 \ tensorflow-ranking==0.5.1 \ pomegranate==1.0.0 \ tigramite==5.2.1.8 # Install dwave tool RUN dwave install --all -y # Install 'ipopt' solver for 'Pyomo' RUN conda install -c conda-forge ipopt==3.14.12 \ && conda clean -y --all # We install need to install separately else fails to find numpy RUN pip install --no-cache-dir Riskfolio-Lib==4.4.0 iisignature==0.24 # Install spacy models RUN python -m spacy download en_core_web_md && python -m spacy download en_core_web_sm RUN conda install -y -c conda-forge \ openmpi=4.1.5 \ && conda clean -y --all # Install nltk data RUN python -m nltk.downloader -d /usr/share/nltk_data punkt && \ python -m nltk.downloader -d /usr/share/nltk_data vader_lexicon && \ python -m nltk.downloader -d /usr/share/nltk_data stopwords && \ python -m nltk.downloader -d /usr/share/nltk_data wordnet # Install ppscore RUN wget -q https://cdn.quantconnect.com/ppscore/ppscore-master-ce93fa3.zip && \ unzip -q ppscore-master-ce93fa3.zip && cd ppscore-master && \ pip install . && cd .. && rm -rf ppscore-master && rm ppscore-master-ce93fa3.zip # Install DX Analytics RUN wget -q https://cdn.quantconnect.com/dx/dx-master-69922c0.zip && \ unzip -q dx-master-69922c0.zip && cd dx-master && \ pip install . && cd .. && rm -rf dx-master && rm dx-master-69922c0.zip # Install Pyrb RUN wget -q https://cdn.quantconnect.com/pyrb/pyrb-master-250054e.zip && \ unzip -q pyrb-master-250054e.zip && cd pyrb-master && \ pip install . && cd .. && rm -rf pyrb-master && rm pyrb-master-250054e.zip # Install SSM RUN wget -q https://cdn.quantconnect.com/ssm/ssm-master-646e188.zip && \ unzip -q ssm-master-646e188.zip && cd ssm-master && \ pip install . && cd .. && rm -rf ssm-master && rm ssm-master-646e188.zip # Due to conflicts install 'pomegranate' virtual environment package RUN python -m venv /Foundation-Pomegranate --system-site-packages && . /Foundation-Pomegranate/bin/activate \ && pip install --no-cache-dir \ pomegranate==0.14.8 \ mxnet==1.9.1 \ nbeats-keras==1.8.0 \ nbeats-pytorch==1.8.0 \ neuralprophet[live]==0.6.2 \ && python -m ipykernel install --name=Foundation-Pomegranate \ && deactivate RUN echo "{\"argv\":[\"python\",\"-m\",\"ipykernel_launcher\",\"-f\",\"{connection_file}\"],\"display_name\":\"Foundation-Py-Default\",\"language\":\"python\",\"metadata\":{\"debugger\":true}}" > /opt/miniconda3/share/jupyter/kernels/python3/kernel.json # Install wkhtmltopdf and xvfb to support HTML to PDF conversion of reports RUN apt-get update && apt install -y xvfb wkhtmltopdf && \ apt-get clean && apt-get autoclean && apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/* # Install fonts for matplotlib RUN wget -q https://cdn.quantconnect.com/fonts/foundation.zip && unzip -q foundation.zip && rm foundation.zip \ && mv "lean fonts/"* /usr/share/fonts/truetype/ && rm -rf "lean fonts/" "__MACOSX/"