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.
PR description
Create the async app CLI, which is the counter part of the HTTP service for async tasks.
The CLI can be used to deploy an async worker pool running async tasks.
For now the CLI only contains one endpoint to display the package version:
and another one to start a worker pool.
When launching a worker pool the name of the async app to run has to be provided, the worker configuration will be read from env variables (starting by
ICIJ_WORKER_
).otherwise more options can be provided:
Later the CLI could be enriched with utils to stop workers, list workers running on the machine, expose the async task defined in on the async app and so on.
Changes
neo4j-app
Added
typer
. Implemented theicij-worker workers start
andicij-worker --version
CLI entry pointsChanged
RegistrableMixin
to use theRegistrable.registry_key
attribute value when no name is provided to register a componentRegistrableConfig.from_env
and updated implementedRegistrableConfig.parse_file
so that registered instances ofRegistrableConfig
subclasses can be directly created from the genericRegistrableConfig.from_env/parse_file
. The env or the file are inspected to read the registry key and the appropriate subclass is retrieved from the registry and instanciatedsetup_loggers
toneo4j_app.core.utils.logging
loggers_enter
dependency tohttp_loggers_enter
Fixed
Worker.work_forever
to swallowKeyboardInterrupt
and exit gracefully so that dependencies teardown can complete (this update was necessary due to an update in signel handling in chore: isolate the async app and HTTP app #157)Left for later
pgrep/pkill
can be used for now