Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reporting of credit usage in batch jobs #272

Closed
jdries opened this issue Nov 24, 2022 · 4 comments · Fixed by #317
Closed

reporting of credit usage in batch jobs #272

jdries opened this issue Nov 24, 2022 · 4 comments · Fixed by #317
Assignees

Comments

@jdries
Copy link
Contributor

jdries commented Nov 24, 2022

we now log resource usage in marketplace, can we retrieve the resulting credit usage from the marketplace and record it in batch job metadata?
If we use ETL api, the API will return amount of credits when we log resources, so that could be the solution.

@bossie
Copy link
Collaborator

bossie commented Jan 19, 2023

ETL API description including /addedvalue and /resources endpoint: https://etl.terrascope.be/docs/

@bossie
Copy link
Collaborator

bossie commented Jan 20, 2023

  • POST YARN metrics to /resources
  • for each unique process ID, if allowed, POST to /addedvalue
  • if Sentinel Hub costs, POST "shpu" to /resources
  • include credits in batch job metadata

bossie added a commit that referenced this issue Jan 20, 2023
bossie added a commit that referenced this issue Jan 20, 2023
bossie added a commit that referenced this issue Jan 20, 2023
bossie added a commit that referenced this issue Jan 20, 2023
@bossie bossie linked a pull request Jan 23, 2023 that will close this issue
bossie added a commit that referenced this issue Jan 23, 2023
@bossie
Copy link
Collaborator

bossie commented Jan 23, 2023

The effect of these requests can be witnessed in Kibana.

bossie added a commit that referenced this issue Jan 23, 2023
bossie added a commit that referenced this issue Jan 23, 2023
bossie added a commit that referenced this issue Jan 23, 2023
bossie added a commit that referenced this issue Jan 23, 2023
bossie added a commit that referenced this issue Jan 23, 2023
@bossie
Copy link
Collaborator

bossie commented Jan 23, 2023

Implementing retries with requests: Open-EO/openeo-python-client#365 (comment)

bossie added a commit that referenced this issue Jan 25, 2023
Traceback (most recent call last):
  File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/job_tracker.py", line 202, in update_statuses
    duration_ms=finish_time - start_time,
TypeError: unsupported operand type(s) for -: 'str' and 'str'
bossie added a commit that referenced this issue Jan 26, 2023
bossie added a commit that referenced this issue Jan 26, 2023
POST https://etl-dev.terrascope.be/resources {'jobId': 'j-220b5d02390e412386c93508badb7074', 'jobName': None, 'executionId': 'application_1674538064532_9722', 'userId': 'jenkins', 'sourceId': 'TerraScope/MEP', 'orchestrator': 'openeo', 'jobStart': 1674682122903.0, 'jobFinish': 1674682639861.0, 'state': 'SUCCEEDED', 'status': 'finished', 'metrics': {'cpu': {'value': 2480, 'unit': 'cpu-seconds'}, 'memory': {'value': 4020798, 'unit': 'mb-seconds'}, 'time': {'value': 516958.0, 'unit': 'milliseconds'}, 'processing': {'value': 0.0, 'unit': 'shpu'}}} returned 400: {"status":400,"message":"Bad Request Exception","timestamp":"2023-01-25T21:38:55.734Z","path":"/resources"}
bossie added a commit that referenced this issue Jan 26, 2023
Traceback (most recent call last):
  File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/job_tracker.py", line 207, in update_statuses
    area = deep_get(result_metadata, 'area', 'value', None)
  File "/opt/venv/lib64/python3.8/site-packages/openeo/util.py", line 393, in deep_get
    raise DeepKeyError(key, keys)
openeo.util.DeepKeyError: None (from deep key ('area', 'value', None))
soxofaan added a commit that referenced this issue Jan 27, 2023
@jdries jdries added this to the sap05-usability milestone Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants