UncountablePythonSDK 0.0.70__py3-none-any.whl → 0.0.72__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 UncountablePythonSDK might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.70
3
+ Version: 0.0.72
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -21,7 +21,7 @@ examples/invoke_uploader.py,sha256=rEvmVY5TjigN_-4PTQdkjY-bC5DrYMcJgquyZ4Tt5FM,7
21
21
  examples/set_recipe_metadata_file.py,sha256=oPBhMo9T17zj4YpJRkmVH9lknYcT8livph0KssxYtg4,1048
22
22
  examples/set_recipe_output_file_sdk.py,sha256=Lz1amqppnWTX83z-C090wCJ4hcKmCD3kb-4v0uBRi0Y,782
23
23
  examples/upload_files.py,sha256=tUfKFqiqwnw08OL5Y8_e4j5pSRhp94cFex8XTuVa_ig,487
24
- examples/integration-server/pyproject.toml,sha256=yVYpx5VG3bKQCYjmCSKN_MRjxoOoF2xF2KzkCcvDHh4,9134
24
+ examples/integration-server/pyproject.toml,sha256=mB0uj-_Wo8WRmhdMwOwcdOB5lAhiW_8Kf-epMFrOq34,9133
25
25
  examples/integration-server/jobs/materials_auto/example_cron.py,sha256=7VVQ-UJsq3DbGpN3XPnorRVZYo-vCwbfSU3VVDluIzA,699
26
26
  examples/integration-server/jobs/materials_auto/profile.yaml,sha256=WZTNlgc8uH412oRmWHWWuenYo_6LnrIL11V0HMkGsB0,352
27
27
  pkgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -85,7 +85,7 @@ uncountable/core/environment.py,sha256=n46mWvG5uBOy6H_aetu_iuaYmO_d23uSbQBRgb6xS
85
85
  uncountable/core/file_upload.py,sha256=qR7BBBWVxFNrb1_WICreo3dkZygE9lcE1fmZCQrDZU0,3469
86
86
  uncountable/core/types.py,sha256=s2CjqYJpsmbC7xMwxxT7kJ_V9bwokrjjWVVjpMcQpKI,333
87
87
  uncountable/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
- uncountable/integration/cli.py,sha256=wv9XHXujO0Zop-R4jmjNQttPOjEDQlXPfvmfZ5HW9QE,2898
88
+ uncountable/integration/cli.py,sha256=h3RE0l1SdjkveOKeY2amlmrJppK4HEQJXk8VG9UJRWg,1359
89
89
  uncountable/integration/construct_client.py,sha256=I2XTamht13vs-JYkV4PpNS_Pc4FJm-KVYqNNvxI4qNk,1916
90
90
  uncountable/integration/cron.py,sha256=6eH-kIs3sdYPCyb62_L2M7U_uQTdMTdwY5hreEJb0hw,887
91
91
  uncountable/integration/entrypoint.py,sha256=EjJdTmED80MrVcNoQ5BhFP3bAYHdU6CzRGiPSZF9y8w,802
@@ -102,7 +102,7 @@ uncountable/integration/executors/executors.py,sha256=CbwatKkHrLhnqYr_nsBjr0KYeO
102
102
  uncountable/integration/executors/generic_upload_executor.py,sha256=NlW5WcYePPA7_fwp5uW_2afAiQLKK7rCkKF06wQ948E,10375
103
103
  uncountable/integration/executors/script_executor.py,sha256=OmSBOtU48G3mqza9c2lCm84pGGyaDk-ZBJCx3RsdJXc,846
104
104
  uncountable/integration/queue_runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
105
- uncountable/integration/queue_runner/job_scheduler.py,sha256=4AdI_89mPNAgO-WSJvqRaN3HbKlzlVRh9aIkwfQvL7o,4679
105
+ uncountable/integration/queue_runner/job_scheduler.py,sha256=n6bM6ZqVOPD0PoJuZV5Y5tuhmw2gI-_p6JbnVlK42uI,5016
106
106
  uncountable/integration/queue_runner/queue_runner.py,sha256=0BmYu5zHdothTevGsB-nXg6MBd1UD-WkP3h1WCKMdQg,710
107
107
  uncountable/integration/queue_runner/types.py,sha256=8qTq29BTSa5rmW6CBlBntP0pNIiDcwu1wHa78pjroS0,219
108
108
  uncountable/integration/queue_runner/worker.py,sha256=GNz8PmPUBMLA-R2VWkC_86WOaeHjHFI2mvBlNRcI3wE,4238
@@ -269,7 +269,7 @@ uncountable/types/api/recipes/set_recipe_inputs.py,sha256=yCGFQoguzsSK_weOK4kcvq
269
269
  uncountable/types/api/recipes/set_recipe_metadata.py,sha256=J2F1FDgFLKjlbGw29TW1Xefy38Zt-C7V1WDK70gRiuY,914
270
270
  uncountable/types/api/recipes/set_recipe_output_annotations.py,sha256=ayG9vnCroYGQ3mmNBALLlQhf9otrR-q0QiNLnWgmIsw,2930
271
271
  uncountable/types/api/recipes/set_recipe_output_file.py,sha256=8s0oxgjhv_hIyV3EoAjIBb970TrJJbKTFaSdNvbgU78,1225
272
- uncountable/types/api/recipes/set_recipe_outputs.py,sha256=I7NUDO_QrKt1rZB7zHr6WWS2FdXCK8Bqc0BxFkDfjyQ,1729
272
+ uncountable/types/api/recipes/set_recipe_outputs.py,sha256=bLR-FtncB6hzqvzQhCts6ERdHJWgPMne4bQi6-xxu_k,1890
273
273
  uncountable/types/api/recipes/set_recipe_tags.py,sha256=kYX13RvHyUOlzL6LbBKDQ8yNvpvNobbnF2WDtgZsKRc,2493
274
274
  uncountable/types/api/recipes/unarchive_recipes.py,sha256=KZKzw0fbQdOBUR3YBunFrHFcex4qPMiA8mDgsB6n24k,814
275
275
  uncountable/types/api/recipes/unlock_recipes.py,sha256=AvzQeZCLs9i7CuhMs3Xltdi4n0q4Td55yHYyBGQgWag,1103
@@ -277,7 +277,7 @@ uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr
277
277
  uncountable/types/api/triggers/run_trigger.py,sha256=_Rpha9nxXI3Xr17CrGDtofg4HZ81x2lt0rMZ6As0qfE,893
278
278
  uncountable/types/api/uploader/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
279
279
  uncountable/types/api/uploader/invoke_uploader.py,sha256=Rc77y5q-3R9-SNQgm8P35zKaW2D1Hbtm7PDixnOn1G0,1025
280
- UncountablePythonSDK-0.0.70.dist-info/METADATA,sha256=_GI0ixHy91cpiMAMQfwyE-Sfvowp982PEBAw6-emnM0,2051
281
- UncountablePythonSDK-0.0.70.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
282
- UncountablePythonSDK-0.0.70.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
283
- UncountablePythonSDK-0.0.70.dist-info/RECORD,,
280
+ UncountablePythonSDK-0.0.72.dist-info/METADATA,sha256=Tg7-rgPrn3Yym3NA4cOfJjdjawKYQFKmEi6mMe7rPi0,2051
281
+ UncountablePythonSDK-0.0.72.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
282
+ UncountablePythonSDK-0.0.72.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
283
+ UncountablePythonSDK-0.0.72.dist-info/RECORD,,
@@ -9,7 +9,7 @@ dependencies = [
9
9
  "ruff == 0.*",
10
10
  "openpyxl == 3.*",
11
11
  "more_itertools == 10.*",
12
- "types-paramiko == 3.4.0.20240423",
12
+ "types-paramiko ==3.5.0.20240918",
13
13
  "types-openpyxl == 3.*",
14
14
  "types-pysftp == 0.*",
15
15
  "types-pytz == 2024.*",
@@ -2,20 +2,17 @@ import argparse
2
2
 
3
3
  from opentelemetry.trace import get_current_span
4
4
 
5
- from uncountable.core.async_batch import AsyncBatchProcessor
6
- from uncountable.integration.construct_client import construct_uncountable_client
7
- from uncountable.integration.executors.executors import execute_job
8
- from uncountable.integration.job import CronJobArguments
9
- from uncountable.integration.scan_profiles import load_profiles
10
- from uncountable.integration.telemetry import JobLogger, Logger
11
- from uncountable.types import job_definition_t
5
+ from uncountable.core.environment import get_local_admin_server_port
6
+ from uncountable.integration.queue_runner.command_server.command_client import (
7
+ send_job_queue_message,
8
+ )
9
+ from uncountable.integration.telemetry import Logger
10
+ from uncountable.types import queued_job_t
12
11
 
13
12
 
14
13
  def main() -> None:
15
14
  logger = Logger(get_current_span())
16
15
 
17
- profiles = load_profiles()
18
-
19
16
  parser = argparse.ArgumentParser(
20
17
  description="Process a job with a given command and job ID."
21
18
  )
@@ -29,45 +26,22 @@ def main() -> None:
29
26
 
30
27
  parser.add_argument("job_id", type=str, help="The ID of the job to process")
31
28
 
29
+ parser.add_argument(
30
+ "--host", type=str, default="localhost", nargs="?", help="The host to run on"
31
+ )
32
+
32
33
  args = parser.parse_args()
33
34
 
34
35
  with logger.push_scope(args.command):
35
36
  if args.command == "run":
36
- job_result: job_definition_t.JobResult | None = None
37
- for profile in profiles:
38
- for job in profile.definition.jobs:
39
- if job.id == args.job_id:
40
- profile_meta = job_definition_t.ProfileMetadata(
41
- name=profile.name,
42
- base_url=profile.definition.base_url,
43
- auth_retrieval=profile.definition.auth_retrieval,
44
- client_options=profile.definition.client_options,
45
- )
46
- job_logger = JobLogger(
47
- base_span=logger.current_span,
48
- profile_metadata=profile_meta,
49
- job_definition=job,
50
- )
51
- client = construct_uncountable_client(
52
- profile_meta=profile_meta, job_logger=job_logger
53
- )
54
- batch_processor = AsyncBatchProcessor(client=client)
55
- job_args = CronJobArguments(
56
- job_definition=job,
57
- profile_metadata=profile_meta,
58
- client=client,
59
- batch_processor=batch_processor,
60
- logger=job_logger,
61
- payload=None,
62
- )
63
- job_result = execute_job(
64
- job_definition=job,
65
- profile_metadata=profile_meta,
66
- args=job_args,
67
- )
68
- break
69
- if job_result is None:
70
- raise Exception(f"no such job id {args.job_id}")
37
+ send_job_queue_message(
38
+ job_ref_name=args.job_id,
39
+ payload=queued_job_t.QueuedJobPayload(
40
+ invocation_context=queued_job_t.InvocationContextManual()
41
+ ),
42
+ host=args.host,
43
+ port=get_local_admin_server_port(),
44
+ )
71
45
  else:
72
46
  parser.print_usage()
73
47
 
@@ -3,6 +3,8 @@ import typing
3
3
  from concurrent.futures import ProcessPoolExecutor
4
4
  from dataclasses import dataclass
5
5
 
6
+ from opentelemetry.trace import get_current_span
7
+
6
8
  from uncountable.integration.db.connect import IntegrationDBService, create_db_engine
7
9
  from uncountable.integration.db.session import get_session_maker
8
10
  from uncountable.integration.queue_runner.command_server import (
@@ -14,6 +16,7 @@ from uncountable.integration.queue_runner.datastore import DatastoreSqlite
14
16
  from uncountable.integration.queue_runner.datastore.interface import Datastore
15
17
  from uncountable.integration.queue_runner.worker import Worker
16
18
  from uncountable.integration.scan_profiles import load_profiles
19
+ from uncountable.integration.telemetry import Logger
17
20
  from uncountable.types import job_definition_t, queued_job_t
18
21
 
19
22
  from .types import ResultQueue, ResultTask
@@ -72,6 +75,7 @@ def _start_workers(
72
75
 
73
76
 
74
77
  async def start_scheduler(command_queue: CommandQueue) -> None:
78
+ logger = Logger(get_current_span())
75
79
  result_queue: ResultQueue = asyncio.Queue()
76
80
  engine = create_db_engine(IntegrationDBService.RUNNER)
77
81
  session_maker = get_session_maker(engine)
@@ -87,7 +91,12 @@ async def start_scheduler(command_queue: CommandQueue) -> None:
87
91
  queued_jobs = datastore.load_job_queue()
88
92
 
89
93
  async def enqueue_queued_job(queued_job: queued_job_t.QueuedJob) -> None:
90
- worker = job_worker_lookup[queued_job.job_ref_name]
94
+ try:
95
+ worker = job_worker_lookup[queued_job.job_ref_name]
96
+ except KeyError as e:
97
+ logger.log_exception(e)
98
+ datastore.remove_job_from_queue(queued_job.queued_job_uuid)
99
+ return
91
100
  await worker.listen_queue.put(queued_job)
92
101
 
93
102
  for queued_job in queued_jobs:
@@ -10,6 +10,7 @@ from decimal import Decimal # noqa: F401
10
10
  import dataclasses
11
11
  from pkgs.serialization import serial_class
12
12
  from ... import base_t
13
+ from ... import field_values_t
13
14
  from ... import recipes_t
14
15
  from ... import response_t
15
16
 
@@ -47,6 +48,7 @@ class RecipeOutputValue:
47
48
  value_str: typing.Optional[str] = None
48
49
  value_curve: typing.Optional[CurveValues] = None
49
50
  formatting: typing.Optional[recipes_t.RecipeAttributeFormatting] = None
51
+ field_values: typing.Optional[list[typing.Union[field_values_t.ArgumentValueRefName, field_values_t.ArgumentValueId]]] = None
50
52
 
51
53
 
52
54
  # DO NOT MODIFY -- This file is generated by type_spec