idmtools-platform-comps 0.0.0.dev0__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. idmtools_platform_comps-0.0.3/.bumpversion.cfg +33 -0
  2. idmtools_platform_comps-0.0.3/LICENSE.TXT +3 -0
  3. idmtools_platform_comps-0.0.3/MANIFEST.in +5 -0
  4. idmtools_platform_comps-0.0.3/Makefile +13 -0
  5. idmtools_platform_comps-0.0.3/PKG-INFO +100 -0
  6. idmtools_platform_comps-0.0.3/README.md +70 -0
  7. idmtools_platform_comps-0.0.3/VERSION +1 -0
  8. idmtools_platform_comps-0.0.3/idmtools_platform_comps/__init__.py +25 -0
  9. idmtools_platform_comps-0.0.3/idmtools_platform_comps/cli/__init__.py +4 -0
  10. idmtools_platform_comps-0.0.3/idmtools_platform_comps/cli/cli_functions.py +50 -0
  11. idmtools_platform_comps-0.0.3/idmtools_platform_comps/cli/comps.py +492 -0
  12. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_cli.py +48 -0
  13. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_operations/__init__.py +6 -0
  14. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_operations/asset_collection_operations.py +263 -0
  15. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_operations/experiment_operations.py +569 -0
  16. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_operations/simulation_operations.py +678 -0
  17. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_operations/suite_operations.py +228 -0
  18. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_operations/workflow_item_operations.py +269 -0
  19. idmtools_platform_comps-0.0.3/idmtools_platform_comps/comps_platform.py +309 -0
  20. idmtools_platform_comps-0.0.3/idmtools_platform_comps/plugin_info.py +168 -0
  21. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_operations/__init__.py +6 -0
  22. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_operations/simulation_operations.py +77 -0
  23. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_operations/workflow_item_operations.py +73 -0
  24. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_platform.py +44 -0
  25. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_work_items/__init__.py +4 -0
  26. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_work_items/comps_work_order_task.py +29 -0
  27. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_work_items/comps_workitems.py +113 -0
  28. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_work_items/icomps_workflowitem.py +71 -0
  29. idmtools_platform_comps-0.0.3/idmtools_platform_comps/ssmt_work_items/work_order.py +54 -0
  30. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/__init__.py +4 -0
  31. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/assetize_output/__init__.py +4 -0
  32. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/assetize_output/assetize_output.py +125 -0
  33. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/assetize_output/assetize_ssmt_script.py +144 -0
  34. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/base_singularity_work_order.json +6 -0
  35. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/download/__init__.py +4 -0
  36. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/download/download.py +178 -0
  37. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/download/download_ssmt.py +81 -0
  38. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/download_experiment.py +116 -0
  39. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/file_filter_workitem.py +519 -0
  40. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/general.py +358 -0
  41. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/linux_mounts.py +73 -0
  42. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/lookups.py +123 -0
  43. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/package_version.py +489 -0
  44. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/python_requirements_ac/__init__.py +4 -0
  45. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/python_requirements_ac/create_asset_collection.py +155 -0
  46. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/python_requirements_ac/install_requirements.py +109 -0
  47. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/python_requirements_ac/requirements_to_asset_collection.py +374 -0
  48. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/python_version.py +40 -0
  49. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/scheduling.py +154 -0
  50. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/singularity_build.py +491 -0
  51. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/spatial_output.py +76 -0
  52. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/ssmt_utils/__init__.py +6 -0
  53. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/ssmt_utils/common.py +70 -0
  54. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/ssmt_utils/file_filter.py +568 -0
  55. idmtools_platform_comps-0.0.3/idmtools_platform_comps/utils/sweeping.py +162 -0
  56. idmtools_platform_comps-0.0.3/idmtools_platform_comps.egg-info/PKG-INFO +100 -0
  57. idmtools_platform_comps-0.0.3/idmtools_platform_comps.egg-info/SOURCES.txt +69 -0
  58. idmtools_platform_comps-0.0.3/idmtools_platform_comps.egg-info/entry_points.txt +9 -0
  59. idmtools_platform_comps-0.0.3/idmtools_platform_comps.egg-info/requires.txt +15 -0
  60. {idmtools_platform_comps-0.0.0.dev0 → idmtools_platform_comps-0.0.3}/idmtools_platform_comps.egg-info/top_level.txt +3 -0
  61. idmtools_platform_comps-0.0.3/pyproject.toml +86 -0
  62. {idmtools_platform_comps-0.0.0.dev0 → idmtools_platform_comps-0.0.3}/setup.cfg +4 -4
  63. idmtools_platform_comps-0.0.3/ssmt_image/Dockerfile +52 -0
  64. idmtools_platform_comps-0.0.3/ssmt_image/Makefile +21 -0
  65. idmtools_platform_comps-0.0.3/ssmt_image/__init__.py +6 -0
  66. idmtools_platform_comps-0.0.3/ssmt_image/bootstrap.sh +30 -0
  67. idmtools_platform_comps-0.0.3/ssmt_image/build_docker_image.py +161 -0
  68. idmtools_platform_comps-0.0.3/ssmt_image/pip.conf +3 -0
  69. idmtools_platform_comps-0.0.3/ssmt_image/push_docker_image.py +49 -0
  70. idmtools_platform_comps-0.0.3/ssmt_image/requirements.txt +9 -0
  71. idmtools_platform_comps-0.0.0.dev0/PKG-INFO +0 -41
  72. idmtools_platform_comps-0.0.0.dev0/README.md +0 -21
  73. idmtools_platform_comps-0.0.0.dev0/idmtools_platform_comps/__init__.py +0 -8
  74. idmtools_platform_comps-0.0.0.dev0/idmtools_platform_comps.egg-info/PKG-INFO +0 -41
  75. idmtools_platform_comps-0.0.0.dev0/idmtools_platform_comps.egg-info/SOURCES.txt +0 -7
  76. idmtools_platform_comps-0.0.0.dev0/pyproject.toml +0 -32
  77. {idmtools_platform_comps-0.0.0.dev0 → idmtools_platform_comps-0.0.3}/idmtools_platform_comps.egg-info/dependency_links.txt +0 -0
@@ -0,0 +1,33 @@
1
+ [bumpversion]
2
+ current_version = 3.0.0+nightly
3
+ commit = False
4
+ tag = False
5
+ parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<release>\+\w+)?(\.(?P<build>\d+))?
6
+ serialize =
7
+ {major}.{minor}.{patch}{release}.{build}
8
+ {major}.{minor}.{patch}{release}
9
+ {major}.{minor}.{patch}
10
+
11
+ [bumpversion:part:release]
12
+ optional_value = prod
13
+ first_value = prod
14
+ values =
15
+ prod
16
+ +nightly
17
+
18
+ [bumpversion:part:build]
19
+
20
+ [bumpversion:file:VERSION]
21
+ serialize = {major}.{minor}.{patch}
22
+
23
+ [bumpversion:file:./idmtools_platform_comps/__init__.py]
24
+ search = __version__ = "{current_version}"
25
+ replace = __version__ = "{new_version}"
26
+ serialize = {major}.{minor}.{patch}{release}
27
+ {major}.{minor}.{patch}
28
+
29
+ [bumpversion:file:./pyproject.toml]
30
+ search = version = "{current_version}"
31
+ replace = version = "{new_version}"
32
+ serialize = {major}.{minor}.{patch}{release}
33
+ {major}.{minor}.{patch}
@@ -0,0 +1,3 @@
1
+ idmtools is licensed under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 License.
2
+
3
+ To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include idmtools_platform_comps/utils/base_singularity_work_order.json
3
+ include LICENSE.TXT
4
+ prune tests
5
+ prune prototypes
@@ -0,0 +1,13 @@
1
+ PACKAGE_NAME=idmtools_platform_comps
2
+ include $(abspath ../dev_scripts/package_general.mk)
3
+
4
+
5
+ help:
6
+ help-from-makefile -f ../dev_scripts/package_general.mk -f ./Makefile
7
+
8
+ # Release related rules
9
+ ssmt-image: ## Build SSMT Docker image
10
+ $(MAKE) -C ssmt_image docker
11
+
12
+ ssmt-image-release: ## Push image to staging
13
+ $(MAKE) -C ssmt_image docker-release-staging
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: idmtools_platform_comps
3
+ Version: 0.0.3
4
+ Summary: Comps platform for IDM-Tools
5
+ Author-email: Zhaowei Du <zdu@idmod.org>, Sharon Chen <shchen@idmod.org>, Clinton Collins <ccollins@idmod.org>, Benoit Raybaud <braybaud@idmod.org>, Clark Kirkman IV <ckirkman@idmod.org>, Ye Chen <yechen@idmod.org>, Mary Fisher <mafisher@idmod.org>, Mandy Izzo <mizzo@idmod.org>, Jen Schripsema <jschripsema@idmod.org>, Ross Carter <rcarter@idmod.org>
6
+ Project-URL: Homepage, https://github.com/InstituteforDiseaseModeling/idmtools
7
+ Keywords: modeling,IDM
8
+ Classifier: Programming Language :: Python :: 3.8
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE.TXT
16
+ Requires-Dist: idmtools<1.0.0,>=0.0.0
17
+ Requires-Dist: pyCOMPS~=2.11
18
+ Requires-Dist: natsort~=8.4.0
19
+ Provides-Extra: test
20
+ Requires-Dist: idmtools[test]; extra == "test"
21
+ Requires-Dist: idmtools_test; extra == "test"
22
+ Requires-Dist: idmtools_models; extra == "test"
23
+ Provides-Extra: packaging
24
+ Requires-Dist: flake8; extra == "packaging"
25
+ Requires-Dist: coverage; extra == "packaging"
26
+ Requires-Dist: bump2version; extra == "packaging"
27
+ Requires-Dist: twine; extra == "packaging"
28
+ Requires-Dist: natsort; extra == "packaging"
29
+ Dynamic: license-file
30
+
31
+ ![Staging: idmtools-platform-comps](https://github.com/InstituteforDiseaseModeling/idmtools/workflows/Staging:%20idmtools-platform-comps/badge.svg?branch=dev)
32
+
33
+ # idmtools-platform-comps
34
+
35
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
36
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
37
+ **Table of Contents**
38
+
39
+ - [Installing](#installing)
40
+ - [Development Tips](#development-tips)
41
+ - [Building SSMT Docker Image](#building-ssmt-docker-image)
42
+ - [Choose SSMT Docker Image to use in test/script](#choose-ssmt-docker-image-to-use-in-testscript)
43
+
44
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
45
+
46
+ ## Installing
47
+
48
+ ```bash
49
+ pip install idmtools-platform-comps --index-url=https://packages.idmod.org/api/pypi/pypi-production/simple
50
+ ```
51
+
52
+ # Development Tips
53
+
54
+ There is a Makefile file available for most common development tasks. Here is a list of commands
55
+ ```bash
56
+ clean - Clean up temproary files
57
+ lint - Lint package and tests
58
+ test - Run All tests
59
+ coverage - Run tests and generate coverage report that is shown in browser
60
+ ```
61
+ On Windows, you can use `pymake` instead of `make`
62
+
63
+ # Building SSMT Docker Image
64
+
65
+ To build the SSMT Docker image, follow these steps
66
+
67
+ 1. ```bash
68
+ docker login docker-production.packages.idmod.org
69
+ ```
70
+ 2. ```bash
71
+ make ssmt-image
72
+ ```
73
+ 3. When prompted, enter your idm username and password
74
+
75
+ # Choose SSMT Docker Image to use in test/script
76
+
77
+ There are three ways to choose which ssmt docker image to use in your script:
78
+
79
+ 1. specify docker_image in SSMTWorkItem creation, for example,
80
+ ```bash
81
+ wi = SSMTWorkItem(name=wi_name, command=command, docker_image='my_test_ssmt_docker_image')
82
+ ```
83
+ 2. define docker_image in your idmtools.ini, for example:
84
+ ```bash
85
+ [COMPS2]
86
+ type = COMPS
87
+ endpoint = https://comps.idmod.org
88
+ environment = Calculon
89
+ ......
90
+ docker_image = my_test_ssmt_docker_image
91
+ ```
92
+
93
+ 3. if not above two cases, idomtools system will determine the default ssmt docker image from platform for you:
94
+
95
+ if endpoint = https://comps.idmod.org, it will use production docker image
96
+
97
+ for all other cases, it will use the staging docker image
98
+
99
+ Note: if user overrode docker image in wi (case #1) and also defined docker image in idmtools.ini (case #2),
100
+ it will take #1 as higher priority
@@ -0,0 +1,70 @@
1
+ ![Staging: idmtools-platform-comps](https://github.com/InstituteforDiseaseModeling/idmtools/workflows/Staging:%20idmtools-platform-comps/badge.svg?branch=dev)
2
+
3
+ # idmtools-platform-comps
4
+
5
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
6
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
7
+ **Table of Contents**
8
+
9
+ - [Installing](#installing)
10
+ - [Development Tips](#development-tips)
11
+ - [Building SSMT Docker Image](#building-ssmt-docker-image)
12
+ - [Choose SSMT Docker Image to use in test/script](#choose-ssmt-docker-image-to-use-in-testscript)
13
+
14
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
15
+
16
+ ## Installing
17
+
18
+ ```bash
19
+ pip install idmtools-platform-comps --index-url=https://packages.idmod.org/api/pypi/pypi-production/simple
20
+ ```
21
+
22
+ # Development Tips
23
+
24
+ There is a Makefile file available for most common development tasks. Here is a list of commands
25
+ ```bash
26
+ clean - Clean up temproary files
27
+ lint - Lint package and tests
28
+ test - Run All tests
29
+ coverage - Run tests and generate coverage report that is shown in browser
30
+ ```
31
+ On Windows, you can use `pymake` instead of `make`
32
+
33
+ # Building SSMT Docker Image
34
+
35
+ To build the SSMT Docker image, follow these steps
36
+
37
+ 1. ```bash
38
+ docker login docker-production.packages.idmod.org
39
+ ```
40
+ 2. ```bash
41
+ make ssmt-image
42
+ ```
43
+ 3. When prompted, enter your idm username and password
44
+
45
+ # Choose SSMT Docker Image to use in test/script
46
+
47
+ There are three ways to choose which ssmt docker image to use in your script:
48
+
49
+ 1. specify docker_image in SSMTWorkItem creation, for example,
50
+ ```bash
51
+ wi = SSMTWorkItem(name=wi_name, command=command, docker_image='my_test_ssmt_docker_image')
52
+ ```
53
+ 2. define docker_image in your idmtools.ini, for example:
54
+ ```bash
55
+ [COMPS2]
56
+ type = COMPS
57
+ endpoint = https://comps.idmod.org
58
+ environment = Calculon
59
+ ......
60
+ docker_image = my_test_ssmt_docker_image
61
+ ```
62
+
63
+ 3. if not above two cases, idomtools system will determine the default ssmt docker image from platform for you:
64
+
65
+ if endpoint = https://comps.idmod.org, it will use production docker image
66
+
67
+ for all other cases, it will use the staging docker image
68
+
69
+ Note: if user overrode docker image in wi (case #1) and also defined docker image in idmtools.ini (case #2),
70
+ it will take #1 as higher priority
@@ -0,0 +1 @@
1
+ 3.0.0
@@ -0,0 +1,25 @@
1
+ """idmtools comps platform.
2
+
3
+ We try to load the CLI here but if idmtools-cli is not installed, we fail gracefully.
4
+
5
+ Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
6
+ """
7
+ # flake8: noqa F821
8
+ from idmtools_platform_comps.plugin_info import COMPSPlatformSpecification
9
+ try: # since cli is not required but we always try to load file, wrap in try except
10
+ from idmtools_platform_comps.comps_cli import CompsCLI
11
+ except ImportError:
12
+ pass
13
+
14
+ try:
15
+ from importlib.metadata import version, PackageNotFoundError
16
+ except ImportError:
17
+ # Python < 3.8
18
+ from importlib_metadata import version, PackageNotFoundError
19
+
20
+ try:
21
+ __version__ = version("idmtools-platform-comps") # Use your actual package name
22
+ except PackageNotFoundError:
23
+ # Package not installed, use fallback
24
+ __version__ = "0.0.0+unknown"
25
+
@@ -0,0 +1,4 @@
1
+ """idmtools comps cli module.
2
+
3
+ Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
4
+ """
@@ -0,0 +1,50 @@
1
+ """idmtools cli utils.
2
+
3
+ Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
4
+ """
5
+ from dataclasses import Field
6
+ from typing import Dict, Tuple
7
+
8
+
9
+ def validate_range(value: float, min: float, max: float) -> Tuple[bool, str]:
10
+ """
11
+ Function used to validate an integer value between min and max.
12
+
13
+ Args:
14
+ value: The value set by the user
15
+ min: Minimum value
16
+ max: Maximum value
17
+
18
+ Returns: tuple with validation result and error message if needed
19
+ """
20
+ if min <= value <= max:
21
+ return True, ''
22
+ return False, f"The value needs to be between {min} and {max}"
23
+
24
+
25
+ def environment_list(previous_settings: Dict, current_field: Field) -> Dict:
26
+ """
27
+ Allows the CLI to provide a list of available environments.
28
+
29
+ Uses the previous_settings to get the endpoint to query for environments
30
+
31
+ Args:
32
+ previous_settings: previous settings set by the user in the CLI.
33
+ current_field: Current field specs
34
+
35
+ Returns: updates to the choices and default
36
+ """
37
+ from COMPS import Client
38
+ Client.login(previous_settings["endpoint"])
39
+ client = Client.get("environments")
40
+ environment_choices = []
41
+ for environment_info in client.json()["Environments"]:
42
+ environment_choices.append(environment_info["EnvironmentName"])
43
+
44
+ # Set a valid default
45
+ if current_field.default not in environment_choices:
46
+ default_env = environment_choices[0]
47
+ else:
48
+ default_env = current_field.default
49
+
50
+ return {"choices": environment_choices, "default": default_env}