flowmesh-cli 0.1.9__tar.gz → 0.1.10rc2__tar.gz

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.
Files changed (31) hide show
  1. {flowmesh_cli-0.1.9/src/flowmesh_cli.egg-info → flowmesh_cli-0.1.10rc2}/PKG-INFO +3 -3
  2. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/pyproject.toml +3 -3
  3. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/_version.py +1 -1
  4. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/node.py +8 -8
  5. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/worker.py +67 -0
  6. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2/src/flowmesh_cli.egg-info}/PKG-INFO +3 -3
  7. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli.egg-info/requires.txt +2 -2
  8. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/LICENSE +0 -0
  9. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/README.md +0 -0
  10. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/setup.cfg +0 -0
  11. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/__init__.py +0 -0
  12. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/cli.py +0 -0
  13. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/__init__.py +0 -0
  14. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/base.py +0 -0
  15. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/result.py +0 -0
  16. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/ssh.py +0 -0
  17. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/system.py +0 -0
  18. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/task.py +0 -0
  19. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/trace.py +0 -0
  20. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/commands/workflow.py +0 -0
  21. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/core/__init__.py +0 -0
  22. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/core/assets.py +0 -0
  23. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/core/logging.py +0 -0
  24. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/core/paths.py +0 -0
  25. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/core/query.py +0 -0
  26. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/core/task.py +0 -0
  27. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli/core/typer.py +0 -0
  28. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli.egg-info/SOURCES.txt +0 -0
  29. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli.egg-info/dependency_links.txt +0 -0
  30. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli.egg-info/entry_points.txt +0 -0
  31. {flowmesh_cli-0.1.9 → flowmesh_cli-0.1.10rc2}/src/flowmesh_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flowmesh-cli
3
- Version: 0.1.9
3
+ Version: 0.1.10rc2
4
4
  Summary: FlowMesh command line interface
5
5
  License-Expression: Apache-2.0
6
6
  Requires-Python: >=3.12
@@ -10,9 +10,9 @@ Requires-Dist: typer>=0.12.5
10
10
  Requires-Dist: pyyaml>=6.0.2
11
11
  Requires-Dist: rich>=14.2.0
12
12
  Requires-Dist: websockets>=15.0
13
- Requires-Dist: flowmesh-sdk==0.1.9
13
+ Requires-Dist: flowmesh-sdk==0.1.10rc2
14
14
  Provides-Extra: stack
15
- Requires-Dist: flowmesh-cli-stack==0.1.9; extra == "stack"
15
+ Requires-Dist: flowmesh-cli-stack==0.1.10rc2; extra == "stack"
16
16
  Dynamic: license-file
17
17
 
18
18
  # FlowMesh CLI
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "flowmesh-cli"
7
- version = "0.1.9"
7
+ version = "0.1.10rc2"
8
8
  description = "FlowMesh command line interface"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -15,11 +15,11 @@ dependencies = [
15
15
  "pyyaml>=6.0.2",
16
16
  "rich>=14.2.0",
17
17
  "websockets>=15.0",
18
- "flowmesh-sdk==0.1.9",
18
+ "flowmesh-sdk==0.1.10rc2",
19
19
  ]
20
20
 
21
21
  [project.optional-dependencies]
22
- stack = ["flowmesh-cli-stack==0.1.9"]
22
+ stack = ["flowmesh-cli-stack==0.1.10rc2"]
23
23
 
24
24
  [project.scripts]
25
25
  flowmesh = "flowmesh_cli.cli:main"
@@ -3,7 +3,7 @@
3
3
  from importlib.metadata import PackageNotFoundError, version
4
4
 
5
5
  _PACKAGE_NAME = "flowmesh-cli"
6
- _STATIC_VERSION = "0.1.9"
6
+ _STATIC_VERSION = "0.1.10rc2"
7
7
 
8
8
 
9
9
  def _resolve_version() -> str:
@@ -67,7 +67,7 @@ app.add_typer(worker_app, name="worker")
67
67
  def list_workers(
68
68
  node_id: str | None = typer.Argument(None, help="Node identifier"),
69
69
  worker_id: str | None = typer.Option(None, "--id", help="Filter by worker id"),
70
- name: str | None = typer.Option(None, "--name", help="Filter by worker name"),
70
+ alias: str | None = typer.Option(None, "--alias", help="Filter by worker alias"),
71
71
  namespace: str | None = typer.Option(
72
72
  None, "--namespace", help="Filter by worker namespace"
73
73
  ),
@@ -94,7 +94,7 @@ def list_workers(
94
94
  client = FlowMesh()
95
95
  query_params = parse_query_filters(query)
96
96
  append_param(query_params, "id", worker_id)
97
- append_param(query_params, "name", name)
97
+ append_param(query_params, "alias", alias)
98
98
  append_param(query_params, "namespace", namespace)
99
99
  append_param(query_params, "cluster", cluster)
100
100
  append_param(query_params, "provider", provider)
@@ -115,28 +115,28 @@ def list_workers(
115
115
  @worker_app.command("start")
116
116
  def start_worker(
117
117
  node_id: str = typer.Argument(..., help="Node identifier"),
118
- worker_name: str = typer.Argument(..., help="Worker name"),
118
+ alias: str = typer.Argument(..., help="Worker alias"),
119
119
  ) -> None:
120
120
  """Start a worker on a specific node."""
121
121
  client = FlowMesh()
122
122
  try:
123
- client.nodes.start_worker(node_id, worker_name)
123
+ client.nodes.start_worker(node_id, alias)
124
124
  except FlowMeshError as exc:
125
125
  logging.error(str(exc))
126
126
  raise typer.Exit(code=1)
127
- logging.success(f"Worker '{worker_name}' started on node '{node_id}'")
127
+ logging.success(f"Worker '{alias}' started on node '{node_id}'")
128
128
 
129
129
 
130
130
  @worker_app.command("stop")
131
131
  def stop_worker(
132
132
  node_id: str = typer.Argument(..., help="Node identifier"),
133
- worker_name: str = typer.Argument(..., help="Worker name"),
133
+ alias: str = typer.Argument(..., help="Worker alias"),
134
134
  ) -> None:
135
135
  """Stop a worker on a specific node."""
136
136
  client = FlowMesh()
137
137
  try:
138
- client.nodes.stop_worker(node_id, worker_name)
138
+ client.nodes.stop_worker(node_id, alias)
139
139
  except FlowMeshError as exc:
140
140
  logging.error(str(exc))
141
141
  raise typer.Exit(code=1)
142
- logging.success(f"Worker '{worker_name}' stopped on node '{node_id}'")
142
+ logging.success(f"Worker '{alias}' stopped on node '{node_id}'")
@@ -73,3 +73,70 @@ def list_workers(
73
73
  logging.error(str(exc))
74
74
  raise typer.Exit(code=1)
75
75
  logging.log(json.dumps([w.model_dump(mode="json") for w in workers], indent=2))
76
+
77
+
78
+ def _set_cordon(
79
+ cordoned: bool,
80
+ worker_id: str | None,
81
+ node_alias: str | None,
82
+ alias: str | None,
83
+ ) -> None:
84
+ client = FlowMesh()
85
+ try:
86
+ if worker_id is not None and node_alias is None and alias is None:
87
+ set_by_id = client.workers.cordon if cordoned else client.workers.uncordon
88
+ result = set_by_id(worker_id)
89
+ elif worker_id is None and node_alias and alias:
90
+ set_by_alias = (
91
+ client.workers.cordon_alias
92
+ if cordoned
93
+ else client.workers.uncordon_alias
94
+ )
95
+ result = set_by_alias(node_alias, alias)
96
+ else:
97
+ logging.error("Pass a WORKER_ID, or both --node-alias and --alias.")
98
+ raise typer.Exit(code=2)
99
+ except FlowMeshError as exc:
100
+ logging.error(str(exc))
101
+ raise typer.Exit(code=1)
102
+ logging.log(result.model_dump_json(indent=2))
103
+
104
+
105
+ @app.command()
106
+ def cordon(
107
+ worker_id: str | None = typer.Argument(None, help="Worker identifier"),
108
+ node_alias: str | None = typer.Option(
109
+ None, "--node-alias", help="Node alias, with --alias instead of WORKER_ID"
110
+ ),
111
+ alias: str | None = typer.Option(
112
+ None, "--alias", help="Worker alias, with --node-alias instead of WORKER_ID"
113
+ ),
114
+ ) -> None:
115
+ """Stop offering new tasks to a worker without stopping it."""
116
+ _set_cordon(True, worker_id, node_alias, alias)
117
+
118
+
119
+ @app.command()
120
+ def uncordon(
121
+ worker_id: str | None = typer.Argument(None, help="Worker identifier"),
122
+ node_alias: str | None = typer.Option(
123
+ None, "--node-alias", help="Node alias, with --alias instead of WORKER_ID"
124
+ ),
125
+ alias: str | None = typer.Option(
126
+ None, "--alias", help="Worker alias, with --node-alias instead of WORKER_ID"
127
+ ),
128
+ ) -> None:
129
+ """Allow a cordoned worker to receive tasks again."""
130
+ _set_cordon(False, worker_id, node_alias, alias)
131
+
132
+
133
+ @app.command("cordons")
134
+ def list_cordons() -> None:
135
+ """List the cordons visible to the caller."""
136
+ client = FlowMesh()
137
+ try:
138
+ cordons = client.workers.list_cordons()
139
+ except FlowMeshError as exc:
140
+ logging.error(str(exc))
141
+ raise typer.Exit(code=1)
142
+ logging.log(json.dumps([c.model_dump(mode="json") for c in cordons], indent=2))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flowmesh-cli
3
- Version: 0.1.9
3
+ Version: 0.1.10rc2
4
4
  Summary: FlowMesh command line interface
5
5
  License-Expression: Apache-2.0
6
6
  Requires-Python: >=3.12
@@ -10,9 +10,9 @@ Requires-Dist: typer>=0.12.5
10
10
  Requires-Dist: pyyaml>=6.0.2
11
11
  Requires-Dist: rich>=14.2.0
12
12
  Requires-Dist: websockets>=15.0
13
- Requires-Dist: flowmesh-sdk==0.1.9
13
+ Requires-Dist: flowmesh-sdk==0.1.10rc2
14
14
  Provides-Extra: stack
15
- Requires-Dist: flowmesh-cli-stack==0.1.9; extra == "stack"
15
+ Requires-Dist: flowmesh-cli-stack==0.1.10rc2; extra == "stack"
16
16
  Dynamic: license-file
17
17
 
18
18
  # FlowMesh CLI
@@ -2,7 +2,7 @@ typer>=0.12.5
2
2
  pyyaml>=6.0.2
3
3
  rich>=14.2.0
4
4
  websockets>=15.0
5
- flowmesh-sdk==0.1.9
5
+ flowmesh-sdk==0.1.10rc2
6
6
 
7
7
  [stack]
8
- flowmesh-cli-stack==0.1.9
8
+ flowmesh-cli-stack==0.1.10rc2
File without changes
File without changes
File without changes