Skip to content

avoid storing log_level in job_options #1749

Description

@soxofaan

log_level is an official part of job creation in the openEO (POST /jobs endpoint).
So it does not really belong under "job_options", which is by design a container for non-standard feature flags.

Unfortunately, when we store a job in the job registry, we put log_level under job_options, because there is no dedicated log_level field in the job registry APIs:

if "log_level" in metadata:
# TODO: it's not ideal to put "log_level" (processing parameter from official spec)
# in job_options, which is intended for parameters that are not part of official spec.
# Unfortunately, it's quite involved to add a new field like "log_level"
# in all the appropriate job registry related places, so we do it just here for now.
if job_options is None:
job_options = {}
job_options[JOB_OPTION_LOG_LEVEL] = metadata.get("log_level", DEFAULT_LOG_LEVEL_PROCESSING)

This causes confusion when doing post-mortem analysis and job replay situations:

  • say a user creates a job, correctly using the standardized log_level field, and no job_options; e.g. cube.create_job(..., log_level="info")
  • on storing this info in the job registry, the code mentioned above (ab)uses job_options to persist the desired log_level
  • when we do post-mortem analysis during user support (e.g. using openeo-admin, or directly consulting the job registry), it looks like the user created the job with cube.create_job(..., job_options={"log_level": "info"}), which is invalid in the sense that this "log_level" will be ignored.

this makes it confusing to figure out what is going on (e.g. a job "replay" might have different log level than the original job)

(reported by @ElienVandermaesenVITO in context of openeo-admin tool)

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions