FS-TFP/environment/docker_files/federatedscope-torch1.8-app...

62 lines
2.3 KiB
Docker

# The federatedscope image includes all runtime stuffs of federatedscope,
# with customized miniconda and required packages installed.
# based on the nvidia-docker
# NOTE: please pre-install the NVIDIA drivers and `nvidia-docker2` in the host machine,
# see details in https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
FROM nvidia/cuda:10.2-runtime-ubuntu18.04
# change bash as default
SHELL ["/bin/bash", "-c"]
# shanghai zoneinfo
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# install basic tools
RUN apt-get -y update \
&& apt-get -y install curl git gcc g++ make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev python-dev libmysqlclient-dev
# install miniconda, in batch (silent) mode, does not edit PATH or .bashrc or .bash_profile
RUN apt-get update -y \
&& apt-get install -y wget
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py39_23.1.0-1-Linux-x86_64.sh \
&& bash Miniconda3-py39_23.1.0-1-Linux-x86_64.sh -b \
&& rm Miniconda3-py39_23.1.0-1-Linux-x86_64.sh
ENV PATH=/root/miniconda3/bin:${PATH}
RUN source activate
# install packages required by federatedscope
RUN conda update -y conda \
&& conda config --add channels conda-forge
# basic machine learning env
RUN conda install -y numpy=1.21.2 scikit-learn=1.0.2 scipy=1.7.3 pandas=1.4.1 -c scikit-learn \
&& conda clean -a -y
# basic torch env
RUN conda install -y pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch \
&& conda clean -a -y
# torch helper package
RUN conda install -y fvcore iopath -c fvcore -c iopath -c conda-forge \
&& conda clean -a -y
# for graph
RUN conda install -y pyg==2.0.1 -c pyg \
&& conda install -y rdkit=2021.09.4 -c conda-forge \
&& conda install -y nltk \
&& conda clean -a -y
# for speech and nlp
RUN conda install -y sentencepiece textgrid typeguard -c conda-forge \
&& conda install -y transformers==4.16.2 tokenizers==0.10.3 datasets -c huggingface -c conda-forge \
&& conda install -y torchtext -c pytorch \
&& conda clean -a -y
# auxiliaries (communications, monitoring, etc.)
RUN conda install -y wandb tensorboard tensorboardX pympler -c conda-forge \
&& pip install grpcio grpcio-tools protobuf==3.19.4 setuptools==61.2.0 \
&& conda clean -a -y