Docker & Conda Deployments
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
DGL-LifeSci provides multiple deployment and installation pathways to accommodate different hardware environments (CPU/GPU) and user requirements. The project supports containerized environments via Docker for Continuous Integration (CI) and release workflows, as well as package-based installations through Conda and Pip for local development and research. Sources: README.md:32-60, docker/README.md:1-5
The deployment infrastructure is designed to handle complex dependencies common in cheminformatics, such as RDKit, while ensuring compatibility across Linux (Ubuntu 16.04+), macOS, and Windows 10. These deployments provide the necessary environment for running molecular property prediction, generative models, and reaction prediction examples implemented in the library. Sources: README.md:34-40, examples/README.md:3-7
Docker Infrastructure
The project utilizes Docker primarily for CI and release scripts. This ensures a consistent environment for automated testing and builds. Sources: docker/README.md:3-5, CONTRIBUTING.md:46-48
Image Variants
Two primary Docker images are maintained to support different compute backends:
- CPU Image: Tailored for environments without dedicated graphics hardware or for training tasks where multi-process CPU execution is preferred (e.g., DGMG models). Sources: docker/README.md:9-11, examples/generative_models/dgmg/README.md:65-70
- GPU Image: Optimized for CUDA-enabled environments to accelerate graph neural network training and inference. Sources: docker/README.md:13-15, examples/reaction_prediction/rexgen_direct/README.md:65-75
Build and Distribution Flow
The following diagram illustrates the workflow for building and distributing the project's Docker containers.
The build process uses standard Docker commands to tag and push images to the dgllib organization on Docker Hub. Sources: docker/README.md:7-23
Conda and Pip Distribution
Conda is the recommended installation method for DGL-LifeSci due to its ability to manage the RDKit dependency effectively. Sources: README.md:46-56
Dependency Management
DGL-LifeSci requires a specific stack of libraries for full functionality:
- Python: 3.6+
- DGL: 0.5.2+
- PyTorch: 1.5.0+
- RDKit: 2018.09.3 (Recommended)
- Hyperopt: Required for hyperparameter search.
Sources: README.md:38-40, README.md:54-55, examples/property_prediction/csv_data_configuration/README.md:34-36
Installation Procedures
| Method | Command | Use Case |
|---|---|---|
| Conda | conda install -c dglteam dgllife | Recommended for general use and RDKit support |
| Pip | pip install dgllife | Standard Python package installation |
| Source | python setup.py install | For using experimental features from master |
Sources: README.md:52-68
Data and Asset Management
During deployment, the library handles the retrieval and caching of large datasets and pre-trained models. This is managed through automated downloaders that interface with DGL's cloud storage. Sources: python/dgllife/data/esol.py:84-88, python/dgllife/data/alchemy.py:170-175
Data Retrieval Workflow
When a dataset class (e.g., ESOL, TencentAlchemyDataset) is initialized, the system checks for local cached versions before attempting a remote download.
Environment Verification
Post-deployment verification is essential to ensure the backend (typically PyTorch) is correctly configured. Upon first import, DGL prompts the user to select the preferred backend, which is then stored in the environment configuration. Sources: README.md:70-85
Summary
Docker and Conda deployments provide the foundational environment for DGL-LifeSci. Docker containers facilitate robust CI/CD workflows for both CPU and GPU architectures, while Conda serves as the primary distribution channel for end-users, simplifying the integration of complex cheminformatics dependencies like RDKit. Sources: docker/README.md:3-5, README.md:46-50