Skip to content

Commit

Permalink
Merge branch 'master' into testsize
Browse files Browse the repository at this point in the history
  • Loading branch information
avirshup committed Oct 11, 2017
2 parents 06fd85e + 061a5a7 commit db180bb
Show file tree
Hide file tree
Showing 21 changed files with 156 additions and 79 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ docs/_build
**/tokens
**/codeship.aes
**/tmp
**/Untitled*.ipynb
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ moldesign/_static_data/components.ci*
moldesign/_static_data/aa-variants-v1.ci*
tmp
*.bak

Untitled*.ipynb
12 changes: 3 additions & 9 deletions DockerMakefiles/CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@ ambertools:
- miniconda
build: |
RUN apt-get update \
&& apt-get install --no-install-recommends -y libgfortran3 \
&& apt-get -y clean && apt-get autoremove -y --purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& apt-get install --no-install-recommends -y \
libgfortran3 gcc gfortran libfftw3-dev libnetcdf-dev \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN python -c "print('name = molecular-design-toolkit-builder\ninstitution = Autodesk\ncity = San Francisco\nstate or province = CA\ncountry = USA')" > /root/.amberrc
RUN conda install -qy -c ambermd ambertools=16.21.1
ENV AMBERHOME=/opt/conda/
nucleic_acid_builder:
requires:
- ambertools
build: |
RUN apt-get update \
&& apt-get install --no-install-recommends -y gcc gfortran libfftw3-dev libnetcdf-dev \
&& apt-get -y clean && apt-get autoremove -y --purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
dssp:
Expand Down
3 changes: 1 addition & 2 deletions DockerMakefiles/DockerMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ _ALL_:
- moldesign_complete_py2
- moldesign_minimal
- moldesign_minimal_py2
# - moldesign_notebook
- nucleic_acid_builder
- moldesign_notebook
- nwchem_build
- openblas
- pyscf_build
Expand Down
22 changes: 0 additions & 22 deletions DockerMakefiles/Dockerfile.build_environment

This file was deleted.

28 changes: 23 additions & 5 deletions DockerMakefiles/Moldesign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ moldesign_requirements:
RUN conda install -qy -c omnia parmed biopython
moldesign_minimal_requirements:
description: Base installation of the MDT library. Built from the current directory.
requires:
- moldesign_requirements
build_directory: ../
ignorefile: buildfiles/moldesign/moldesign.dockerignore
build: |
COPY requirements.txt /tmp/mdtreqs.txt
RUN apt-get update \
Expand Down Expand Up @@ -49,12 +49,30 @@ moldesign_complete_py2:


moldesign_notebook:
description: OUT OF DATE A production-ready, fully outfitted jupyter server container
description: A production-ready, fully outfitted jupyter server container
requires:
- moldesign_complete
- notebook
build: |
RUN pip install nbmolviz # == 0.7.0
RUN adduser --disabled-password --gecos '' nbuser
RUN pip install nbmolviz==0.7.0rc4
USER nbuser
RUN python -m nbmolviz activate --user
USER root
RUN python -m moldesign copyexamples
RUN jupyter nbextension enable --python --sys-prefix widgetsnbextension \
&& jupyter nbextension enable --python --sys-prefix nbmolviz
RUN chmod -R a+rw .
moldesign_stack:
description: An extra-large image with everything needed to run the example notebooks
build_directory: buildfiles/moldesign
requires:
- opsin
- symmol_base
- ambertools
- moldesign_notebook
build: |
USER nbuser
RUN mkdir -p /home/nbuser/.moldesign
ADD moldesign.yml /home/nbuser/.moldesign/moldesign.yml
9 changes: 4 additions & 5 deletions DockerMakefiles/PythonTools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ notebook:
- python_deploy_base
build_directory: buildfiles/notebook/
build: |
RUN conda install -yq matplotlib jupyter ipywidgets
RUN conda install -yq matplotlib jupyter ipywidgets nbformat
ENTRYPOINT /run_notebook.sh
EXPOSE 8888
RUN mkdir /notebooks
WORKDIR /notebooks
COPY run_notebook.sh /run_notebook.sh
# workaround below, not sure why it's necessary or even whose fault it is
RUN pip uninstall -y backports.ssl_match_hostname backports.shutil_get_terminal_size \
&& pip install backports.ssl_match_hostname backports.shutil_get_terminal_size
pyquante2:
requires:
Expand All @@ -26,6 +22,9 @@ chem_python_conda:
- deploy_requirements
description: All of the external python chemistry libraries in one place
build: |
RUN apt-get update \
&& apt-get install -y libpng12-dev \
&& cleanapt
RUN conda install -qy -c openbabel openbabel=2.4.1
RUN conda install -qy -c omnia \
biopython=1.68 \
Expand Down
11 changes: 7 additions & 4 deletions DockerMakefiles/SymMol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ symmol_build:
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mv /src/symmol/symmol /usr/local/bin
symmol:
requires:
- deploybase
symmol_base:
build: |
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gfortran libgfortran3\
&& cleanapt
copy_from:
symmol_build:
/usr/local/bin/symmol: /usr/local/bin
/usr/local/bin/symmol: /usr/local/bin

symmol:
requires:
- deploybase
- symmol_base
22 changes: 22 additions & 0 deletions DockerMakefiles/buildfiles/moldesign/moldesign.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
**/*.pyc
**/*.pyo
.idea
**/.ipynb_checkpoints/
**/pyquante.log
**/_docker_make_tmp
**/lastfailed
dist
build
**/*.egg-info
**/__pycache__
moldesign/_static_data/components.ci*
moldesign/_static_data/aa-variants-v1.ci*
**/*.bak
**/.coverage
docs/_build
**/tokens
**/codeship.aes
**/tmp
**/Untitled*.ipynb
DockerMakefiles
docs
4 changes: 4 additions & 0 deletions DockerMakefiles/buildfiles/moldesign/moldesign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
run_local:
nab: true
opsin: true
symmol: true
2 changes: 1 addition & 1 deletion DockerMakefiles/buildfiles/notebook/run_notebook.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

jupyter notebook --ip=0.0.0.0 --no-browser --port=8888 $@
jupyter notebook --ip=0.0.0.0 --no-browser --port=8888 --allow-root $@
3 changes: 2 additions & 1 deletion DockerMakefiles/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DockerMake >= 0.5.6
DockerMake >= 0.6.0rc2

8 changes: 4 additions & 4 deletions codeship-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ docker_make:
publisher:
encrypted_env_file: deployment/tokens.crypt
build:
context: ./deployment
dockerfile: ./moldesign-complete-cache.dockerfile
context: . # this one builds at the root of the repository
dockerfile: ./deployment/moldesign-complete-cache.dockerfile
add_docker: true
working_dir: /opt/molecular-design-toolkit
volumes:
Expand Down Expand Up @@ -50,8 +50,8 @@ test_moldesign_minimal_py2:
test_moldesign_complete:
encrypted_env_file: deployment/tokens.crypt
build:
context: ./deployment
dockerfile: moldesign-complete-cache.dockerfile
context: ./ # this one builds at the root of the repository
dockerfile: ./deployment/moldesign-complete-cache.dockerfile
cached: false # do not cache this! It gets built before the cache is triggered
working_dir: /opt/molecular-design-toolkit/
add_docker: true
Expand Down
33 changes: 17 additions & 16 deletions codeship-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
service: docker_make
type: serial
steps:
- command:
docker-make -p -n --dockerfile-dir /makefiles
nwchem_build
pyscf_build
deploybase
python_deploy_base
python_deploy_base_py2
- command: docker-make -p -n --dockerfile-dir /makefiles nwchem_build pyscf_build deploybase python_deploy_base python_deploy_base_py2
name: write_dockerfiles
- command: cp buildfiles/deploybase/cleanapt buildfiles/notebook/run_notebook.sh /makefiles
name: copy_contexts
Expand Down Expand Up @@ -70,15 +64,22 @@
steps:
- command: deployment/print_environment.sh

- type: serial
name: complete_tests
services:
- test_moldesign_complete
- test_moldesign_complete_py2
- test_moldesign_minimal
- test_moldesign_minimal_py2
steps:
- command: deployment/codeship_runtests.sh
- service: test_moldesign_complete
name: test_moldesign_complete
command: deployment/codeship_runtests.sh

- service: test_moldesign_complete_py2
name: test_moldesign_complete_py2
command: deployment/codeship_runtests.sh

- service: test_moldesign_minimal
name: test_moldesign_minimal
command: deployment/codeship_runtests.sh

- service: test_moldesign_minimal_py2
name: test_moldesign_minimal_py2
command: deployment/codeship_runtests.sh


- name: publish
service: publisher
Expand Down
3 changes: 2 additions & 1 deletion deployment/build-env.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM python:2.7-slim

# This is the environment that "docker-make" will run in on the CI server
# The expected build context is the root of the MDT repository
RUN apt-get update && apt-get install -y curl

# Install docker CLI only, not the full engine
Expand Down
5 changes: 4 additions & 1 deletion deployment/moldesign-complete-cache.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# this is meant to built at the ROOT of the repository

FROM moldesign_complete:dev
ADD requirements.txt provision_testrunner_image.sh /tmp/
ADD DockerMakefiles /opt/molecular-design-toolkit/DockerMakefiles
ADD deployment/requirements.txt deployment/provision_testrunner_image.sh /tmp/
RUN cd /tmp && ./provision_testrunner_image.sh
RUN pip install twine
WORKDIR /opt/molecular-design-toolkit
Expand Down
18 changes: 18 additions & 0 deletions moldesign/_tests/test_pdbfixer_xface.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import moldesign as mdt
from moldesign import units as u
from .helpers import get_data_path

import pytest

Expand Down Expand Up @@ -91,6 +92,23 @@ def test_mutation_nomenclature_string_only(pdb3aid):
assert len(mut25) == 2
assert [r.resname for r in mut25] == ['MET', 'MET']

def test_mutation_topology(pdb1yu8):
""" Test the topology of the backbone atoms for a mutated molecule. """
molecule = pdb1yu8
mutation_residues = ["X.13G"]
mutated_molecule = mdt.mutate_residues(molecule, mutation_residues)
# Check that the number of bonds for backbone atoms match.
for res, mut_res in zip(molecule.residues, mutated_molecule.residues):
if not res.backbone:
continue
for atom in res.backbone:
bonds = [bond for bond in molecule.bond_graph[atom] if bond.name in res.backbone]
mut_atom = mutated_molecule.chains["X"].residues[mut_res.name].atoms[atom.name]
mut_bonds = mutated_molecule.bond_graph[mut_atom]
mut_bonds = [bond for bond in mutated_molecule.bond_graph[mut_atom] \
if bond.name in mut_res.backbone]
assert len(bonds) == len(mut_bonds)


@pytest.mark.screening
def test_multiple_mutations(pdb3aid):
Expand Down
12 changes: 10 additions & 2 deletions moldesign/compute/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,19 @@ def init_config():

for pkg, do_remote in list(config.run_remote.items()):
if do_remote:
getattr(packages, pkg).force_remote = True
try:
getattr(packages, pkg).force_remote = True
except AttributeError:
print('WARNING: unknown key "%s" in %s' % (pkg, path),
file=sys.stderr)

for pkg, do_local in list(config.run_local.items()):
if do_local:
getattr(packages, pkg).run_local = True
try:
getattr(packages, pkg).run_local = True
except AttributeError:
print('WARNING: unknown key "%s" in %s' % (pkg, path),
file=sys.stderr)


def _check_override(tagname, expected, path):
Expand Down
2 changes: 1 addition & 1 deletion moldesign/compute/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def make_job(self, **kwargs):

nwchem = InterfacedExecutable('nwchem.exe', None, 'nwchem', version_flag=None)
opsin = InterfacedExecutable('opsin', None, 'opsin', version_flag=None)
nab = InterfacedExecutable('nab', '16', 'nucleic_acid_builder', version_flag=None)
nab = InterfacedExecutable('nab', '16', 'ambertools', version_flag=None)
symmol = InterfacedExecutable('symmol', None, 'symmol', version_flag=None)
tleap = InterfacedExecutable('tleap', '16', 'ambertools', version_flag=None)
antechamber = InterfacedExecutable('antechamber', '16', 'ambertools', version_flag=None)
Expand Down
Loading

0 comments on commit db180bb

Please sign in to comment.