qontract-development-cli 0.17.0__tar.gz → 0.17.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 (28) hide show
  1. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/PKG-INFO +23 -3
  2. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/README.md +20 -0
  3. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/pyproject.toml +4 -4
  4. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/models.py +2 -2
  5. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/shell.py +16 -6
  6. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/cache.yml.j2 +4 -3
  7. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/compose.override.yml.j2 +20 -13
  8. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/internal-redhat-ca.yml.j2 +1 -0
  9. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/vault.yml.j2 +1 -0
  10. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/__init__.py +0 -0
  11. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/__main__.py +0 -0
  12. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/cli.py +0 -0
  13. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/commands/__init__.py +0 -0
  14. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/commands/config.py +0 -0
  15. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/commands/env.py +0 -0
  16. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/commands/profile.py +0 -0
  17. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/completions.py +0 -0
  18. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/config.py +0 -0
  19. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/api.yml.j2 +0 -0
  20. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/compose.yml.j2 +0 -0
  21. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/prep-worktree.sh.j2 +0 -0
  22. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/reconcile.yml.j2 +0 -0
  23. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/server.yml.j2 +0 -0
  24. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/subscriber.yml.j2 +0 -0
  25. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates/worker.yml.j2 +0 -0
  26. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/templates.py +0 -0
  27. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/utils.py +0 -0
  28. {qontract_development_cli-0.17.0 → qontract_development_cli-0.17.2}/qontract_development_cli/watchdog.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qontract-development-cli
3
- Version: 0.17.0
3
+ Version: 0.17.2
4
4
  Summary: Helper tool for qontract-reconcile development
5
5
  Project-URL: homepage, http://github.com/chassing/qontract-development-cli
6
6
  Project-URL: repository, http://github.com/chassing/qontract-development-cli
@@ -14,8 +14,8 @@ Requires-Dist: jinja2~=3.1
14
14
  Requires-Dist: pydantic-settings~=2.6
15
15
  Requires-Dist: pydantic~=2.9
16
16
  Requires-Dist: pyyaml~=6.0.2
17
- Requires-Dist: rich~=14.0
18
- Requires-Dist: typer~=0.24.1
17
+ Requires-Dist: rich~=15.0
18
+ Requires-Dist: typer~=0.25.1
19
19
  Requires-Dist: watchfiles~=1.1.0
20
20
  Description-Content-Type: text/markdown
21
21
 
@@ -153,6 +153,7 @@ An environment specifies app-interface instance settings, e.g., **dev** vs. **pr
153
153
  | container_platform | Default Docker container platform for all images | linux/amd64 |
154
154
  | gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |
155
155
  | run_qontract_api | Run qontract-api container | false |
156
+ | run_qontract_api_subscriber | Run qontract-api-subscriber container | false |
156
157
  | run_qontract_api_worker | Run qontract-api-worker container | false |
157
158
  | run_cache | Run cache (Redis) container | false |
158
159
  | run_qontract_reconcile | Run qontract-reconcile container | true |
@@ -216,6 +217,11 @@ The command line flag takes precedence over any configuration you might have in
216
217
  | qontract_api_container_platform | Qontract-api container platform | Default from [environment](#environment-settings) |
217
218
  | qontract_api_compose_file | Qontract-api docker-compose file template | `api.yml.j2` |
218
219
  | qontract_api_debugger_port | Debugger port for qontract-api | `5679` |
220
+ | qontract_api_subscriber_build_image | Build qontract-api-subscriber image | `true` |
221
+ | qontract_api_subscriber_image | Qontract-api-subscriber image | `quay.io/redhat-services-prod/.../qontract-api-master:latest` |
222
+ | qontract_api_subscriber_container_platform | Qontract-api-subscriber container platform | Default from [environment](#environment-settings) |
223
+ | qontract_api_subscriber_compose_file | Qontract-api-subscriber docker-compose file template | `subscriber.yml.j2` |
224
+ | qontract_api_subscriber_debugger_port | Debugger port for qontract-api-subscriber | `5681` |
219
225
  | qontract_api_worker_build_image | Build qontract-api-worker image | `true` |
220
226
  | qontract_api_worker_image | Qontract-api-worker image | `quay.io/redhat-services-prod/.../qontract-api-worker-master:latest` |
221
227
  | qontract_api_worker_container_platform | Qontract-api-worker container platform | Default from [environment](#environment-settings) |
@@ -283,6 +289,19 @@ Note that the Qontract Reconcile container will not start running until it is co
283
289
  "enable": true
284
290
  }
285
291
  },
292
+ {
293
+ "name": "Python Debugger: Subscriber",
294
+ "type": "debugpy",
295
+ "request": "attach",
296
+ "connect": { "host": "localhost", "port": 5681 },
297
+ "pathMappings": [
298
+ { "localRoot": "${workspaceFolder}", "remoteRoot": "/opt/app-root/src" }
299
+ ],
300
+ "justMyCode": true,
301
+ "autoReload": {
302
+ "enable": true
303
+ }
304
+ },
286
305
  {
287
306
  "name": "Python Debugger: Worker",
288
307
  "type": "debugpy",
@@ -303,6 +322,7 @@ Note that the Qontract Reconcile container will not start running until it is co
303
322
  "configurations": [
304
323
  "Python Debugger: Reconcile",
305
324
  "Python Debugger: Api",
325
+ "Python Debugger: Subscriber",
306
326
  "Python Debugger: Worker"
307
327
  ],
308
328
  "stopAll": true,
@@ -132,6 +132,7 @@ An environment specifies app-interface instance settings, e.g., **dev** vs. **pr
132
132
  | container_platform | Default Docker container platform for all images | linux/amd64 |
133
133
  | gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |
134
134
  | run_qontract_api | Run qontract-api container | false |
135
+ | run_qontract_api_subscriber | Run qontract-api-subscriber container | false |
135
136
  | run_qontract_api_worker | Run qontract-api-worker container | false |
136
137
  | run_cache | Run cache (Redis) container | false |
137
138
  | run_qontract_reconcile | Run qontract-reconcile container | true |
@@ -195,6 +196,11 @@ The command line flag takes precedence over any configuration you might have in
195
196
  | qontract_api_container_platform | Qontract-api container platform | Default from [environment](#environment-settings) |
196
197
  | qontract_api_compose_file | Qontract-api docker-compose file template | `api.yml.j2` |
197
198
  | qontract_api_debugger_port | Debugger port for qontract-api | `5679` |
199
+ | qontract_api_subscriber_build_image | Build qontract-api-subscriber image | `true` |
200
+ | qontract_api_subscriber_image | Qontract-api-subscriber image | `quay.io/redhat-services-prod/.../qontract-api-master:latest` |
201
+ | qontract_api_subscriber_container_platform | Qontract-api-subscriber container platform | Default from [environment](#environment-settings) |
202
+ | qontract_api_subscriber_compose_file | Qontract-api-subscriber docker-compose file template | `subscriber.yml.j2` |
203
+ | qontract_api_subscriber_debugger_port | Debugger port for qontract-api-subscriber | `5681` |
198
204
  | qontract_api_worker_build_image | Build qontract-api-worker image | `true` |
199
205
  | qontract_api_worker_image | Qontract-api-worker image | `quay.io/redhat-services-prod/.../qontract-api-worker-master:latest` |
200
206
  | qontract_api_worker_container_platform | Qontract-api-worker container platform | Default from [environment](#environment-settings) |
@@ -262,6 +268,19 @@ Note that the Qontract Reconcile container will not start running until it is co
262
268
  "enable": true
263
269
  }
264
270
  },
271
+ {
272
+ "name": "Python Debugger: Subscriber",
273
+ "type": "debugpy",
274
+ "request": "attach",
275
+ "connect": { "host": "localhost", "port": 5681 },
276
+ "pathMappings": [
277
+ { "localRoot": "${workspaceFolder}", "remoteRoot": "/opt/app-root/src" }
278
+ ],
279
+ "justMyCode": true,
280
+ "autoReload": {
281
+ "enable": true
282
+ }
283
+ },
265
284
  {
266
285
  "name": "Python Debugger: Worker",
267
286
  "type": "debugpy",
@@ -282,6 +301,7 @@ Note that the Qontract Reconcile container will not start running until it is co
282
301
  "configurations": [
283
302
  "Python Debugger: Reconcile",
284
303
  "Python Debugger: Api",
304
+ "Python Debugger: Subscriber",
285
305
  "Python Debugger: Worker"
286
306
  ],
287
307
  "stopAll": true,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "qontract-development-cli"
3
- version = "0.17.0"
3
+ version = "0.17.2"
4
4
  description = "Helper tool for qontract-reconcile development"
5
5
  authors = [{ name = "Christian Assing", email = "cassing@redhat.com" }]
6
6
  license = { text = "MIT" }
@@ -13,15 +13,15 @@ dependencies = [
13
13
  "pydantic ~=2.9",
14
14
  "pydantic-settings ~=2.6",
15
15
  "pyyaml ~=6.0.2",
16
- "rich ~=14.0",
17
- "typer ~=0.24.1",
16
+ "rich ~=15.0",
17
+ "typer ~=0.25.1",
18
18
  "watchfiles ~=1.1.0",
19
19
  ]
20
20
 
21
21
  [dependency-groups]
22
22
  dev = [
23
23
  # dev dependencies
24
- "mypy ~=1.13",
24
+ "mypy ~=2.0",
25
25
  "ruff ~=0.7",
26
26
  "types-pyyaml ~=6.0",
27
27
  ]
@@ -51,7 +51,7 @@ class ProfileSettings(BaseModel):
51
51
  qontract_api_compose_file: str = "api.yml.j2"
52
52
  qontract_api_debugger_port: int = 5679
53
53
 
54
- # api-worker
54
+ # api-subscriber
55
55
  qontract_api_subscriber_build_image: bool = True
56
56
  qontract_api_subscriber_image: str = "quay.io/redhat-services-prod/app-sre-tenant/qontract-reconcile-master/qontract-api-master:latest"
57
57
  qontract_api_subscriber_container_platform: str | None = None
@@ -66,7 +66,7 @@ class ProfileSettings(BaseModel):
66
66
  qontract_api_worker_debugger_port: int = 5680
67
67
 
68
68
  # cache
69
- cache_image: str = "redis:7-alpine"
69
+ cache_image: str = "valkey/valkey:8-alpine"
70
70
  cache_container_platform: str | None = None
71
71
  cache_compose_file: str = "cache.yml.j2"
72
72
 
@@ -21,6 +21,15 @@ _docker_compose_bin = (
21
21
  )
22
22
 
23
23
 
24
+ def _compose_base_cmd(compose_file: Path) -> list[str]:
25
+ """Build the base docker compose command with main and override files."""
26
+ cmd = [*_docker_compose_bin, "-f", str(compose_file)]
27
+ override = compose_file.parent / "compose.override.yml"
28
+ if override.exists():
29
+ cmd.extend(["-f", str(override)])
30
+ return cmd
31
+
32
+
24
33
  def compose_up(
25
34
  compose_file: Path,
26
35
  *,
@@ -29,7 +38,7 @@ def compose_up(
29
38
  build: bool = False,
30
39
  ) -> None:
31
40
  log.info("Starting all containers")
32
- compose_cmd = [*_docker_compose_bin, "-f", str(compose_file), "up", "-d"]
41
+ compose_cmd = [*_compose_base_cmd(compose_file), "up", "-d"]
33
42
  if force_recreate:
34
43
  compose_cmd.append("--force-recreate")
35
44
  if remove_orphan:
@@ -41,7 +50,7 @@ def compose_up(
41
50
 
42
51
  def compose_restart(compose_file: Path, container: str) -> None:
43
52
  log.info(f"Restarting {container} container")
44
- compose_cmd = [*_docker_compose_bin, "-f", str(compose_file), "restart", container]
53
+ compose_cmd = [*_compose_base_cmd(compose_file), "restart", container]
45
54
  subprocess.run(compose_cmd, check=True)
46
55
 
47
56
 
@@ -53,12 +62,12 @@ def container_restart(container: str) -> None:
53
62
 
54
63
  def compose_down(compose_file: Path) -> None:
55
64
  log.info("Stopping all containers")
56
- compose_cmd = [*_docker_compose_bin, "-f", str(compose_file), "down"]
65
+ compose_cmd = [*_compose_base_cmd(compose_file), "down"]
57
66
  subprocess.run(compose_cmd, check=True)
58
67
 
59
68
 
60
69
  def compose_log_tail(compose_file: Path) -> Process:
61
- compose_cmd = [*_docker_compose_bin, "-f", str(compose_file), "logs", "--follow"]
70
+ compose_cmd = [*_compose_base_cmd(compose_file), "logs", "--follow"]
62
71
  p = EndlessProcess(target=subprocess.run, args=(compose_cmd,))
63
72
  p.start()
64
73
  return p
@@ -71,7 +80,7 @@ def kill_log_tail(p: Process, compose_file: Path) -> None:
71
80
  "pkill",
72
81
  "-9",
73
82
  "-f",
74
- " ".join([*_docker_compose_bin, "-f", str(compose_file), "logs"]),
83
+ " ".join([*_compose_base_cmd(compose_file), "logs"]),
75
84
  ],
76
85
  check=False,
77
86
  )
@@ -92,7 +101,8 @@ def compose_stop_project(project_name: str) -> None:
92
101
  for p in compose_list_projects():
93
102
  if p["Name"] == project_name:
94
103
  subprocess.run(
95
- [*_docker_compose_bin, "-f", p["ConfigFiles"], "down"], check=True
104
+ [*_docker_compose_bin, "-f", p["ConfigFiles"].split(",")[0], "down"],
105
+ check=True,
96
106
  )
97
107
 
98
108
 
@@ -2,7 +2,6 @@ services:
2
2
  # Cache/Broker (Redis or Valkey compatible)
3
3
  cache:
4
4
  container_name: cache
5
- platform: {{ profile.settings.cache_container_platform or env.settings.container_platform }}
6
5
  image: {{ profile.settings.cache_image }}
7
6
 
8
7
  ports:
@@ -10,12 +9,14 @@ services:
10
9
 
11
10
  healthcheck:
12
11
  test: ["CMD", "redis-cli", "ping"]
12
+ start_period: 5s
13
+ start_interval: 0.1s
13
14
  interval: 5s
14
15
  timeout: 3s
15
16
  retries: 5
16
17
 
17
18
  volumes:
18
- - cache_data:/data
19
+ - cache_data_valkey:/data
19
20
 
20
21
  volumes:
21
- cache_data:
22
+ cache_data_valkey:
@@ -17,12 +17,15 @@ services:
17
17
  depends_on:
18
18
  cache:
19
19
  condition: service_healthy
20
+
21
+ links:
22
+ - cache
20
23
  {% endif %}
21
24
  {% endif %}
22
25
 
23
26
 
24
- {% if env.settings.run_qontract_api_worker %}
25
- qontract-api-worker:
27
+ {% if env.settings.run_qontract_api_subscriber %}
28
+ qontract-api-subscriber:
26
29
  networks:
27
30
  - qontract-development
28
31
 
@@ -30,9 +33,23 @@ services:
30
33
  depends_on:
31
34
  cache:
32
35
  condition: service_healthy
36
+
37
+ links:
38
+ - cache
33
39
  {% endif %}
40
+ {% endif %}
41
+
42
+
43
+ {% if env.settings.run_qontract_api_worker %}
44
+ qontract-api-worker:
45
+ networks:
46
+ - qontract-development
34
47
 
35
48
  {% if env.settings.run_cache %}
49
+ depends_on:
50
+ cache:
51
+ condition: service_healthy
52
+
36
53
  links:
37
54
  - cache
38
55
  {% endif %}
@@ -62,21 +79,11 @@ services:
62
79
  - pki-volume:/etc/pki:z
63
80
  {% endif %}
64
81
 
65
- {% if env.settings.run_qontract_api or env.settings.run_qontract_server or profile.settings.internal_redhat_ca %}
66
- depends_on:
67
- {% if env.settings.run_qontract_api %}
68
- qontract-api:
69
- condition: service_healthy
70
- {% endif %}
71
- {% if env.settings.run_qontract_server %}
72
- qontract-server:
73
- condition: service_healthy
74
- {% endif %}
75
82
  {% if profile.settings.internal_redhat_ca %}
83
+ depends_on:
76
84
  internal-certificates:
77
85
  condition: service_completed_successfully # Let the init container create the pki directory first
78
86
  {% endif %}
79
- {% endif %}
80
87
 
81
88
  {% if env.settings.run_qontract_server or env.settings.run_qontract_api or env.settings.run_vault %}
82
89
  links:
@@ -1,6 +1,7 @@
1
1
  services:
2
2
  internal-certificates:
3
3
  image: {{ profile.settings.internal_redhat_ca_image }}
4
+ pull_policy: daily
4
5
  container_name: internal-certificates
5
6
  platform: {{ profile.settings.internal_redhat_ca_container_platform or env.settings.container_platform }}
6
7
  command: |
@@ -3,6 +3,7 @@ services:
3
3
  container_name: vault
4
4
  platform: {{ profile.settings.vault_container_platform or env.settings.container_platform }}
5
5
  image: {{ profile.settings.vault_image }}
6
+ pull_policy: daily
6
7
  environment:
7
8
  - VAULT_ADDR=http://127.0.0.1:8200
8
9
  - VAULT_TOKEN=root