Add no-auth session manager to romi_run_task CLI#10
Merged
Conversation
- Replaced "associated to" with "associated with" across multiple files for consistent phrasing.
…b.commons.test_database`
- Read `ROMI_DB_NOAUTH` from the environment and pass it as `no_auth` to `FSDB` constructor in `romitask/src/romitask/task.py` - Perform `db.login` only when `no_auth` is false, using `ROMI_DB_USER` and `ROMI_DB_PASSWORD` environment variables - Preserve existing behavior by defaulting `no_auth` to `False` when the variable is unset - Ensure DB connection is still established with `db.connect()` before conditional login
- Import `dotenv_values` and read environment variables from `<dataset_path>/.env`. - Introduce `--no-auth` CLI flag for testing with automatic admin login. - Merge dotenv values into a custom `env` dict and set `LUIGI_CONFIG_PARSER`, `LUIGI_CONFIG_PATH`, and default `PYOPENCL_CTX`. - When `--no-auth` is used, ensure `ROMI_DB_NOAUTH` is set to `"1"` unless explicitly disabled via environment or `.env`. - Update subprocess call to merge custom `env` with `os.environ` so system‑wide variables overwrite duplicates. - Pass `no_auth=args.no_auth` to `run_task` invocation.
- Updated `romitask/src/romitask/cli/romi_run_task.py` to include ``no_auth=args.no_auth`` in the `run_task` invocation.
- Extend the `env` dict in `romitask/src/romitask/cli/romi_run_task.py` with `"MPLBACKEND": "Agg"` to enforce a non‑interactive matplotlib backend during task execution.
- Replaced "associated to" with "associated with" across multiple files for consistent phrasing.
…b.commons.test_database`
- Read `ROMI_DB_NOAUTH` from the environment and pass it as `no_auth` to `FSDB` constructor in `romitask/src/romitask/task.py` - Perform `db.login` only when `no_auth` is false, using `ROMI_DB_USER` and `ROMI_DB_PASSWORD` environment variables - Preserve existing behavior by defaulting `no_auth` to `False` when the variable is unset - Ensure DB connection is still established with `db.connect()` before conditional login
- Import `dotenv_values` and read environment variables from `<dataset_path>/.env`. - Introduce `--no-auth` CLI flag for testing with automatic admin login. - Merge dotenv values into a custom `env` dict and set `LUIGI_CONFIG_PARSER`, `LUIGI_CONFIG_PATH`, and default `PYOPENCL_CTX`. - When `--no-auth` is used, ensure `ROMI_DB_NOAUTH` is set to `"1"` unless explicitly disabled via environment or `.env`. - Update subprocess call to merge custom `env` with `os.environ` so system‑wide variables overwrite duplicates. - Pass `no_auth=args.no_auth` to `run_task` invocation.
- Updated `romitask/src/romitask/cli/romi_run_task.py` to include ``no_auth=args.no_auth`` in the `run_task` invocation.
- Extend the `env` dict in `romitask/src/romitask/cli/romi_run_task.py` with `"MPLBACKEND": "Agg"` to enforce a non‑interactive matplotlib backend during task execution.
ArthurLuciani2
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds a
--no‑authoption to theromi_run_taskCLI, allowing the task to run without specifying a username and password.The goal is to enable the use of
NoAuthSessionManagerto remove the necessity to set username and password by using the--no-authoption in place of--db-userand--db-password.To protect production databases, the
ROMI_DB_NOAUTHvariable defaults to0(or can be set in a.envfile). When it is0, the--no‑authflag is disabled.Details
<dataset_path>/.envusingdotenv_valuesand merge them into a customenvdictionary.--no-authCLI flag; when used,ROMI_DB_NOAUTHis set to"1"unless explicitly overridden, allowing testing without DB authentication.no_authargument throughrun_taskand to theFSDBconstructor, skipping DB login when authentication is disabled and usingROMI_DB_USER/ROMI_DB_PASSWORDotherwise.dummy_dbimport toplantdb.commons.test_database.Miscellaneous
MPLBACKEND=Aggin the luigi subprocess environment to enforce a non‑interactive Matplotlib backend.