ciocore 8.2.0b1__py2.py3-none-any.whl → 8.2.0b2__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.

Binary file
ciocore/hardware_set.py CHANGED
@@ -30,10 +30,12 @@ logger = logging.getLogger(__name__)
30
30
 
31
31
 
32
32
  DESCRIPTION_TEMPLATE_OS = {
33
+ "best-fit": "{operating_system} {description}",
33
34
  "cpu": "{operating_system} {cores} core {memory}GB Mem",
34
35
  "gpu": "{operating_system} {cores} core {memory}GB Mem ({gpu_count} {gpu_model} GPUs {gpu_memory}GB Mem)",
35
36
  }
36
37
  DESCRIPTION_TEMPLATE = {
38
+ "best-fit": "{description}",
37
39
  "cpu": "{cores} core {memory}GB Mem",
38
40
  "gpu": "{cores} core {memory}GB Mem ({gpu_count} {gpu_model} GPUs {gpu_memory}GB Mem)",
39
41
  }
@@ -362,14 +364,6 @@ class HardwareSet(object):
362
364
  else [{"label": "CPU", "order": 1}]
363
365
  )
364
366
  result[it["name"]] = it
365
- result["best_fit"] = {"name":"automatic_instance_type",
366
- "description": "Conductor will choose.",
367
- "categories": [{"label": "auto", "order": 0}],
368
- "gpu": None,
369
- "cores": 0,
370
- "memory": 0
371
- }
372
-
373
367
 
374
368
  return result
375
369
 
@@ -397,19 +391,21 @@ class HardwareSet(object):
397
391
  if dual_platforms:
398
392
  for it in instance_types:
399
393
  flat_dict = flatten_dict(it)
400
- is_gpu = "gpu_count" in flat_dict
401
- if is_gpu:
402
- it["description"] = DESCRIPTION_TEMPLATE_OS["gpu"].format(**flat_dict)
403
- else:
404
- it["description"] = DESCRIPTION_TEMPLATE_OS["cpu"].format(**flat_dict)
394
+ template_key = "cpu"
395
+ if it["name"].startswith("best-fit"):
396
+ template_key = "best-fit"
397
+ elif "gpu_count" in flat_dict:
398
+ template_key = "gpu"
399
+ it["description"] = DESCRIPTION_TEMPLATE_OS[template_key].format(**flat_dict)
405
400
  else:
406
401
  for it in instance_types:
407
402
  flat_dict = flatten_dict(it)
408
- is_gpu = "gpu_count" in flat_dict
409
- if is_gpu:
410
- it["description"] = DESCRIPTION_TEMPLATE["gpu"].format(**flat_dict)
411
- else:
412
- it["description"] = DESCRIPTION_TEMPLATE["cpu"].format(**flat_dict)
403
+ template_key = "cpu"
404
+ if it["name"].startswith("best-fit"):
405
+ template_key = "best-fit"
406
+ elif "gpu_count" in flat_dict:
407
+ template_key = "gpu"
408
+ it["description"] = DESCRIPTION_TEMPLATE[template_key].format(**flat_dict)
413
409
 
414
410
  return instance_types
415
411
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ciocore
3
- Version: 8.2.0b1
3
+ Version: 8.2.0b2
4
4
  Summary: Core functionality for Conductor's client tools
5
5
  Home-page: https://github.com/ConductorTechnologies/ciocore
6
6
  Author: conductor
@@ -53,7 +53,7 @@ See [CONTRIBUTING](CONTRIBUTING.md)
53
53
 
54
54
  ## Unreleased:
55
55
 
56
- * Adds support and updates library tests for instance type auto-selection option.
56
+ * Adds support and updates library tests for the new best fit instance types.
57
57
 
58
58
  ## Version:8.1.0 -- 10 Jun 2024
59
59
 
@@ -1,6 +1,6 @@
1
- ciocore/VERSION,sha256=8GsYj-WuwuLZceRVqkJ--37Gpie719_Xudc2O7lFoKo,12
1
+ ciocore/VERSION,sha256=2uATqhJYU656qUDoxpBQq7mei0G78f6nBzHrY9j6odk,12
2
2
  ciocore/__init__.py,sha256=aTP7LeeosQA8BZE67gDV4jgfTK5zxmwZRjiTRu_ZWj0,646
3
- ciocore/api_client.py,sha256=SBxEwAiwn2XtH7T_ipefUbWhczXjoNdNbQBur1RV-Bw,32810
3
+ ciocore/api_client.py,sha256=GRhnyerDQ90b_qCiBd2zTwtNj7pBAzfOrG8HduJf-Ww,32810
4
4
  ciocore/cli.py,sha256=jZ1lOKQiUcrMhsVmD9SVmPMFwHtgDF4SaoAf2-PBS54,15449
5
5
  ciocore/client_db.py,sha256=tTz3bl2xeDPPcYSDS3g3QgV_xYihJMx0Kj6OeN2klK0,12978
6
6
  ciocore/common.py,sha256=mBIS6KiYoQsjWe6aIFUGRRvCMl8BIN2kmLZ4J8icap8,14982
@@ -10,7 +10,7 @@ ciocore/config.py,sha256=rCL7kaFn1tYgSglN8q9Wx6SwMpoXTq0BMQGwPRVwVIg,8973
10
10
  ciocore/data.py,sha256=Ji0qUk8nJXBNakoHSqBiVx8O58SbZXyt273SHlEDn3U,7027
11
11
  ciocore/exceptions.py,sha256=4Oq-WX-qiN6kPUdBCHvvd6mtSQ0nCkDbJxWt2CNtpv8,1504
12
12
  ciocore/file_utils.py,sha256=swA7th9WhDEloW69YViRTKB-oeC9UmNdEGegfH1r-Gw,17176
13
- ciocore/hardware_set.py,sha256=kzLbKP0YP2DBaRQbzLW5VHkmcNmVR7rXVj7PUj2zgp4,17420
13
+ ciocore/hardware_set.py,sha256=-Cc8PIShvb5Us8EC5JvRWbaX7NS8CtcjtfbGhGbv9Fk,17211
14
14
  ciocore/loggeria.py,sha256=2xdQRFb9NyXynU2O_pSOszJWcpoHgPwTUWJvERg7ODY,15251
15
15
  ciocore/package_environment.py,sha256=MEHV7jfs3NJIEYCIaW8JfJdBmelvPHZMmBzPlXETiRo,7808
16
16
  ciocore/package_query.py,sha256=2m5EBXfu1lmqupZrFF8f8mfkX_PgijpdMxCtFI5e5s0,5574
@@ -26,12 +26,12 @@ ciocore/docsite/index.html,sha256=xz215H_KHWBYI1HT7IRpAZ4d1ptUiO8Y4DlOmbEPgPk,20
26
26
  ciocore/docsite/logo.png,sha256=gArgFFWdw8w985-0TkuGIgU_pW9sziEMZdqytXb5WLo,2825
27
27
  ciocore/docsite/objects.inv,sha256=XwmLactPEWWC4fAWqHNPBXGsluRxLLTrwDLQqq51ONY,775
28
28
  ciocore/docsite/sitemap.xml,sha256=M_V85zl0y2adRvzJAnoCxlZH_Hl7TLnIb1A-6l_xGmI,109
29
- ciocore/docsite/sitemap.xml.gz,sha256=3Jlsa-36ZfMjbHYn936cxyK6OG-kL6cMIuXvnjApovY,127
30
- ciocore/docsite/apidoc/api_client/index.html,sha256=mh9VwU1J3Ks6MWvo5a-PcUt5GYdm8s7KsIVDWfnOeXY,188372
29
+ ciocore/docsite/sitemap.xml.gz,sha256=N659m56MWx060JteLPoWwfaR2O0g178ZdQ-BU87i30E,127
30
+ ciocore/docsite/apidoc/api_client/index.html,sha256=SPB3ox5ht9HPjoTIzIWxa9wKYpmPaQNazDAeAI2Jw-w,188372
31
31
  ciocore/docsite/apidoc/apidoc/index.html,sha256=KGsHBY6GBF380w338GfOIMWnwAyyLvw2i1RQFORdwlE,26171
32
32
  ciocore/docsite/apidoc/config/index.html,sha256=n3koKPRUza5-uHUt8hK8H8XyH6HG_U2CsGobdaN4KfY,72559
33
33
  ciocore/docsite/apidoc/data/index.html,sha256=QhqiXUd_3qk_jGRYB5JiqlJTem8Jg7aKa5mPPDT1978,50850
34
- ciocore/docsite/apidoc/hardware_set/index.html,sha256=FJLjrN3pzotVeYsF6aUa0RCYZzorPBMH_p5anZzI35U,124390
34
+ ciocore/docsite/apidoc/hardware_set/index.html,sha256=t5BOOiE_nSUogdseP2koC1XhxNr8MPi47RFaW1eERrE,123119
35
35
  ciocore/docsite/apidoc/package_environment/index.html,sha256=1d4hVlBXPy4bldkBH1GsRjVd-bxdYANmB-Mg7xIAC_4,69248
36
36
  ciocore/docsite/apidoc/package_tree/index.html,sha256=7GaOHXeM_oKH8Db25f2-h5kUI1R6pcp0bXxW1COCJxs,109393
37
37
  ciocore/docsite/assets/_mkdocstrings.css,sha256=K3bqYEmxlOHQ3-M11JNbBWHCBDBLarkFRm8HuEYrAG4,341
@@ -81,7 +81,7 @@ ciocore/docsite/cmdline/downloader/index.html,sha256=917XE3waukGnIXI9qxl0zYEf3vH
81
81
  ciocore/docsite/cmdline/packages/index.html,sha256=Ssb2R7eSubBNR824oc3jjhJfrG3JKOPojA-uiAczgeQ,20923
82
82
  ciocore/docsite/cmdline/uploader/index.html,sha256=TtLbHNlu4ofZ4bQBqam87RelWdHnVDSL7_rw_YqBbC8,25123
83
83
  ciocore/docsite/how-to-guides/index.html,sha256=rF-DMyk4k_jGUJRF3dKtMMiOgXS8OvBqAn-zxWy3AGs,20100
84
- ciocore/docsite/search/search_index.json,sha256=9GkGlvXOx8zMaOAMa-OFsXBO-tWRZmnOBOzKYCZVm0c,189485
84
+ ciocore/docsite/search/search_index.json,sha256=FaOyC5mABlY1sG1h2HKwMQye7SeXmbh560KwHlmd_7k,189181
85
85
  ciocore/docsite/stylesheets/extra.css,sha256=_Cxe9Dhg1BBi6Kqaz_iZD9z9VyqxA9vtONRjP4PVic0,354
86
86
  ciocore/docsite/stylesheets/tables.css,sha256=LE_zwGRxGcdPIy-9QiVPecOzlEBSqZb_WP5vDkFE0ZM,3235
87
87
  ciocore/downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -110,7 +110,7 @@ tests/test_common.py,sha256=tY_-SY-JmJX09UehFs9RIDqZ785AmhfTl6eVKJeIUFY,763
110
110
  tests/test_config.py,sha256=-_G682Ss3Zr1FmcMkjla1zAZprX2tQKpKc5_wD28rII,13340
111
111
  tests/test_data.py,sha256=NIBXpCjG3Os3vpc1CkiVONrebro8D_jqQyJ0N3kbucU,5433
112
112
  tests/test_downloader.py,sha256=hceljsjnuvk5Vk5X4mHgavIEcpbv8ylPwpz7rTwJ-aE,4721
113
- tests/test_hardware_set.py,sha256=E-jNduU1sp-IQa3L4oKGCTn-Tsn8tGUKPrcK4syFJbY,4862
113
+ tests/test_hardware_set.py,sha256=hW7A_suyYdU7WkB7qoHSBPLxaAP2CKqI0i_ULfO5GeY,4408
114
114
  tests/test_imports_2and3.py,sha256=ehqpRYPVY7djBcb8OT_cnh86iCJJ9wuMWnfSR9RHxmY,507
115
115
  tests/test_job_downloader.py,sha256=_dZqyLZhc2Bq2n7-skERfodHx1JgFyHw8TamHp6ID9I,7025
116
116
  tests/test_package_environment.py,sha256=CdiC2PDVSnbcwTb4fsDTWqGYSzs1n5ca2KMoyISckGA,5893
@@ -120,8 +120,8 @@ tests/test_uploader.py,sha256=B1llTJt_fqR6e_V_Jxfw9z73QgkFlEPU87xLYGzt-TQ,2914
120
120
  tests/test_validator.py,sha256=2fY66ayNc08PGyj2vTI-V_1yeCWJDngkj2zkUM5TTCI,1526
121
121
  tests/mocks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
122
122
  tests/mocks/glob.py,sha256=J2MH7nqi6NJOHuGdVWxhfeBd700_Ckj6cLh_8jSNkfg,215
123
- ciocore-8.2.0b1.dist-info/METADATA,sha256=z73W0b6QgA8z0RvXf5ZMyWfeDEqYk5aog-voihjWTPY,18666
124
- ciocore-8.2.0b1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
125
- ciocore-8.2.0b1.dist-info/entry_points.txt,sha256=cCqcALMYbC4d8545V9w0Zysfg9MVuKWhzDQ2er4UfGE,47
126
- ciocore-8.2.0b1.dist-info/top_level.txt,sha256=SvlM5JlqULzAz00JZWfiUhfjhqDzYzSWssA87zdJl0o,14
127
- ciocore-8.2.0b1.dist-info/RECORD,,
123
+ ciocore-8.2.0b2.dist-info/METADATA,sha256=L6jwFYYGCnJE3D-_PCOZ2wAQNpd3au0ojAMwOYgW1d0,18662
124
+ ciocore-8.2.0b2.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
125
+ ciocore-8.2.0b2.dist-info/entry_points.txt,sha256=cCqcALMYbC4d8545V9w0Zysfg9MVuKWhzDQ2er4UfGE,47
126
+ ciocore-8.2.0b2.dist-info/top_level.txt,sha256=SvlM5JlqULzAz00JZWfiUhfjhqDzYzSWssA87zdJl0o,14
127
+ ciocore-8.2.0b2.dist-info/RECORD,,
@@ -28,31 +28,25 @@ class TestCategorizedInstanceTypes(unittest.TestCase):
28
28
  self.hs = HardwareSet(CW_INSTANCE_TYPES)
29
29
 
30
30
  def test_number_of_categories(self):
31
- self.assertEqual(self.hs.number_of_categories(), 5)
31
+ self.assertEqual(self.hs.number_of_categories(), 4)
32
32
 
33
33
  def test_categories_sorted_on_order(self):
34
34
  labels = [i["label"] for i in self.hs.get_model()]
35
- self.assertEqual(labels, ["auto", "low", "mid", "high", "extra"])
35
+ self.assertEqual(labels, ["low", "mid", "high", "extra"])
36
36
 
37
37
  def test_content_count(self):
38
38
  low_category_values = [c["value"] for c in self.hs.get_model()[0]["content"]]
39
- if len(low_category_values) == 1:
40
- self.assertEqual(low_category_values, ['automatic_instance_type'])
41
- else:
42
- self.assertEqual(low_category_values, ["cw-a-4-16", "cw-b-8-16"])
39
+ self.assertEqual(low_category_values, ["cw-a-4-16", "cw-b-8-16"])
43
40
 
44
41
  def test_in_several_categories(self):
45
42
  low_category_values = [c["value"] for c in self.hs.get_model()[0]["content"]]
46
43
  extra_category_values = [c["value"] for c in self.hs.get_model()[3]["content"]]
47
- if len(low_category_values) == 1:
48
- self.assertEqual(low_category_values, ['automatic_instance_type'])
49
- else:
50
- self.assertIn("cw-a-4-16", low_category_values)
51
- self.assertIn("cw-a-4-16", extra_category_values)
44
+ self.assertIn("cw-a-4-16", low_category_values)
45
+ self.assertIn("cw-a-4-16", extra_category_values)
52
46
 
53
47
  def test_category_names(self):
54
48
  names = self.hs.labels()
55
- self.assertEqual(names, ["auto", "low", "mid", "high", "extra"])
49
+ self.assertEqual(names, ["low", "mid", "high", "extra"])
56
50
 
57
51
 
58
52
  class TestRecategorizeInstanceTypes(unittest.TestCase):
@@ -112,26 +106,23 @@ class TestUncategorizedInstanceTypes(unittest.TestCase):
112
106
  self.hs = HardwareSet(ALL_INSTANCE_TYPES)
113
107
 
114
108
  def test_number_of_categories_uncategorized(self):
115
- self.assertEqual(self.hs.number_of_categories(), 2)
109
+ self.assertEqual(self.hs.number_of_categories(), 1)
116
110
 
117
111
  def test_model_sorted_on_cores_mem(self):
118
112
  content = self.hs.get_model()[0]["content"]
119
113
  result = [c["label"] for c in content]
120
- if len(result) == 1:
121
- self.assertEqual(result, ['Conductor will choose.'])
122
- else:
123
- self.assertEqual(
124
- result,
125
- [
126
- "windows 4 core 26.0GB Mem",
127
- "linux 4 core 27.0GB Mem",
128
- "linux 8 core 30.0GB Mem",
129
- "windows 32 core 208.0GB Mem",
130
- "linux 32 core 208.0GB Mem",
131
- "windows 64 core 416.0GB Mem",
132
- "linux 64 core 416.0GB Mem",
133
- ],
134
- )
114
+ self.assertEqual(
115
+ result,
116
+ [
117
+ "windows 4 core 26.0GB Mem",
118
+ "linux 4 core 27.0GB Mem",
119
+ "linux 8 core 30.0GB Mem",
120
+ "windows 32 core 208.0GB Mem",
121
+ "linux 32 core 208.0GB Mem",
122
+ "windows 64 core 416.0GB Mem",
123
+ "linux 64 core 416.0GB Mem",
124
+ ],
125
+ )
135
126
 
136
127
 
137
128
  class TestProvider(unittest.TestCase):