Add application-scoped YARN resource usage API - #267
Conversation
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
|
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
rishic3
left a comment
There was a problem hiding this comment.
This looks good to me barring a perf comment.
| with tempfile.TemporaryDirectory(prefix="yarn-resource-cost-") as directory: | ||
| root = Path(directory) | ||
| event_root = _materialize_event_log(s3_client, request.event_log_uri, root / "events") |
There was a problem hiding this comment.
This is walking event logs serially and could be very slow. It would be nice to have an option to accept a pre-materialized set of event logs, which tools can pass in.
There was a problem hiding this comment.
@rishic3 The existing API already supports this path: event_log_uri may be either an S3 URI or a local filesystem path. When the caller supplies a pre-materialized event-log file or directory, _materialize_event_log returns that path directly and performs no S3 listing or download. Aether can therefore pass its locally materialized event logs through the current request field. I agree this is not sufficiently obvious from the field name and current documentation; I can make the local-path behavior explicit in the API docs/README.
Add a typed, packageable Python API for application-scoped YARN resource accounting.
The API accepts injected boto clients, preserves calculator and completeness evidence, returns per-instance seconds plus vcore/memory seconds, and leaves pricing policy to the caller. The existing CLI remains compatible.
Validation:
python3 -m unittest discover -s yarn-resource-cost -p "test*.py"(39 tests)