ciocore 6.3.2rc1__py2.py3-none-any.whl → 6.4.0__py2.py3-none-any.whl
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.
Potentially problematic release.
This version of ciocore might be problematic. Click here for more details.
- ciocore/VERSION +1 -1
- ciocore/__about__.py +3 -20
- ciocore/api_client.py +116 -236
- ciocore/cli/__init__.py +3 -0
- ciocore/cli/conductor.py +206 -0
- ciocore/config.py +44 -50
- ciocore/data.py +131 -85
- ciocore/downloader.py +64 -46
- ciocore/hardware_set.py +99 -326
- ciocore/package_environment.py +74 -48
- ciocore/package_tree.py +377 -300
- ciocore/uploader/_uploader.py +2 -6
- ciocore-6.4.0.data/scripts/conductor +19 -0
- ciocore-6.4.0.data/scripts/conductor.bat +13 -0
- {ciocore-6.3.2rc1.dist-info → ciocore-6.4.0.dist-info}/METADATA +12 -35
- ciocore-6.4.0.dist-info/RECORD +51 -0
- {ciocore-6.3.2rc1.dist-info → ciocore-6.4.0.dist-info}/WHEEL +1 -1
- tests/instance_type_fixtures.py +9 -43
- tests/mocks/api_client_mock.py +31 -0
- tests/test_hardware_set.py +4 -50
- ciocore/cli.py +0 -336
- ciocore/dev_inst_tagger.py +0 -120
- ciocore/docsite/404.html +0 -723
- ciocore/docsite/apidoc/api_client/index.html +0 -2590
- ciocore/docsite/apidoc/apidoc/index.html +0 -868
- ciocore/docsite/apidoc/config/index.html +0 -1562
- ciocore/docsite/apidoc/data/index.html +0 -1550
- ciocore/docsite/apidoc/hardware_set/index.html +0 -2324
- ciocore/docsite/apidoc/package_environment/index.html +0 -1430
- ciocore/docsite/apidoc/package_tree/index.html +0 -2310
- ciocore/docsite/assets/_mkdocstrings.css +0 -16
- ciocore/docsite/assets/images/favicon.png +0 -0
- ciocore/docsite/assets/javascripts/bundle.4e31edb1.min.js +0 -29
- ciocore/docsite/assets/javascripts/bundle.4e31edb1.min.js.map +0 -8
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ar.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.da.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.de.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.du.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.es.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.fi.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.fr.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.hi.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.hu.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.hy.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.it.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ja.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.jp.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.kn.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ko.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.multi.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.nl.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.no.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.pt.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ro.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ru.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.sa.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.sv.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ta.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.te.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.th.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.tr.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.vi.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.zh.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/tinyseg.js +0 -206
- ciocore/docsite/assets/javascripts/lunr/wordcut.js +0 -6708
- ciocore/docsite/assets/javascripts/workers/search.dfff1995.min.js +0 -42
- ciocore/docsite/assets/javascripts/workers/search.dfff1995.min.js.map +0 -8
- ciocore/docsite/assets/stylesheets/main.83068744.min.css +0 -1
- ciocore/docsite/assets/stylesheets/main.83068744.min.css.map +0 -1
- ciocore/docsite/assets/stylesheets/palette.ecc896b0.min.css +0 -1
- ciocore/docsite/assets/stylesheets/palette.ecc896b0.min.css.map +0 -1
- ciocore/docsite/cmdline/docs/index.html +0 -834
- ciocore/docsite/cmdline/downloader/index.html +0 -897
- ciocore/docsite/cmdline/packages/index.html +0 -841
- ciocore/docsite/cmdline/uploader/index.html +0 -950
- ciocore/docsite/how-to-guides/index.html +0 -831
- ciocore/docsite/index.html +0 -853
- ciocore/docsite/logo.png +0 -0
- ciocore/docsite/objects.inv +0 -0
- ciocore/docsite/search/search_index.json +0 -1
- ciocore/docsite/sitemap.xml +0 -3
- ciocore/docsite/sitemap.xml.gz +0 -0
- ciocore/docsite/stylesheets/extra.css +0 -26
- ciocore/docsite/stylesheets/tables.css +0 -170
- ciocore/package_query.py +0 -171
- ciocore-6.3.2rc1.dist-info/RECORD +0 -115
- ciocore-6.3.2rc1.dist-info/entry_points.txt +0 -2
- tests/test_cli.py +0 -161
- tests/test_downloader.py +0 -56
- {ciocore-6.3.2rc1.dist-info → ciocore-6.4.0.dist-info}/top_level.txt +0 -0
ciocore/uploader/_uploader.py
CHANGED
|
@@ -728,12 +728,6 @@ class Uploader(object):
|
|
|
728
728
|
|
|
729
729
|
return True
|
|
730
730
|
|
|
731
|
-
def assets_only(self, *paths):
|
|
732
|
-
processed_filepaths = file_utils.process_upload_filepaths(paths)
|
|
733
|
-
file_map = {path: None for path in processed_filepaths}
|
|
734
|
-
self.handle_upload_response(project=None, upload_files=file_map)
|
|
735
|
-
|
|
736
|
-
|
|
737
731
|
def handle_upload_response(self, project, upload_files, upload_id=None):
|
|
738
732
|
"""
|
|
739
733
|
This is a really confusing method and should probably be split into to clear logic
|
|
@@ -916,6 +910,7 @@ def set_logging(level=None, log_dirpath=None):
|
|
|
916
910
|
log_filepath=log_filepath,
|
|
917
911
|
)
|
|
918
912
|
|
|
913
|
+
|
|
919
914
|
def run_uploader(args):
|
|
920
915
|
"""
|
|
921
916
|
Start the uploader process. This process will run indefinitely, polling
|
|
@@ -945,6 +940,7 @@ def run_uploader(args):
|
|
|
945
940
|
else:
|
|
946
941
|
uploader.main()
|
|
947
942
|
|
|
943
|
+
|
|
948
944
|
def get_file_info(filepath):
|
|
949
945
|
"""
|
|
950
946
|
For the given filepath return the following information in a dictionary:
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# WHY CHANGE
|
|
4
|
+
|
|
5
|
+
# DO NOT SORT IMPORTS
|
|
6
|
+
import os
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
CIO_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|
11
|
+
sys.path.insert(0, CIO_DIR)
|
|
12
|
+
|
|
13
|
+
print("Inserted {} into sys.path".format(CIO_DIR))
|
|
14
|
+
|
|
15
|
+
from ciocore.cli.conductor import main
|
|
16
|
+
|
|
17
|
+
if __name__ == '__main__':
|
|
18
|
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
|
19
|
+
sys.exit(main())
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
|
|
3
|
+
echo Looking for Python...
|
|
4
|
+
|
|
5
|
+
WHERE python.exe
|
|
6
|
+
if ERRORLEVEL 1 (
|
|
7
|
+
echo WARNING: python.exe not found.
|
|
8
|
+
echo Please find or install Python and add it to your Path variable. Then run this command again.
|
|
9
|
+
echo If you don't want to add python to your Path, then you can use the full path to a Python installation.
|
|
10
|
+
echo Example: "C:\some\tools\python\python.exe" "%~dp0conductor %*
|
|
11
|
+
exit /b
|
|
12
|
+
)
|
|
13
|
+
python.exe "%~dp0\conductor" %*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ciocore
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.4.0
|
|
4
4
|
Summary: Core functionality for Conductor's client tools
|
|
5
5
|
Home-page: https://github.com/ConductorTechnologies/ciocore
|
|
6
6
|
Author: conductor
|
|
@@ -9,23 +9,21 @@ Classifier: Operating System :: OS Independent
|
|
|
9
9
|
Classifier: Programming Language :: Python
|
|
10
10
|
Classifier: Topic :: Multimedia :: Graphics :: 3D Rendering
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: certifi
|
|
13
|
-
Requires-Dist: pyjwt
|
|
14
|
-
Requires-Dist: requests
|
|
15
|
-
Requires-Dist: future
|
|
16
|
-
Requires-Dist: urllib3
|
|
17
|
-
Requires-Dist: cioseq (<1.0.0,>=0.1.14)
|
|
18
|
-
Requires-Dist: Click
|
|
19
|
-
Requires-Dist: markdown
|
|
12
|
+
Requires-Dist: certifi ==2019.11.28
|
|
13
|
+
Requires-Dist: pyjwt ==1.7.1
|
|
14
|
+
Requires-Dist: requests <=2.25.1,>=2.10.0
|
|
15
|
+
Requires-Dist: future >=0.18.2
|
|
16
|
+
Requires-Dist: urllib3 ==1.25.11
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
# Conductor Core
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
Use the command-line uploader and downloader or develop your own tools using the Python API.
|
|
24
21
|
|
|
25
22
|
## Install
|
|
26
23
|
|
|
24
|
+
**To install the latest version.**
|
|
27
25
|
```bash
|
|
28
|
-
pip install ciocore
|
|
26
|
+
pip install --upgrade ciocore
|
|
29
27
|
```
|
|
30
28
|
|
|
31
29
|
Run the conductor command to confirm the package was installed.
|
|
@@ -33,13 +31,6 @@ Run the conductor command to confirm the package was installed.
|
|
|
33
31
|
conductor --help
|
|
34
32
|
```
|
|
35
33
|
|
|
36
|
-
Get help for a specific sub command
|
|
37
|
-
```bash
|
|
38
|
-
conductor downloader --help
|
|
39
|
-
conductor uploader --help
|
|
40
|
-
conductor software --help
|
|
41
|
-
```
|
|
42
|
-
|
|
43
34
|
Example API usage
|
|
44
35
|
```python
|
|
45
36
|
from ciocore import api_client
|
|
@@ -52,23 +43,9 @@ See [CONTRIBUTING](CONTRIBUTING.md)
|
|
|
52
43
|
|
|
53
44
|
## Changelog
|
|
54
45
|
|
|
55
|
-
## Version:6.
|
|
56
|
-
|
|
57
|
-
* Adds instance-type-tagger for demonstration purposes.
|
|
58
|
-
* Adds ability to query the provider, so that spot/preemptible can be hidden on CW.
|
|
59
|
-
* Implements dedicated docs for the Conductor Core (`ciocore`) package.
|
|
60
|
-
|
|
61
|
-
## Version:6.3.1-rc.3 -- 24 Jul 2023
|
|
62
|
-
|
|
63
|
-
* This release has an improved commandline experience. The new subcommands, `upload` and `download` have a more idiomatic feel, and better control over what gets uploaded or downloaded. The old commands `uploader` and `downloader` are still available, but are deprecated.
|
|
64
|
-
* There's also now a `packages` subcommand that allows you to query the package database.
|
|
65
|
-
* The command installs with console_scripts which improves stability and avoids situations wehere the Conductor command cannot be3 found. (#72)
|
|
66
|
-
* Adds a `--version` flag
|
|
67
|
-
|
|
68
|
-
## Version:6.3.1-rc.2 -- 23 Jul 2023
|
|
46
|
+
## Version:6.4.0 -- 12 Sep 2023
|
|
69
47
|
|
|
70
|
-
*
|
|
71
|
-
* Improves uploader error handling and queueing fixes.
|
|
48
|
+
* Uploader now supports callbacks and is interruptable
|
|
72
49
|
|
|
73
50
|
## Version:6.3.0 -- 05 Jul 2023
|
|
74
51
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
ciocore/VERSION,sha256=Yl4u2S_TJL-hz2vF8sZWuwgSXkwNAQL0sIXjVAPmLZU,5
|
|
2
|
+
ciocore/__about__.py,sha256=nTb4Xx0r9QtGROSFKgwDZ-Mr2LKjm2wVt1OkMQAkRAQ,241
|
|
3
|
+
ciocore/__init__.py,sha256=zB_e7gBW2QloqbrGzcvccfpZhOhd6o9KACnScrwylm8,25
|
|
4
|
+
ciocore/api_client.py,sha256=O9uvtnqgmE2IRkqlP9DoPn6CX_HAIuSLo9je5Om-800,17913
|
|
5
|
+
ciocore/client_db.py,sha256=tTz3bl2xeDPPcYSDS3g3QgV_xYihJMx0Kj6OeN2klK0,12978
|
|
6
|
+
ciocore/common.py,sha256=FnggAL-IGW8VQB6kLsrKLnxWFgLpwGBhOtiZSHz130M,14725
|
|
7
|
+
ciocore/compat.py,sha256=5uEXPSog_jxsDMaHBswAKEtfyXT25VgU6WNGIhz9PHU,256
|
|
8
|
+
ciocore/conductor_submit.py,sha256=ONE0LsA5hGavTJIOXXYx8qzl8_vBPADwhd6Ytq_0E0c,9382
|
|
9
|
+
ciocore/config.py,sha256=fcxnwaYmNAmvMXQeb5V-86Pwwy3a3NTPCA0CSLqog3s,5913
|
|
10
|
+
ciocore/data.py,sha256=G6tAfSkMwy3DS_fesqkDaoMgrfd_JrvV8Fs_JFpcCCc,8950
|
|
11
|
+
ciocore/downloader.py,sha256=oRmRePdIx_GdQwM39ipl9_e2c2ZkcGJRanuHOZmqpTM,51147
|
|
12
|
+
ciocore/exceptions.py,sha256=4Oq-WX-qiN6kPUdBCHvvd6mtSQ0nCkDbJxWt2CNtpv8,1504
|
|
13
|
+
ciocore/file_utils.py,sha256=bAlL31B4YkRgX-yT8kF8UXBFktQlsE1PvxbKqTeAeOU,17174
|
|
14
|
+
ciocore/hardware_set.py,sha256=txcSLrVSNewRGxKLye-wuM8szGMVloU29ktL8WHdUtM,5401
|
|
15
|
+
ciocore/loggeria.py,sha256=dKKJC8ZtRZdghqD5R5XrA6eDoy8gKacfeTA-zNzXvDE,13482
|
|
16
|
+
ciocore/package_environment.py,sha256=oEbNKXRtPSPzKR-yCoKtvgzu4OCmr-zaqAcNoLAN9Uk,7238
|
|
17
|
+
ciocore/package_tree.py,sha256=kH03HVfjomj7nsaxJJtr-1KSQ_9ZSQY5msG_l9btvg8,16277
|
|
18
|
+
ciocore/post_install.py,sha256=zu5Ctz2ANbKD-f5G2ODLIhKkWENBi4F3UKKu50OEWrg,1000
|
|
19
|
+
ciocore/validator.py,sha256=f_K7gxz122W_i5AxVx6dKhckOygl8TnmQiVj7tyX5zw,2344
|
|
20
|
+
ciocore/worker.py,sha256=_WQq2_ZhXuc5NTfYQtcWUGULU6IUZykeVW5e_4_ffZc,21728
|
|
21
|
+
ciocore/auth/__init__.py,sha256=cdS-xZzMq41yXM5cz8sUlcYgo8CJYh8HcCCWmhbDgf0,606
|
|
22
|
+
ciocore/auth/server.py,sha256=8btX9-EokUl6q55V8muDmEV2tvvbTBD0BHeWFbwkzUc,3892
|
|
23
|
+
ciocore/cli/__init__.py,sha256=RmZKWJaMpzNyMdyYc2W3VXglaJiC8vyR2cgUlA-9Qmw,26
|
|
24
|
+
ciocore/cli/conductor.py,sha256=snmlICkMgP94ZPKl6J7g299deB75QwGDWI0oCnZPfSI,10861
|
|
25
|
+
ciocore/uploader/__init__.py,sha256=hxRFJf5Lo86rtRObFXSjjot8nybQd-SebSfYCbgZwow,24
|
|
26
|
+
ciocore/uploader/_uploader.py,sha256=31lpXVp2VG6rzVF7nw24Uafs6Z-p9CUF_bghku386R4,37430
|
|
27
|
+
ciocore/uploader/upload_stats/__init__.py,sha256=kc1YCXZOy4EBpSSRIJKe89DWgiBwTzOPMbZ7530EXWw,5354
|
|
28
|
+
ciocore/uploader/upload_stats/stats_formats.py,sha256=dtjsxdbT4w6BXFay19dzijf-xLwf6TktNk75Wq3rPAw,2452
|
|
29
|
+
ciocore-6.4.0.data/scripts/conductor,sha256=Nk3QsLQqbUUrtaKDp4b5mr9__4tz-xnssENpQe5vuIo,409
|
|
30
|
+
ciocore-6.4.0.data/scripts/conductor.bat,sha256=T1_9ByheubBczgQZn8_LwfvMtWgE7Bt64EsEScnSXMs,447
|
|
31
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
+
tests/instance_type_fixtures.py,sha256=gR6ordfghp34I94oM2eDg6jfIe5HAwE644GKIwspuW8,3469
|
|
33
|
+
tests/package_fixtures.py,sha256=CsJnhB7oYzIxJH7b1tCOPyvnnVSCqEbSPhtCnsHL-nA,5070
|
|
34
|
+
tests/test_api_client.py,sha256=dWOmAIKmX0gLaDGsT9VfAq9Hcs9HIQf2P5IMM_Bt5dE,1284
|
|
35
|
+
tests/test_common.py,sha256=lJpzRdL-7u4McXFbLuwPQQoUnuEOnCVQtZEt6e_dIYs,638
|
|
36
|
+
tests/test_config.py,sha256=nSmpinX2SmDNAprIcxs9UHdB0VakJB0snXaZmAoKJSc,12863
|
|
37
|
+
tests/test_data.py,sha256=YdP1kZJivQ6yb9z96UK6oMDaOfJAl4YMJqzKvlCQaes,5744
|
|
38
|
+
tests/test_hardware_set.py,sha256=TcBh63rOxf1rKXxKlCPSnHueBFlz7rNP6BcoJjgVvPs,3065
|
|
39
|
+
tests/test_imports_2and3.py,sha256=ehqpRYPVY7djBcb8OT_cnh86iCJJ9wuMWnfSR9RHxmY,507
|
|
40
|
+
tests/test_package_environment.py,sha256=CdiC2PDVSnbcwTb4fsDTWqGYSzs1n5ca2KMoyISckGA,5893
|
|
41
|
+
tests/test_package_tree.py,sha256=xCwNwYUmJrfmgCP2FGoHRFG-L0JPy8s4-66icxAls4o,6780
|
|
42
|
+
tests/test_submit.py,sha256=4idfa48IouM4JgfQzBLiZyygtU-jwLdOBtV0AgfBzH0,4834
|
|
43
|
+
tests/test_uploader.py,sha256=B1llTJt_fqR6e_V_Jxfw9z73QgkFlEPU87xLYGzt-TQ,2914
|
|
44
|
+
tests/test_validator.py,sha256=2fY66ayNc08PGyj2vTI-V_1yeCWJDngkj2zkUM5TTCI,1526
|
|
45
|
+
tests/mocks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
|
+
tests/mocks/api_client_mock.py,sha256=Wfv2JPFSZfyHftVqsqxcpXWJn136pEHx26I_esz567E,943
|
|
47
|
+
tests/mocks/glob.py,sha256=J2MH7nqi6NJOHuGdVWxhfeBd700_Ckj6cLh_8jSNkfg,215
|
|
48
|
+
ciocore-6.4.0.dist-info/METADATA,sha256=ObyBNodNf9WIBCAKwIsWMLC5NAOfsCZhpLFdniY7-_0,14364
|
|
49
|
+
ciocore-6.4.0.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
|
|
50
|
+
ciocore-6.4.0.dist-info/top_level.txt,sha256=SvlM5JlqULzAz00JZWfiUhfjhqDzYzSWssA87zdJl0o,14
|
|
51
|
+
ciocore-6.4.0.dist-info/RECORD,,
|
tests/instance_type_fixtures.py
CHANGED
|
@@ -55,46 +55,12 @@ WIN_INSTANCE_TYPES = [
|
|
|
55
55
|
|
|
56
56
|
ALL_INSTANCE_TYPES = WIN_INSTANCE_TYPES + LIN_INSTANCE_TYPES
|
|
57
57
|
|
|
58
|
-
AWS_INSTANCE_TYPES = [
|
|
59
|
-
{
|
|
60
|
-
"cloud": "aws",
|
|
61
|
-
"cpu": 72,
|
|
62
|
-
"memory": 144,
|
|
63
|
-
"name": "c5.18xlarge",
|
|
64
|
-
"orchestrator": "batch",
|
|
65
|
-
"operating_system": "linux",
|
|
66
|
-
"cores": 72,
|
|
67
|
-
"description": "c5 18xlarge",
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"cloud": "aws",
|
|
71
|
-
"cpu": 2,
|
|
72
|
-
"memory": 8,
|
|
73
|
-
"name": "m5.large",
|
|
74
|
-
"orchestrator": "batch",
|
|
75
|
-
"operating_system": "linux",
|
|
76
|
-
"cores": 2,
|
|
77
|
-
"description": "m large",
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"cloud": "aws",
|
|
81
|
-
"cpu": 4,
|
|
82
|
-
"memory": 16,
|
|
83
|
-
"name": "m5.xlarge",
|
|
84
|
-
"orchestrator": "batch",
|
|
85
|
-
"operating_system": "linux",
|
|
86
|
-
"cores": 4,
|
|
87
|
-
"description": "m5 xlarge",
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
|
|
91
|
-
|
|
92
58
|
|
|
93
59
|
CW_INSTANCE_TYPES = [
|
|
94
60
|
{
|
|
95
61
|
"cores": 4,
|
|
96
62
|
"memory": 16,
|
|
97
|
-
"name": "
|
|
63
|
+
"name": "a-4-16",
|
|
98
64
|
"categories": [{"label": "low", "order": 1}, {"label": "extra", "order": 9}],
|
|
99
65
|
"operating_system": "linux",
|
|
100
66
|
"description": "Desc 4 C 16 M A",
|
|
@@ -102,7 +68,7 @@ CW_INSTANCE_TYPES = [
|
|
|
102
68
|
{
|
|
103
69
|
"cores": 8,
|
|
104
70
|
"memory": 16,
|
|
105
|
-
"name": "
|
|
71
|
+
"name": "b-8-16",
|
|
106
72
|
"categories": [{"label": "low", "order": 1}],
|
|
107
73
|
"operating_system": "linux",
|
|
108
74
|
"description": "Desc 8 C 16 M B",
|
|
@@ -110,7 +76,7 @@ CW_INSTANCE_TYPES = [
|
|
|
110
76
|
{
|
|
111
77
|
"cores": 4,
|
|
112
78
|
"memory": 32,
|
|
113
|
-
"name": "
|
|
79
|
+
"name": "c-4-32",
|
|
114
80
|
"categories": [{"label": "mid", "order": 2}, {"label": "extra", "order": 9}],
|
|
115
81
|
"operating_system": "linux",
|
|
116
82
|
"description": "Desc 4 C 32 M C",
|
|
@@ -118,7 +84,7 @@ CW_INSTANCE_TYPES = [
|
|
|
118
84
|
{
|
|
119
85
|
"cores": 8,
|
|
120
86
|
"memory": 32,
|
|
121
|
-
"name": "
|
|
87
|
+
"name": "d-8-32",
|
|
122
88
|
"categories": [{"label": "mid", "order": 2}],
|
|
123
89
|
"operating_system": "linux",
|
|
124
90
|
"description": "Desc 8 C 32 M D",
|
|
@@ -126,7 +92,7 @@ CW_INSTANCE_TYPES = [
|
|
|
126
92
|
{
|
|
127
93
|
"cores": 4,
|
|
128
94
|
"memory": 64,
|
|
129
|
-
"name": "
|
|
95
|
+
"name": "e-4-32",
|
|
130
96
|
"categories": [{"label": "high", "order": 3}, {"label": "extra", "order": 9}],
|
|
131
97
|
"operating_system": "linux",
|
|
132
98
|
"description": "Desc 4 C 32 M E",
|
|
@@ -134,7 +100,7 @@ CW_INSTANCE_TYPES = [
|
|
|
134
100
|
{
|
|
135
101
|
"cores": 8,
|
|
136
102
|
"memory": 64,
|
|
137
|
-
"name": "
|
|
103
|
+
"name": "f-8-32",
|
|
138
104
|
"categories": [{"label": "high", "order": 3}],
|
|
139
105
|
"operating_system": "linux",
|
|
140
106
|
"description": "Desc 8 C 32 M F",
|
|
@@ -142,7 +108,7 @@ CW_INSTANCE_TYPES = [
|
|
|
142
108
|
{
|
|
143
109
|
"cores": 8,
|
|
144
110
|
"memory": 64,
|
|
145
|
-
"name": "
|
|
111
|
+
"name": "g-8-32",
|
|
146
112
|
"categories": None,
|
|
147
113
|
"operating_system": "linux",
|
|
148
114
|
"description": "Desc 8 C 32 M G",
|
|
@@ -153,7 +119,7 @@ CW_INSTANCE_TYPES_WITH_GPUS = [
|
|
|
153
119
|
{
|
|
154
120
|
"cores": 8,
|
|
155
121
|
"memory": 64,
|
|
156
|
-
"name": "
|
|
122
|
+
"name": "f-8-32-gpu",
|
|
157
123
|
"categories": [{"label": "high", "order": 3}],
|
|
158
124
|
"operating_system": "linux",
|
|
159
125
|
"description": "Desc 8 C 32 M F gpu",
|
|
@@ -162,7 +128,7 @@ CW_INSTANCE_TYPES_WITH_GPUS = [
|
|
|
162
128
|
{
|
|
163
129
|
"cores": 8,
|
|
164
130
|
"memory": 64,
|
|
165
|
-
"name": "
|
|
131
|
+
"name": "g-8-32-gpu",
|
|
166
132
|
"categories": [{"label": "high", "order": 3}],
|
|
167
133
|
"operating_system": "linux",
|
|
168
134
|
"description": "Desc 8 C 32 M G gpu",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Mock ApiClient for requests to get packages and projects.
|
|
2
|
+
"""
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
import package_fixtures
|
|
7
|
+
|
|
8
|
+
PROJECTS_RESPONSE = {"data": [
|
|
9
|
+
{"id": "123|deadpool", "name": "Deadpool",
|
|
10
|
+
"status": "active"},
|
|
11
|
+
{"id": "456|harrypotter", "name": "Harry Potter & the chamber of secrets",
|
|
12
|
+
"status": "active"},
|
|
13
|
+
{"id": "789|corelli", "name": "Captain Corelli's Mandolin",
|
|
14
|
+
"status": "active"},
|
|
15
|
+
{"id": "000|gwtw", "name": "Gone with the Wind",
|
|
16
|
+
"status": "inactive"}
|
|
17
|
+
]}
|
|
18
|
+
|
|
19
|
+
PACKAGES_RESPONSE = {"data": package_fixtures.SOFTWARE_DATA}
|
|
20
|
+
|
|
21
|
+
class ApiClient(object):
|
|
22
|
+
def make_request(self, **kw):
|
|
23
|
+
path = kw.get("uri_path", "")
|
|
24
|
+
|
|
25
|
+
print("Using mock %s call to %s" % (self.__class__.__name__, path))
|
|
26
|
+
|
|
27
|
+
if path.startswith("api/v1/projects"):
|
|
28
|
+
return [json.dumps(PROJECTS_RESPONSE), 200]
|
|
29
|
+
|
|
30
|
+
if path.startswith("api/v1/ee/packages"):
|
|
31
|
+
return [json.dumps(PACKAGES_RESPONSE), 200]
|
tests/test_hardware_set.py
CHANGED
|
@@ -15,7 +15,7 @@ PROJECTS = [
|
|
|
15
15
|
]
|
|
16
16
|
|
|
17
17
|
from package_fixtures import *
|
|
18
|
-
from instance_type_fixtures import CW_INSTANCE_TYPES,
|
|
18
|
+
from instance_type_fixtures import CW_INSTANCE_TYPES, CW_INSTANCE_TYPES_WITH_GPUS, ALL_INSTANCE_TYPES
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class TestCategorizedInstanceTypes(unittest.TestCase):
|
|
@@ -31,20 +31,13 @@ class TestCategorizedInstanceTypes(unittest.TestCase):
|
|
|
31
31
|
|
|
32
32
|
def test_content_count(self):
|
|
33
33
|
low_category_values = [c["value"] for c in self.hs.get_model()[0]["content"]]
|
|
34
|
-
self.assertEqual(low_category_values, ["
|
|
34
|
+
self.assertEqual(low_category_values, ["a-4-16", "b-8-16"])
|
|
35
35
|
|
|
36
36
|
def test_in_several_categories(self):
|
|
37
37
|
low_category_values = [c["value"] for c in self.hs.get_model()[0]["content"]]
|
|
38
38
|
extra_category_values = [c["value"] for c in self.hs.get_model()[3]["content"]]
|
|
39
|
-
self.assertIn("
|
|
40
|
-
self.assertIn("
|
|
41
|
-
|
|
42
|
-
def test_category_names(self):
|
|
43
|
-
|
|
44
|
-
names = self.hs.labels()
|
|
45
|
-
self.assertEqual(names, ["low", "mid", "high", "extra"])
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
self.assertIn("a-4-16", low_category_values)
|
|
40
|
+
self.assertIn("a-4-16", extra_category_values)
|
|
48
41
|
|
|
49
42
|
class TestRecategorizeInstanceTypes(unittest.TestCase):
|
|
50
43
|
def setUp(self):
|
|
@@ -71,29 +64,6 @@ class TestRecategorizeInstanceTypes(unittest.TestCase):
|
|
|
71
64
|
self.assertEqual(result["label"] , label)
|
|
72
65
|
self.assertEqual(result["order"] , 2)
|
|
73
66
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class TestFind(unittest.TestCase):
|
|
78
|
-
def setUp(self):
|
|
79
|
-
self.hs = HardwareSet(CW_INSTANCE_TYPES_WITH_GPUS)
|
|
80
|
-
|
|
81
|
-
def test_find_unspecified_category(self):
|
|
82
|
-
result = self.hs.find("cw-e-4-32")
|
|
83
|
-
self.assertIsNotNone(result)
|
|
84
|
-
|
|
85
|
-
def test_category_that_exists(self):
|
|
86
|
-
result = self.hs.find("cw-e-4-32", category="high")
|
|
87
|
-
self.assertIsNotNone(result)
|
|
88
|
-
|
|
89
|
-
def test_returns_none_if_not_in_category(self):
|
|
90
|
-
result = self.hs.find("cw-e-4-32", category="low")
|
|
91
|
-
self.assertIsNone(result)
|
|
92
|
-
|
|
93
|
-
def test_returns_none_if_non_existent_category(self):
|
|
94
|
-
result = self.hs.find("cw-e-4-32", category="foo")
|
|
95
|
-
self.assertIsNone(result)
|
|
96
|
-
|
|
97
67
|
class TestUncategorizedInstanceTypes(unittest.TestCase):
|
|
98
68
|
def setUp(self):
|
|
99
69
|
self.hs = HardwareSet(ALL_INSTANCE_TYPES)
|
|
@@ -116,19 +86,3 @@ class TestUncategorizedInstanceTypes(unittest.TestCase):
|
|
|
116
86
|
"64 core, 416GB Mem",
|
|
117
87
|
],
|
|
118
88
|
)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
class TestProvider(unittest.TestCase):
|
|
122
|
-
|
|
123
|
-
def test_gcp_provider(self):
|
|
124
|
-
hs = HardwareSet(ALL_INSTANCE_TYPES)
|
|
125
|
-
self.assertEqual(hs.provider, "gcp")
|
|
126
|
-
|
|
127
|
-
def test_cw_provider(self):
|
|
128
|
-
hs = HardwareSet(CW_INSTANCE_TYPES_WITH_GPUS)
|
|
129
|
-
self.assertEqual(hs.provider, "cw")
|
|
130
|
-
|
|
131
|
-
def test_aws_provider(self):
|
|
132
|
-
hs = HardwareSet(AWS_INSTANCE_TYPES)
|
|
133
|
-
self.assertEqual(hs.provider, "aws")
|
|
134
|
-
|