diff --git a/tutorials/CondaEnvironmentInstructions.md b/tutorials/CondaEnvironmentInstructions.md index 996a940..e064bee 100644 --- a/tutorials/CondaEnvironmentInstructions.md +++ b/tutorials/CondaEnvironmentInstructions.md @@ -7,8 +7,6 @@ In this document, we will show you two different ways to incorporate `miniconda` As a note, for SAMPL challenges you should always install your required python packages into the `base` environment. Please **DO NOT** create a separate conda virtual environment as this will cause command line parsing issues for our SMILES inputs. -called a [`Dockerfile`](https://docs.docker.com/engine/reference/builder/#:~:text=to%20Docker%20Hub.-,BuildKit,-%F0%9F%94%97) - # Docker Engine Conda Environment Creation ## Section 1: Creating a Conda Environment Inside a Container using a `miniconda` Parent Image ### Part 1: Create your conda environment diff --git a/tutorials/SingularityTutorial.md b/tutorials/SingularityTutorial.md index 847834f..c46e3d1 100644 --- a/tutorials/SingularityTutorial.md +++ b/tutorials/SingularityTutorial.md @@ -67,23 +67,23 @@ A working version of the Autodock Vina container we will build in this tutorial ## Outline -* [Section 1: Build the Autodock Vina base container]() - * [1.1: Setup]() - * [1.2: Run a pre-made Docker container and create a conda environment]() - * [1.3: Install conda environment (from Section 1.2) into your container]() - * [1.4: Download the command line programs Autodock Vina and MGL Tools executables for use in the docking container]() - * [1.5: Install Autodock Vina and MGL Tools into your container]() - * [1.6: Build the base container]() -* [Section 2: Build the container with Autodock Vina Docking methods]() - * [2.1: Setup]() - * [2.2: Add the docking code]() - * [2.3: Create a setup.py file]() - * [2.4: Write a definition_file with instructions to build your container]() - * [2.5: Build the docking container]() -* [Section 3: Test/Run your container]() -* [Section 4: Troubleshooting]() -* [Section 5: Building your own docking container]() -* [Section 6: Other Important Information]() +* [Section 1: Build the Autodock Vina base container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#section-1-build-the-autodock-vina-base-container) + * [1.1: Setup](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#11-setup) + * [1.2: Run a pre-made Docker container and create a conda environment](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#12-run-a-pre-made-docker-container-and-create-a-conda-environment) + * [1.3: Install conda environment (from Section 1.2) into your container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#13-install-conda-environment-from-section-12-into-your-container) + * [1.4: Download the command line programs Autodock Vina and MGL Tools executables for use in the docking container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#14-download-the-command-line-programs-autodock-vina-and-mgl-tools-executables-for-use-in-the-docking-container) + * [1.5: Install Autodock Vina and MGL Tools into your container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#15-install-autodock-vina-and-mgl-tools-into-your-container) + * [1.6: Build the base container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#16-build-the-base-container) +* [Section 2: Build the container with Autodock Vina Docking methods](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#section-2-build-the-container-with-autodock-vina-docking-methods) + * [2.1: Setup](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#21-setup) + * [2.2: Add the docking code](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#22-add-the-docking-code) + * [2.3: Create a setup.py file](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#23-create-a-setuppy-file) + * [2.4: Write a definition_file with instructions to build your container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#24-write-a-definition_file-with-instructions-to-build-your-container) + * [2.5: Build the docking container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#25-build-the-docking-container) +* [Section 3: Test/Run your container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#section-3-testrun-your-container) +* [Section 4: Troubleshooting](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#section-4-troubleshooting) +* [Section 5: Building your own docking container](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#section-5-building-your-own-docking-container) +* [Section 6: Other Important Information](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/SingularityTutorial.md#section-6-other-important-information) @@ -557,7 +557,7 @@ In this section, we will use the wrapper [`ever_given`](https://pypi.org/project ## Section 5: Building your own docking container * For an example template of a docking container directory, please see [`SAMPL-containers/tutorial/templates/docking`](https://github.com/samplchallenges/SAMPL-containers/tree/main/tutorials/templates/docking/) -* For more information on how to build your own conda environment inside a container, please see [CondaEnvInstructions.pdf](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/CondaEnvInstructions.pdf) +* For more information on how to build your own conda environment inside a container, please see [CondaEnvironmentInstructions.md](https://github.com/samplchallenges/SAMPL-containers/blob/main/tutorials/CondaEnvironmentInstructions.md) ## Section 6: Other Important Information * For more detailed information on how to use Singularity please see the following resources: diff --git a/tutorials/ever_given/LICENSE b/tutorials/ever_given/LICENSE deleted file mode 100644 index ee6256c..0000000 --- a/tutorials/ever_given/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/tutorials/ever_given/Pipfile b/tutorials/ever_given/Pipfile deleted file mode 100644 index 63de8f8..0000000 --- a/tutorials/ever_given/Pipfile +++ /dev/null @@ -1,13 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -ever-given = {editable = true, path = "."} - -[requires] -python_version = "3.8" - -[dev-packages] -pytest = "*" diff --git a/tutorials/ever_given/Pipfile.lock b/tutorials/ever_given/Pipfile.lock deleted file mode 100644 index 5befd6b..0000000 --- a/tutorials/ever_given/Pipfile.lock +++ /dev/null @@ -1,144 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "630229bba972ffd98ba706a5b54b57a0e674b5fb0664dba43478e0b0e5227447" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.8" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "certifi": { - "hashes": [ - "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872", - "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569" - ], - "version": "==2021.10.8" - }, - "charset-normalizer": { - "hashes": [ - "sha256:e019de665e2bcf9c2b64e2e5aa025fa991da8720daa3c1138cadd2fd1856aed0", - "sha256:f7af805c321bfa1ce6714c51f254e0d5bb5e5834039bc17db7ebe3a4cec9492b" - ], - "markers": "python_version >= '3'", - "version": "==2.0.7" - }, - "docker": { - "hashes": [ - "sha256:7a79bb439e3df59d0a72621775d600bc8bc8b422d285824cb37103eab91d1ce0", - "sha256:d916a26b62970e7c2f554110ed6af04c7ccff8e9f81ad17d0d40c75637e227fb" - ], - "markers": "python_version >= '3.6'", - "version": "==5.0.3" - }, - "ever-given": { - "editable": true, - "path": "." - }, - "idna": { - "hashes": [ - "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", - "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" - ], - "markers": "python_version >= '3'", - "version": "==3.3" - }, - "requests": { - "hashes": [ - "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24", - "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==2.26.0" - }, - "urllib3": { - "hashes": [ - "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", - "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.7" - }, - "websocket-client": { - "hashes": [ - "sha256:0133d2f784858e59959ce82ddac316634229da55b498aac311f1620567a710ec", - "sha256:8dfb715d8a992f5712fff8c843adae94e22b22a99b2c5e6b0ec4a1a981cc4e0d" - ], - "markers": "python_version >= '3.6'", - "version": "==1.2.1" - } - }, - "develop": { - "attrs": { - "hashes": [ - "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1", - "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==21.2.0" - }, - "iniconfig": { - "hashes": [ - "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", - "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32" - ], - "version": "==1.1.1" - }, - "packaging": { - "hashes": [ - "sha256:096d689d78ca690e4cd8a89568ba06d07ca097e3306a4381635073ca91479966", - "sha256:14317396d1e8cdb122989b916fa2c7e9ca8e2be9e8060a6eff75b6b7b4d8a7e0" - ], - "markers": "python_version >= '3.6'", - "version": "==21.2" - }, - "pluggy": { - "hashes": [ - "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", - "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" - ], - "markers": "python_version >= '3.6'", - "version": "==1.0.0" - }, - "py": { - "hashes": [ - "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3", - "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.10.0" - }, - "pyparsing": { - "hashes": [ - "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", - "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" - ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.4.7" - }, - "pytest": { - "hashes": [ - "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89", - "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134" - ], - "index": "pypi", - "version": "==6.2.5" - }, - "toml": { - "hashes": [ - "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", - "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" - ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.10.2" - } - } -} diff --git a/tutorials/ever_given/README.md b/tutorials/ever_given/README.md deleted file mode 100644 index 374ced5..0000000 --- a/tutorials/ever_given/README.md +++ /dev/null @@ -1 +0,0 @@ -Simple wrapper for docker sdk. diff --git a/tutorials/ever_given/ever_given/__init__.py b/tutorials/ever_given/ever_given/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tutorials/ever_given/ever_given/wrapper.py b/tutorials/ever_given/ever_given/wrapper.py deleted file mode 100644 index dc5152c..0000000 --- a/tutorials/ever_given/ever_given/wrapper.py +++ /dev/null @@ -1,132 +0,0 @@ -import copy -import shlex -import sys -from pathlib import Path - -import docker - - -from . import log_processing - -GUEST_INPUT_DIR = Path("/mnt") / "inputs" -GUEST_OUTPUT_DIR = Path("/mnt") / "outputs" - - -def _guest_input_path(filename): - return GUEST_INPUT_DIR / Path(filename).name - - -def prepare_commandline(command, args_dict): - return ( - command - + " " - + " ".join( - [f"--{key} {shlex.quote(str(value))}" for key, value in args_dict.items()] - ) - ) - - -def _parse_output(host_path, raw_text, output_file_keys): - result = {} - for line in raw_text.decode("utf-8").splitlines(): - lineparts = line.split(maxsplit=1) - if len(lineparts) == 2: - key, value = lineparts - value = value.strip() - if output_file_keys and key in output_file_keys: - print(host_path, key, value) - result[key] = _convert_guest_to_host_path(host_path, value) - else: - result[key] = value - - return result - - -def _convert_guest_to_host_path(host_path, filepath): - filepath = GUEST_OUTPUT_DIR / filepath - relative_path = filepath.relative_to(GUEST_OUTPUT_DIR) - # so we don't care whether container outputs relative or absolute paths - return str(Path(host_path) / relative_path) - - -def _convert_file_kwargs(file_kwargs): - """ - file_kwargs has key: path, where path is on the host - generate a dict of host: guest path mappings that can be used to generate bind commands and return a file_kwargs pointing to the files with corresponding paths that are accessible to the container - """ - dirpaths = {} - final_file_kwargs = {} - for idx, (key, pathname) in enumerate(file_kwargs.items()): - path = Path(pathname).resolve() - dirpath = path.parent - basename = path.name - if dirpath not in dirpaths: - dirpaths[dirpath] = Path("/mnt") / f"inputs{idx}" - - key = str(key) - final_file_kwargs[key] = str(dirpaths[dirpath] / basename) - return dirpaths, final_file_kwargs - - -def run( - container_uri, - command="", - *, - file_kwargs, - kwargs, - output_dir=None, - output_file_keys=None, - log_handler=None, -): - """ - kwargs will be passed to container as --key=value - where value will be shell escaped - file_kwargs must be a dict of key to Python file-like object - the underlying files will be made available to the container as bound mount points (readonly). - Note that we must ensure the directories thus made available to the container only have challenge-wide data, no outputs from other submissions! - output_dir, if not None, will be mounted r/w for container to write outputs - output_file_keys is a set of keys for file output types. Their values will be mapped from paths on the guest to paths on the host. - command is optional - Iterate over key/values of results. - """ - - input_dir_map, final_file_kwargs = _convert_file_kwargs(file_kwargs) - final_kwargs = copy.deepcopy(kwargs) - final_kwargs.update(final_file_kwargs) - - final_command = prepare_commandline(command, final_kwargs) - - running_container = run_container( - container_uri, final_command, input_dir_map, output_dir=output_dir - ) - - result = log_processing.process_messages(running_container, log_handler) - - yield from _parse_output(output_dir, result, output_file_keys).items() - - running_container.reload() - if running_container.status != "exited": - print(f"Container status is {running_container.status}", file=sys.stderr) - running_container.remove() - - -def run_container(container_uri, command, inputdir_map=None, output_dir=None): - client = docker.from_env() - volumes = {} - for inputdir, guest_input_dir in inputdir_map.items(): - volumes[str(inputdir)] = {"bind": str(guest_input_dir), "mode": "ro"} - if output_dir: - output_dir = Path(output_dir).resolve() - volumes[str(output_dir)] = {"bind": str(GUEST_OUTPUT_DIR), "mode": "rw"} - command = f" --output-dir {GUEST_OUTPUT_DIR} {command}" - - running_container = client.containers.run( - container_uri, - command, - volumes=volumes, - network_disabled=True, - network_mode="none", - remove=False, - detach=True, - ) - return running_container diff --git a/tutorials/ever_given/pyproject.toml b/tutorials/ever_given/pyproject.toml deleted file mode 100644 index 9787c3b..0000000 --- a/tutorials/ever_given/pyproject.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" diff --git a/tutorials/ever_given/run.py b/tutorials/ever_given/run.py deleted file mode 100644 index 8e5c41f..0000000 --- a/tutorials/ever_given/run.py +++ /dev/null @@ -1,62 +0,0 @@ -import argparse -from pathlib import Path - -from ever_given import wrapper - -""" --file-key will get passed into file_kwargs as --key= in file_kwargs -into evergiven; container will get --key=filename - -Example command: -python ../ever_given/run.py robbason/calc-coords:latest --file-molfile tests/data/ChEBI_16716.mdl --output-keys conformation - -(assuming you are in app directory and you have built the container in example_container/coords as robbason/calc-coords using its build.sh) -""" - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("container_uri") - parser.add_argument("--command", default="") - parser.add_argument( - "--output-keys", - help="comma separated list of output keys to be loaded from container output", - default="", - ) - _parsed, unknown = parser.parse_known_args() - # print("unknown", unknown) - if len(unknown) % 2 != 0: - raise ValueError("Must pass key/value pairs") - for idx in range(len(unknown) // 2): - arg = unknown[idx * 2] - parser.add_argument(arg) - args = parser.parse_args() - kwargs = {} - file_kwargs = {} - FILE_PREFIX = "file_" - for key, value in vars(args).items(): - if key.startswith(FILE_PREFIX): - file_kwargs[key[len(FILE_PREFIX) :]] = value - else: - if key not in ("command", "container_uri", "output_keys"): - kwargs[key] = value - print("command?", args.command) - print("file kwargs", file_kwargs) - print("kwargs", kwargs) - output_file_keys = args.output_keys.split(",") - output_dir = "evergiven_output" - print("Putting output into", output_dir) - results = {} - for k, v in wrapper.run( - args.container_uri, - command=args.command, - file_kwargs=file_kwargs, - kwargs=kwargs, - output_dir=str(output_dir), - output_file_keys=output_file_keys, - ): - results[k] = v - print("Results:", results) - - -if __name__ == "__main__": - main() diff --git a/tutorials/ever_given/setup.cfg b/tutorials/ever_given/setup.cfg deleted file mode 100644 index a1eea57..0000000 --- a/tutorials/ever_given/setup.cfg +++ /dev/null @@ -1,19 +0,0 @@ -[metadata] -name = ever_given -version = 0.0.6 -author = Mike Henry -author_email = mhenry5@uci.edu -description = A small wrapper around the docker sdk -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/samplchallenges/SAMPL-league/tree/main/ever_given -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) - Operating System :: OS Independent - -[options] -packages = ever_given -python_requires = >=3.6 -install_requires = - docker diff --git a/tutorials/ever_given/setup.py b/tutorials/ever_given/setup.py deleted file mode 100644 index b908cbe..0000000 --- a/tutorials/ever_given/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -import setuptools - -setuptools.setup() diff --git a/tutorials/ever_given/tests/data/ChEBI_16716.mdl b/tutorials/ever_given/tests/data/ChEBI_16716.mdl deleted file mode 100644 index d4d11f8..0000000 --- a/tutorials/ever_given/tests/data/ChEBI_16716.mdl +++ /dev/null @@ -1,17 +0,0 @@ - - Marvin 10310613082D - - 6 6 0 0 0 0 999 V2000 - 0.7145 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.7145 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -0.7145 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -0.7145 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2 1 2 0 0 0 0 - 3 1 1 0 0 0 0 - 4 3 2 0 0 0 0 - 5 2 1 0 0 0 0 - 6 4 1 0 0 0 0 - 5 6 2 0 0 0 0 -M END diff --git a/tutorials/ever_given/tests/test_volume.py b/tutorials/ever_given/tests/test_volume.py deleted file mode 100644 index 0960f80..0000000 --- a/tutorials/ever_given/tests/test_volume.py +++ /dev/null @@ -1,23 +0,0 @@ -import os.path -import tempfile - -import pytest - -import ever_given.wrapper - - -def test_run_inputfile_only(): - test_mdlfile_rel = "data/ChEBI_16716.mdl" - test_mdlfile_abs = os.path.join(os.path.dirname(__file__), test_mdlfile_rel) - container_uri = "ghcr.io/robbason/calc-molwt:latest" - file_kwargs = {"molfile": test_mdlfile_abs} - results = { - key: value - for key, value in ever_given.wrapper.run( - container_uri, kwargs={}, file_kwargs=file_kwargs - ) - } - - assert set(results.keys()) == {"numAtoms", "numBonds", "molWeight"} - molWeight = float(results["molWeight"].strip()) - assert pytest.approx(molWeight, 78.046950192)