outerbounds 0.3.182rc0__py3-none-any.whl → 0.3.182rc2__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.
@@ -342,17 +342,22 @@ def _capsule_worker_semantic_status(
342
342
 
343
343
  status_dict: CapsuleWorkerStatusDict = {
344
344
  "at_least_one_pending": count_for_version(pending_workers) > 0,
345
- "at_least_one_running": count_for_version(running_workers) > 0,
345
+ # if min_replicas is 0, the at_least_one_running should be true for running worker count = 0
346
+ "at_least_one_running": (
347
+ count_for_version(running_workers) >= min(min_replicas, 1)
348
+ ),
346
349
  "at_least_one_crashlooping": count_for_version(crashlooping_workers) > 0,
347
350
  "none_present": (
348
351
  count_for_version(running_workers) == 0
349
352
  and count_for_version(pending_workers) == 0
350
353
  and count_for_version(crashlooping_workers) == 0
351
354
  ),
352
- "all_running": count_for_version(running_workers) == min_replicas,
353
- "fully_finished": count_for_version(running_workers) == min_replicas
354
- and len(pending_workers) == 0
355
- and len(crashlooping_workers) == 0,
355
+ "all_running": count_for_version(running_workers) >= min_replicas,
356
+ "fully_finished": (
357
+ count_for_version(running_workers) >= min_replicas
358
+ and len(pending_workers) == 0
359
+ and len(crashlooping_workers) == 0
360
+ ),
356
361
  "current_info": {
357
362
  "pending": count_for_version(pending_workers),
358
363
  "running": count_for_version(running_workers),
@@ -439,6 +439,12 @@ def deployment_instance_options(func):
439
439
  help=DEPLOYMENT_READY_CONDITIONS.__doc__,
440
440
  default=DEPLOYMENT_READY_CONDITIONS.ATLEAST_ONE_RUNNING,
441
441
  )
442
+ @click.option(
443
+ "--status-file",
444
+ type=str,
445
+ help="The path to the file where the final status of the deployment will be written.",
446
+ default=None,
447
+ )
442
448
  @click.option(
443
449
  "--readiness-wait-time",
444
450
  type=int,
@@ -446,9 +452,10 @@ def deployment_instance_options(func):
446
452
  default=4,
447
453
  )
448
454
  @click.option(
449
- "--max-wait-time",
455
+ "--deployment-timeout",
456
+ "max_wait_time",
450
457
  type=int,
451
- help="The maximum time (in seconds) to wait for the deployment to be ready.",
458
+ help="The maximum time (in seconds) to wait for the deployment to reach readiness before timing out.",
452
459
  default=600,
453
460
  )
454
461
  @click.option(
@@ -702,6 +709,7 @@ def deploy(
702
709
  readiness_condition=None,
703
710
  max_wait_time=None,
704
711
  readiness_wait_time=None,
712
+ status_file=None,
705
713
  no_loader=False,
706
714
  **options,
707
715
  ):
@@ -908,7 +916,9 @@ def deploy(
908
916
  capsule_logger = partial(_spinner_logger, capsule_spinner)
909
917
  capsule_spinner.start()
910
918
 
911
- capsule.wait_for_terminal_state(logger=capsule_logger)
919
+ # We only get the `capsule_response` if the deployment is has reached
920
+ # a successful terminal state.
921
+ final_status = capsule.wait_for_terminal_state(logger=capsule_logger)
912
922
  if capsule_spinner:
913
923
  capsule_spinner.stop()
914
924
 
@@ -918,6 +928,16 @@ def deploy(
918
928
  system_msg=True,
919
929
  )
920
930
 
931
+ if status_file:
932
+ # Create the file if it doesn't exist
933
+ with open(status_file, "w") as f:
934
+ f.write(json.dumps(final_status, indent=4))
935
+ logger(
936
+ f"📝 {capsule.capsule_type} {app_config.config['name']} ({capsule.identifier}) deployment status written to {status_file}",
937
+ color=ColorTheme.INFO_COLOR,
938
+ system_msg=True,
939
+ )
940
+
921
941
  except Exception as e:
922
942
  logger(
923
943
  f"Deployment failed: [{e.__class__.__name__}]: {e}",
@@ -1,3 +1,4 @@
1
+ from datetime import datetime
1
2
  import json
2
3
  import os
3
4
  import pathlib
@@ -751,7 +752,8 @@ class CapsuleDeployer:
751
752
  # side will be really helpful.
752
753
  self._monitor_worker_readiness(workers_state_machine, logger)
753
754
 
754
- elif workers_state_machine.is_failure_state:
755
+ # We should still check for failure state and crash if we detect something in the readiness check
756
+ if workers_state_machine.is_failure_state:
755
757
  # hit the logs endpoint for the worker and get the logs
756
758
  # Print those logs out on the terminal
757
759
  # raise an exception that should be caught gracefully by the cli
@@ -795,4 +797,13 @@ class CapsuleDeployer:
795
797
  self.identifier,
796
798
  f"Capsule {self.identifier} failed to be ready to serve traffic",
797
799
  )
798
- return capsule_response
800
+
801
+ return dict(
802
+ id=self.identifier,
803
+ auth_type=self.capsule_type,
804
+ public_url=self.status.out_of_cluster_url,
805
+ available_replicas=self.status.available_replicas,
806
+ name=self.name,
807
+ deployed_version=self.current_deployment_instance_version,
808
+ deployed_at=datetime.now().isoformat(),
809
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: outerbounds
3
- Version: 0.3.182rc0
3
+ Version: 0.3.182rc2
4
4
  Summary: More Data Science, Less Administration
5
5
  License: Proprietary
6
6
  Keywords: data science,machine learning,MLOps
@@ -29,8 +29,8 @@ Requires-Dist: google-cloud-secret-manager (>=2.20.0,<3.0.0) ; extra == "gcp"
29
29
  Requires-Dist: google-cloud-storage (>=2.14.0,<3.0.0) ; extra == "gcp"
30
30
  Requires-Dist: metaflow-checkpoint (==0.2.1)
31
31
  Requires-Dist: ob-metaflow (==2.15.17.1)
32
- Requires-Dist: ob-metaflow-extensions (==1.1.170rc0)
33
- Requires-Dist: ob-metaflow-stubs (==6.0.3.182rc0)
32
+ Requires-Dist: ob-metaflow-extensions (==1.1.170rc2)
33
+ Requires-Dist: ob-metaflow-stubs (==6.0.3.182rc2)
34
34
  Requires-Dist: opentelemetry-distro (>=0.41b0) ; extra == "otel"
35
35
  Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.20.0) ; extra == "otel"
36
36
  Requires-Dist: opentelemetry-instrumentation-requests (>=0.41b0) ; extra == "otel"
@@ -43,11 +43,11 @@ outerbounds/_vendor/yaml/scanner.py,sha256=ZcI8IngR56PaQ0m27WU2vxCqmDCuRjz-hr7pi
43
43
  outerbounds/_vendor/yaml/serializer.py,sha256=8wFZRy9SsQSktF_f9OOroroqsh4qVUe53ry07P9UgCc,4368
44
44
  outerbounds/_vendor/yaml/tokens.py,sha256=JBSu38wihGr4l73JwbfMA7Ks1-X84g8-NskTz7KwPmA,2578
45
45
  outerbounds/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
- outerbounds/apps/_state_machine.py,sha256=ixgL--jne3q71gQNnUeK-UdLP-Oc2kSGSsIW1fiHZPY,14469
47
- outerbounds/apps/app_cli.py,sha256=vTbIN43A9A_OHTM0I6cb28g3GtY4_jk1wmUi5wG09w0,50174
46
+ outerbounds/apps/_state_machine.py,sha256=eAJFNt_9kwE70XyXoMU107TrzPRnb2xcAyVtXV1yAGc,14646
47
+ outerbounds/apps/app_cli.py,sha256=0TCSxkKz9psJMGULMJcqXvrEJNibBDUTVoY37N5pcIk,51003
48
48
  outerbounds/apps/app_config.py,sha256=UHVK8JLIuW-OcGg5WxDm4QHeImPGtohD4KpJryZntC4,11307
49
49
  outerbounds/apps/artifacts.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- outerbounds/apps/capsule.py,sha256=IYaD5X-IpSD9IsLpIJUaJ2B31up7PY7GhMMizkwLV7I,31039
50
+ outerbounds/apps/capsule.py,sha256=8ZoEjLwcUvbps6H03hkl25cAGj8pyaVNziaAK8AZTxY,31523
51
51
  outerbounds/apps/cli_to_config.py,sha256=Thc5jXRxoU6Pr8kAVVOX-5Es5ha6y6Vh_GBzL__oI7Q,3299
52
52
  outerbounds/apps/click_importer.py,sha256=nnkPOR6TKrtIpc3a5Fna1zVJoQqDZvUXlNA9CdiNKFc,995
53
53
  outerbounds/apps/code_package/__init__.py,sha256=8McF7pgx8ghvjRnazp2Qktlxi9yYwNiwESSQrk-2oW8,68
@@ -78,7 +78,7 @@ outerbounds/utils/metaflowconfig.py,sha256=l2vJbgPkLISU-XPGZFaC8ZKmYFyJemlD6bwB-
78
78
  outerbounds/utils/schema.py,sha256=lMUr9kNgn9wy-sO_t_Tlxmbt63yLeN4b0xQXbDUDj4A,2331
79
79
  outerbounds/utils/utils.py,sha256=4Z8cszNob_8kDYCLNTrP-wWads_S_MdL3Uj3ju4mEsk,501
80
80
  outerbounds/vendor.py,sha256=gRLRJNXtZBeUpPEog0LOeIsl6GosaFFbCxUvR4bW6IQ,5093
81
- outerbounds-0.3.182rc0.dist-info/METADATA,sha256=Y51QdSpzQvPHckh4lLqNcic0u-gM1sIi4rX2K4RmUPA,1846
82
- outerbounds-0.3.182rc0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
83
- outerbounds-0.3.182rc0.dist-info/entry_points.txt,sha256=AP6rZg7y5SK9e9a9iVq0Fi9Q2KPjPZSwtZ6R98rLw-8,56
84
- outerbounds-0.3.182rc0.dist-info/RECORD,,
81
+ outerbounds-0.3.182rc2.dist-info/METADATA,sha256=QNhNeHMNuCMReA27whbsen3OPIniLUinbQ3ScvLfQLc,1846
82
+ outerbounds-0.3.182rc2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
83
+ outerbounds-0.3.182rc2.dist-info/entry_points.txt,sha256=AP6rZg7y5SK9e9a9iVq0Fi9Q2KPjPZSwtZ6R98rLw-8,56
84
+ outerbounds-0.3.182rc2.dist-info/RECORD,,