quapp-hpc 0.0.1.dev11__tar.gz → 0.0.1.dev12__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 (34) hide show
  1. {quapp_hpc-0.0.1.dev11/quapp_hpc.egg-info → quapp_hpc-0.0.1.dev12}/PKG-INFO +1 -1
  2. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/pyproject.toml +1 -1
  3. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12/quapp_hpc.egg-info}/PKG-INFO +1 -1
  4. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_slurm_hpc/log_writer.py +12 -1
  5. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/tests/test_log_writer.py +16 -0
  6. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/LICENSE +0 -0
  7. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/README.md +0 -0
  8. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/__init__.py +0 -0
  9. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/component/__init__.py +0 -0
  10. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/component/backend/__init__.py +0 -0
  11. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/component/backend/hpc_invocation.py +0 -0
  12. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/component/backend/slurm_job_fetching.py +0 -0
  13. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/factory/__init__.py +0 -0
  14. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/factory/hpc_device_factory.py +0 -0
  15. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/factory/hpc_handler_factory.py +0 -0
  16. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/factory/hpc_provider_factory.py +0 -0
  17. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/handler/__init__.py +0 -0
  18. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/handler/invocation_handler.py +0 -0
  19. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/handler/job_fetching_handler.py +0 -0
  20. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/model/__init__.py +0 -0
  21. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/model/device/__init__.py +0 -0
  22. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/model/device/slurm_device.py +0 -0
  23. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/model/provider/__init__.py +0 -0
  24. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc/model/provider/slurm_provider.py +0 -0
  25. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc.egg-info/SOURCES.txt +0 -0
  26. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc.egg-info/dependency_links.txt +0 -0
  27. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc.egg-info/requires.txt +0 -0
  28. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_hpc.egg-info/top_level.txt +0 -0
  29. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_slurm_hpc/__init__.py +0 -0
  30. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_slurm_hpc/host_wrapper.py +0 -0
  31. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_slurm_hpc/runner.py +0 -0
  32. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/quapp_slurm_hpc/stream_exec.py +0 -0
  33. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/setup.cfg +0 -0
  34. {quapp_hpc-0.0.1.dev11 → quapp_hpc-0.0.1.dev12}/tests/test_stream_exec.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quapp-hpc
3
- Version: 0.0.1.dev11
3
+ Version: 0.0.1.dev12
4
4
  Summary: Quapp HPC library — Slurm integration for Quapp Platform
5
5
  Author-email: "CITYNOW Co. Ltd." <corp@citynow.vn>
6
6
  License: The MIT License (MIT)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quapp-hpc"
7
- version = "0.0.1.dev11"
7
+ version = "0.0.1.dev12"
8
8
  description = "Quapp HPC library — Slurm integration for Quapp Platform"
9
9
  readme = "README.md"
10
10
  authors = [{ name = "CITYNOW Co. Ltd.", email = "corp@citynow.vn" }]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quapp-hpc
3
- Version: 0.0.1.dev11
3
+ Version: 0.0.1.dev12
4
4
  Summary: Quapp HPC library — Slurm integration for Quapp Platform
5
5
  Author-email: "CITYNOW Co. Ltd." <corp@citynow.vn>
6
6
  License: The MIT License (MIT)
@@ -190,7 +190,18 @@ class JobLogWriter:
190
190
  self._stopped = True
191
191
  return None, None
192
192
 
193
- payload = (response.json() or {}).get("data") or {}
193
+ try:
194
+ payload = (response.json() or {}).get("data") or {}
195
+ except ValueError as exc:
196
+ # A 200 with a non-JSON/empty body (proxy hiccup, truncated response) must not
197
+ # crash the caller — json.JSONDecodeError (modern requests) and the plain
198
+ # ValueError older requests/simplejson raise (e.g. requests 2.18 on the DGX
199
+ # station's Python 3.6) are both ValueError subclasses, so this catches either.
200
+ print(f"[log_writer] stopping log stream, could not parse response: {exc}",
201
+ file=sys.stderr, flush=True)
202
+ self._stopped = True
203
+ return None, None
204
+
194
205
  outcome = payload.get("outcome")
195
206
  if outcome in _STOP_OUTCOMES:
196
207
  self._stopped = True
@@ -181,6 +181,22 @@ def test_401_stops_immediately_without_retrying():
181
181
  assert writer.stopped
182
182
 
183
183
 
184
+ def test_non_json_200_response_stops_without_crashing():
185
+ # Regression: a 200 whose body isn't valid JSON (proxy hiccup, truncated response, or the
186
+ # ValueError requests 2.18/simplejson raises on Python 3.6 — the DGX station's interpreter)
187
+ # must be swallowed like any other failure here, not propagate out of append()/open()/close().
188
+ writer = JobLogWriter("http://backend/jobs/j1/logs", "tok", 1)
189
+ with patch.object(log_writer.requests, "post") as mock_post:
190
+ resp = MagicMock()
191
+ resp.status_code = 200
192
+ resp.raise_for_status.side_effect = None
193
+ resp.json.side_effect = ValueError("not JSON")
194
+ mock_post.return_value = resp
195
+ writer.append(b"hello\n") # must not raise
196
+ assert mock_post.call_count == 1
197
+ assert writer.stopped
198
+
199
+
184
200
  @pytest.mark.parametrize("outcome", ["SEALED", "TOO_LATE", "TRUNCATED"])
185
201
  def test_stop_outcomes_halt_further_sends(outcome):
186
202
  writer = JobLogWriter("http://backend/jobs/j1/logs", "tok", 1)
File without changes