dh-cli 0.4.0__tar.gz → 0.4.2__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 (51) hide show
  1. {dh_cli-0.4.0 → dh_cli-0.4.2}/PKG-INFO +1 -1
  2. {dh_cli-0.4.0 → dh_cli-0.4.2}/pyproject.toml +1 -1
  3. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/hz/__init__.py +42 -0
  4. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/hz/users.py +49 -5
  5. {dh_cli-0.4.0 → dh_cli-0.4.2}/.gitignore +0 -0
  6. {dh_cli-0.4.0 → dh_cli-0.4.2}/LICENSE +0 -0
  7. {dh_cli-0.4.0 → dh_cli-0.4.2}/README.md +0 -0
  8. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/__init__.py +0 -0
  9. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/__init__.py +0 -0
  10. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/aws_batch.py +0 -0
  11. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/__init__.py +0 -0
  12. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/boltz.py +0 -0
  13. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/cancel.py +0 -0
  14. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/clean.py +0 -0
  15. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/embed_t5.py +0 -0
  16. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/finalize.py +0 -0
  17. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/list_jobs.py +0 -0
  18. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/local.py +0 -0
  19. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/logs.py +0 -0
  20. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/protmpnn.py +0 -0
  21. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/protmpnn_to_boltz.py +0 -0
  22. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/retry.py +0 -0
  23. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/status.py +0 -0
  24. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/submit.py +0 -0
  25. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/train.py +0 -0
  26. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/commands/wait_for.py +0 -0
  27. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/fasta_utils.py +0 -0
  28. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/h5_utils.py +0 -0
  29. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/job_id.py +0 -0
  30. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/manifest.py +0 -0
  31. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/batch/s3_transport.py +0 -0
  32. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/cloud_commands.py +0 -0
  33. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/codeartifact.py +0 -0
  34. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/engines_studios/__init__.py +0 -0
  35. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/engines_studios/api_client.py +0 -0
  36. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/engines_studios/auth.py +0 -0
  37. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/engines_studios/engine_commands.py +0 -0
  38. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/engines_studios/progress.py +0 -0
  39. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/engines_studios/ssh_config.py +0 -0
  40. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/engines_studios/studio_commands.py +0 -0
  41. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/github_commands.py +0 -0
  42. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/hz/deploy.py +0 -0
  43. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/hz/local.py +0 -0
  44. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/hz/test.py +0 -0
  45. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/hz/tf.py +0 -0
  46. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/main.py +0 -0
  47. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/utility_commands.py +0 -0
  48. {dh_cli-0.4.0 → dh_cli-0.4.2}/src/dh_cli/warehouse.py +0 -0
  49. {dh_cli-0.4.0 → dh_cli-0.4.2}/tests/hz/test_init.py +0 -0
  50. {dh_cli-0.4.0 → dh_cli-0.4.2}/tests/hz/test_suites.py +0 -0
  51. {dh_cli-0.4.0 → dh_cli-0.4.2}/tests/hz/test_users.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dh-cli
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Dayhoff Labs developer CLI
5
5
  Author-email: Dayhoff Labs <dev@dayhofflabs.com>
6
6
  License: # PolyForm Noncommercial License 1.0.0
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "dh-cli"
7
- version = "0.4.0"
7
+ version = "0.4.2"
8
8
  description = "Dayhoff Labs developer CLI"
9
9
  requires-python = ">=3.11"
10
10
  readme = "README.md"
@@ -10,6 +10,48 @@ hz_app = typer.Typer(
10
10
  context_settings={"help_option_names": ["-h", "--help"]},
11
11
  )
12
12
 
13
+ API_URLS = {
14
+ "prod": "https://api.horizyn.dayhofflabs.com",
15
+ "dev": "https://horizyn-api-dev.dayhofflabs.com",
16
+ }
17
+
18
+
19
+ @hz_app.command()
20
+ def health(
21
+ detailed: bool = typer.Option(False, "-d", "--detailed", help="Include GPU and EFS details."),
22
+ ):
23
+ """Check API health for both prod and dev environments."""
24
+ import json
25
+ from concurrent.futures import ThreadPoolExecutor
26
+ from urllib.request import urlopen
27
+ from urllib.error import URLError
28
+
29
+ path = "/healthz/detailed" if detailed else "/healthz"
30
+
31
+ def _fetch(env: str) -> tuple[str, dict | str]:
32
+ try:
33
+ with urlopen(f"{API_URLS[env]}{path}", timeout=10) as resp:
34
+ return env, json.loads(resp.read())
35
+ except (URLError, OSError) as exc:
36
+ return env, f"unreachable ({exc})"
37
+ except json.JSONDecodeError:
38
+ return env, "invalid response"
39
+
40
+ with ThreadPoolExecutor(max_workers=2) as pool:
41
+ results = dict(pool.map(_fetch, API_URLS))
42
+
43
+ for env in ("prod", "dev"):
44
+ label = f"[{env}] {API_URLS[env]}"
45
+ data = results[env]
46
+ if isinstance(data, str):
47
+ typer.secho(f"{label} ✗ {data}", fg=typer.colors.RED)
48
+ else:
49
+ status = data.get("status", "unknown")
50
+ version = data.get("version", "?")
51
+ color = typer.colors.GREEN if status == "healthy" else typer.colors.YELLOW
52
+ typer.secho(f"{label} v{version} {status}", fg=color)
53
+ typer.echo(json.dumps(data, indent=2))
54
+
13
55
 
14
56
  def _find_workspace_root() -> Path:
15
57
  root = os.environ.get("WORKSPACE_ROOT")
@@ -55,11 +55,19 @@ def list_users(
55
55
 
56
56
  typer.echo(f"\n Horizyn users ({env})\n")
57
57
 
58
- typer.echo(" Admin domains: " + (", ".join(sorted(admin_domains)) or "(none)"))
59
- typer.echo(" Admin emails: " + (", ".join(sorted(admin_emails)) or "(none)"))
60
- typer.echo(" Alpha emails: " + (", ".join(sorted(alpha_emails)) or "(none)"))
61
- typer.echo(" Allowed domains: " + (", ".join(sorted(allowed_domains)) or "(none)"))
62
- typer.echo(" Allowed emails: " + (", ".join(sorted(allowed_emails)) or "(none)"))
58
+ def _print_section(label: str, items: set[str]) -> None:
59
+ typer.echo(f" {label}:")
60
+ if not items:
61
+ typer.echo(" (none)")
62
+ else:
63
+ for item in sorted(items):
64
+ typer.echo(f" {item}")
65
+
66
+ _print_section("Admin domains", admin_domains)
67
+ _print_section("Admin emails", admin_emails)
68
+ _print_section("Alpha emails", alpha_emails)
69
+ _print_section("Allowed domains", allowed_domains)
70
+ _print_section("Allowed emails", allowed_emails)
63
71
  typer.echo()
64
72
 
65
73
 
@@ -133,3 +141,39 @@ def promote_user(
133
141
  else:
134
142
  alphas.add(email)
135
143
  _put_param(ssm, SSM_PARAMS["alpha_emails"].format(env=env), _format_csv(alphas))
144
+
145
+
146
+ @users_app.command("find")
147
+ def find_user(
148
+ email: str = typer.Argument(help="Email address to search for."),
149
+ ):
150
+ """Search for a user across both prod and dev environments."""
151
+ email = email.strip().lower()
152
+ ssm = _ssm_client()
153
+
154
+ domain = email.split("@")[-1] if "@" in email else ""
155
+
156
+ typer.echo(f"\n Searching for: {email}\n")
157
+
158
+ for env in ("prod", "dev"):
159
+ matches: list[str] = []
160
+
161
+ for param_key in SSM_PARAMS:
162
+ param_name = SSM_PARAMS[param_key].format(env=env)
163
+ values = _parse_csv(_get_param(ssm, param_name))
164
+
165
+ if param_key.endswith("_domains"):
166
+ if domain and domain in values:
167
+ matches.append(f"{param_key} (via @{domain})")
168
+ else:
169
+ if email in values:
170
+ matches.append(param_key)
171
+
172
+ if matches:
173
+ typer.echo(f" {env}: found")
174
+ for m in matches:
175
+ typer.echo(f" - {m}")
176
+ else:
177
+ typer.echo(f" {env}: not found")
178
+
179
+ typer.echo()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes