Conversation
9318115 to
30d7ec1
Compare
591cd39 to
551b750
Compare
af759ca to
cd097d5
Compare
|
Add tests |
olivhoenen
left a comment
There was a problem hiding this comment.
-
Need better test coverage of the new functionality.
-
The CLI does not happily accept default remote:
(venv) [hoeneno@98dci4-srv-1005 SimDB]$ (feature/v1.3-local-push-clean) simdb sim push_local --add-watcher --timeout 300.0 131062/4
Usage: simdb sim push_local [OPTIONS] [REMOTE] SIM_ID
Try 'simdb sim push_local --help' for help.
Error: Missing argument 'SIM_ID'.
while specifying the remote name (iterprod is my default) works as expected with correct API negotiation message
(venv) [hoeneno@98dci4-srv-1005 SimDB]$ (feature/v1.3-local-push-clean) simdb sim push_local --add-watcher --timeout 300.0 iterprod 131062/4
Error: 'push_local_simulation' is not supported by the negotiated API version 'v1.2'. It requires one of: v1.3.
This seems to be an issue that already existed before this PR. (also for other commands that accept an optional remote like |
…on tests Adds the `simdb simulation push_local` command for servers that share a file system with the client: only metadata and partition-relative storage paths are sent, and the server copies the files in a background task. Squashed from the pre-rebase history of this branch, which was authored on a stale base.
File types are already assigned at manifest time and preserved by _file_data_for_partition, so this pass was a no-op for correctly ingested simulations. Worse, the directory heuristic could promote a plain FILE entry living next to IMAS data to IMAS, after which the server rewrites its URI. It also opened every .nc file and scanned every parent directory on a shared filesystem.
Hand-rolled requests.post/requests.get bypassed the auth gating on self._server_auth, the gzip compression for large simulations payloads, and the negotiated self._api_url.
e308328 to
9d2fa2f
Compare
|
@Yannicked Could you please resolve merge conflicts. Thank you |
There was a problem hiding this comment.
Not sure whether this error exists from start but renaming the test module will be useful..
(myenv) [sawantp1@98dci4-srv-1005 SimDB]$ pytest -v
=============================================== ERRORS
_________________________ ERROR collecting tests/remote/api/test_metadata.py __________________________
import file mismatch:
imported module 'test_metadata' has this file attribute:
/home/ITER/sawantp1/github/SimDB/tests/imas/test_metadata.py
which is not the same as the test file we want to collect:
/home/ITER/sawantp1/github/SimDB/tests/remote/api/test_metadata.py
HINT: remove pycache / .pyc files and/or use a unique basename for your test file modules
========================================== warnings summary
| schemas = api.get_validation_schemas() | ||
| try: | ||
| for schema in schemas: | ||
| Validator(schema).validate(simulation) |
There was a problem hiding this comment.
Found below error when trying to execute push_local command
$ simdb -d simulation push_local --add-watcher 9fbaf738-bdab-11f1-976d-001dd8b7211a
Error: Validator.__init__() missing 1 required positional argument: 'config'
Traceback (most recent call last):
File "/home/ITER/sawantp1-adm/SimDB/myenv/bin/simdb", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/src/simdb/cli/simdb.py", line 90, in main
rv = cli(standalone_mode=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/myenv/lib64/python3.11/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/src/simdb/cli/commands/simulation.py", line 359, in simulation_push_local
simulation = _prepare_simulation(config, api, sim_id, replaces)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ITER/sawantp1-adm/SimDB/src/simdb/cli/commands/simulation.py", line 237, in _prepare_simulation
Validator(schema).validate(simulation)
^^^^^^^^^^^^^^^^^
TypeError: Validator.__init__() missing 1 required positional argument: 'config'
Depends on #83, #88 and #90