Skip to content

Commit

Permalink
Merge pull request #276 from chemprop/fix-env-gpu
Browse files Browse the repository at this point in the history
Update default channels in environment.yml and refactor Dockerfile
  • Loading branch information
mliu49 committed May 13, 2022
2 parents e0f644c + d2eb3fa commit b1f3422
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 28 deletions.
27 changes: 14 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM continuumio/miniconda3:4.9.2
FROM mambaorg/micromamba:0.23.0

COPY environment.yml /tmp/environment.yml
USER root

RUN /opt/conda/bin/conda env update -n base --file /tmp/environment.yml && \
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
/opt/conda/bin/conda clean -afy && \
rm /tmp/environment.yml
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/{apt,dpkg,cache,log}

COPY . /opt/chemprop
USER $MAMBA_USER

WORKDIR /opt/chemprop
COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml

RUN micromamba install -y -n base -f /tmp/environment.yml && \
micromamba clean --all --yes

RUN /opt/conda/bin/pip install -e .
COPY --chown=$MAMBA_USER:$MAMBA_USER . /opt/chemprop

WORKDIR /opt/chemprop

ENV PATH /opt/conda/bin${PATH:+:${PATH}}
RUN /opt/conda/bin/python -m pip install -e .

ENTRYPOINT ["/bin/bash"]
CMD ["-l"]
5 changes: 2 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: chemprop

channels:
- conda-forge
- pytorch
- rdkit
- conda-forge

dependencies:
- python>=3.6
- python>=3.7
- flask>=1.1.2
- gunicorn>=20.0.4
- hyperopt>=0.2.3
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@
'parameterized>=0.8.1'
]
},
python_requires='>=3.6',
python_requires='>=3.7',
classifiers=[
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: MIT License',
Expand Down
10 changes: 0 additions & 10 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def test_train_single_task_regression(self,
expected_score: float,
train_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/train_single_regression/{name}'
# Train
self.train(
dataset_type='regression',
Expand Down Expand Up @@ -327,7 +326,6 @@ def test_train_multi_task_classification(self,
expected_score: float,
train_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/train_multi_class/{name}'
# Train
self.train(
dataset_type='classification',
Expand Down Expand Up @@ -382,7 +380,6 @@ def test_predict_single_task_regression(self,
train_flags: List[str] = None,
predict_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/pred_single_regression/{name}'
# Train
dataset_type = 'regression'
self.train(
Expand Down Expand Up @@ -416,7 +413,6 @@ def test_predict_single_task_regression(self,

def test_predict_individual_ensemble(self):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/pred_single_regression/individual_ensemble'
# Train
dataset_type = 'regression'
self.train(
Expand Down Expand Up @@ -468,7 +464,6 @@ def test_predict_multi_task_classification(self,
train_flags: List[str] = None,
predict_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/pred_multi_class/{name}'
# Train
dataset_type = 'classification'
self.train(
Expand Down Expand Up @@ -502,7 +497,6 @@ def test_predict_multi_task_classification(self,

def test_chemprop_hyperopt(self):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/hyperopt'
# Train
config_save_path = os.path.join(save_dir, 'config.json')
self.hyperopt(
Expand Down Expand Up @@ -537,7 +531,6 @@ def test_interpret_single_task_regression(self,
train_flags: List[str] = None,
interpret_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/interpret_single_regression/{name}'
# Train
dataset_type = 'regression'
self.train(
Expand Down Expand Up @@ -657,7 +650,6 @@ def test_train_spectra(self,
expected_score: float,
train_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/train_spectra/{name}'
# Train
metric = 'sid'
self.train(
Expand Down Expand Up @@ -715,7 +707,6 @@ def test_predict_spectra(self,
train_flags: List[str] = None,
predict_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/pred_spectra/{name}'
# Train
dataset_type = 'spectra'
self.train(
Expand Down Expand Up @@ -786,7 +777,6 @@ def test_train_single_task_regression_reaction(self,
expected_score: float,
train_flags: List[str] = None):
with TemporaryDirectory() as save_dir:
save_dir = f'../test/train_single_reaction/{name}'
# Train
metric = 'rmse'
self.train(
Expand Down

0 comments on commit b1f3422

Please sign in to comment.