scientiflow-cli 0.4.16__py3-none-any.whl → 0.4.18__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.
scientiflow_cli/main.py CHANGED
@@ -117,7 +117,10 @@ def main():
117
117
  elif args.logout:
118
118
  logout_user()
119
119
  elif args.list_jobs:
120
- get_jobs()
120
+ if args.cloud_job:
121
+ get_jobs(is_cloud=args.cloud_job)
122
+ else:
123
+ get_jobs()
121
124
  elif args.set_base_directory:
122
125
  set_base_directory(hostname=args.hostname)
123
126
  elif args.execute_jobs is not None:
@@ -4,8 +4,12 @@ from scientiflow_cli.services.rich_printer import RichPrinter
4
4
 
5
5
  printer = RichPrinter()
6
6
 
7
- def get_jobs() -> list[dict]:
8
- response = make_auth_request(endpoint="/agent-application/check-jobs-to-execute", method="GET", error_message="Unable to fetch jobs!")
7
+ def get_jobs(is_cloud: bool = False) -> list[dict]:
8
+ if is_cloud:
9
+ response = make_auth_request(endpoint="/agent-application/check-cloud-jobs-to-execute", method="GET", error_message="Unable to fetch jobs!")
10
+ printer.print_message("Fetching cloud jobs to execute...", style="bold blue")
11
+ else:
12
+ response = make_auth_request(endpoint="/agent-application/check-jobs-to-execute", method="GET", error_message="Unable to fetch jobs!")
9
13
  try:
10
14
  jobs = response.json()
11
15
  if len(jobs) == 0:
@@ -10,12 +10,15 @@ from scientiflow_cli.services.base_directory import get_base_directory
10
10
  printer = RichPrinter()
11
11
 
12
12
 
13
- def get_all_pending_jobs() -> list[dict]:
13
+ def get_all_pending_jobs(is_cloud: bool = False) -> list[dict]:
14
14
  """
15
15
  Gets all the pending and running jobs using the get_jobs function
16
16
  """
17
17
  try:
18
- return get_jobs()
18
+ if is_cloud:
19
+ return get_jobs(is_cloud=is_cloud)
20
+ else:
21
+ return get_jobs()
19
22
 
20
23
  except Exception as e:
21
24
  printer.print_error("An unexpected error occurred")
@@ -27,7 +30,7 @@ def execute_jobs(job_ids: list[int] = None, parallel: bool = False, is_cloud: bo
27
30
  Execute jobs based on the provided job IDs. If no job IDs are provided, execute all pending jobs.
28
31
  If `parallel` is True, execute jobs asynchronously.
29
32
  """
30
- all_pending_jobs = get_all_pending_jobs()
33
+ all_pending_jobs = get_all_pending_jobs(is_cloud)
31
34
 
32
35
  if job_ids:
33
36
  # Filter jobs based on provided job IDs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scientiflow-cli
3
- Version: 0.4.16
3
+ Version: 0.4.18
4
4
  Summary: CLI tool for scientiflow. This application runs on the client side, decodes pipelines, and executes them in the configured order!
5
5
  License: Proprietary
6
6
  Author: ScientiFlow
@@ -4,15 +4,15 @@ scientiflow_cli/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
4
4
  scientiflow_cli/cli/auth_utils.py,sha256=XeGLqBhbaV5q-I7br-WvLxpL1O_XMB1hhZPEunc1DQc,1793
5
5
  scientiflow_cli/cli/login.py,sha256=RLoVpbAH9MpySCsGSe29MUpz4kdTDdBhxs1L41Xg8qw,846
6
6
  scientiflow_cli/cli/logout.py,sha256=EzpFPA1ENoXqLvduo6rxaVF09GqgO5GCRvnGMDr5BEw,420
7
- scientiflow_cli/main.py,sha256=AliEFU3bebJV2tbvxQYbiMY1bqVGqq3-a6dzkVUXong,6982
7
+ scientiflow_cli/main.py,sha256=riQJWfZV43zS2t-N1oQao2vTfGJF0May1t6hTniounA,7085
8
8
  scientiflow_cli/pipeline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  scientiflow_cli/pipeline/container_manager.py,sha256=KAnE5AvsSg4cewLc_v4gWCqhKGoc7ycHOtl_HYxUK7E,8444
10
10
  scientiflow_cli/pipeline/decode_and_execute.py,sha256=-y52feHSuRTaNZO5Hxg0iOEapwuMFgQ6i9q_HIU0Uo0,20761
11
- scientiflow_cli/pipeline/get_jobs.py,sha256=69jOIVwXd8j2lAYy28r2QcsjFT4yRpXNOqsfopiZhFs,1498
11
+ scientiflow_cli/pipeline/get_jobs.py,sha256=pi9pIPw7ZwIiIRN50BgUMtzf542eqGxQfTLin9BmnUE,1786
12
12
  scientiflow_cli/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  scientiflow_cli/services/auth_service.py,sha256=lknARfVTjRCH-4yWVPKiS330NIVHxFw3HlQdN2Lw3Og,3343
14
14
  scientiflow_cli/services/base_directory.py,sha256=2dUvGYk4enLe3Cagcs_bfv2kNuHg1ws-dtMDEW_tccI,2726
15
- scientiflow_cli/services/executor.py,sha256=RuLB2vt4msI8QenA-lMPuVfDn7fLvfYrALpWdN6ZmuA,11967
15
+ scientiflow_cli/services/executor.py,sha256=NrEx3vw6Qp-zAbzzjb7RXr0_P-M10rwbrOrY9MpvNng,12083
16
16
  scientiflow_cli/services/modes.py,sha256=-Bk1CJO0vgc8v_rXktfKAyHSF6cr5bGbufSGa_DtvY4,1241
17
17
  scientiflow_cli/services/request_handler.py,sha256=CjJqEjXt8AOzyZq6UwUBzRBhahqWHj1_OKUyPG3PpFs,1335
18
18
  scientiflow_cli/services/rich_printer.py,sha256=5ORAaZOa_84m6vP-novpPOI70UPxt0pEvmRq9999Ifg,2129
@@ -24,8 +24,8 @@ scientiflow_cli/utils/file_manager.py,sha256=KLdJlIzFng_BfKHHZzQNp35hXsFMWfgy4OU
24
24
  scientiflow_cli/utils/logger.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  scientiflow_cli/utils/mock.py,sha256=UZ9cN2Qx3EAXcxnLQY5z4DQWy4jflnWFnfNTsuvnFH8,11237
26
26
  scientiflow_cli/utils/singularity.py,sha256=jy8ep7Xa1Eg4fptNjyXLPuVN2KA8l4dFil-w-KaVNkw,4956
27
- scientiflow_cli-0.4.16.dist-info/LICENSE.md,sha256=nb6GGGYuS_KXe33mSNwcEW-QzvwM475NQ4cNE7KBb34,425
28
- scientiflow_cli-0.4.16.dist-info/METADATA,sha256=XJKJK1LBn0GLwpKdNbzMTcR29Cht6pQoDe_-CXJZbvk,2492
29
- scientiflow_cli-0.4.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
- scientiflow_cli-0.4.16.dist-info/entry_points.txt,sha256=0lq2mjcG5hGfODrQodeMSAy9RfE2EX1MZSHRpfSncxc,61
31
- scientiflow_cli-0.4.16.dist-info/RECORD,,
27
+ scientiflow_cli-0.4.18.dist-info/LICENSE.md,sha256=nb6GGGYuS_KXe33mSNwcEW-QzvwM475NQ4cNE7KBb34,425
28
+ scientiflow_cli-0.4.18.dist-info/METADATA,sha256=1zjoTWWeM4v85VjFOxsfjuD1M__opxZwLNKqZplQpnM,2492
29
+ scientiflow_cli-0.4.18.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
+ scientiflow_cli-0.4.18.dist-info/entry_points.txt,sha256=0lq2mjcG5hGfODrQodeMSAy9RfE2EX1MZSHRpfSncxc,61
31
+ scientiflow_cli-0.4.18.dist-info/RECORD,,