Skip to content

Conversation

@kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Feb 5, 2024

Why are these changes needed?

In #1835, we don't store logger into context for RayJob controller. #1894 calls ctrl.LoggerFrom, which retrieves a default logger containing metadata information about the controller and K8s resources. This PR stores the logger into context to keep the consistent logging format. In the future, we may need to add controller/CR metadata to the logger for better structured logging.

  • Without this PR
    2024-02-05T00:56:30.065Z	INFO	FetchHeadServiceURL	{"controller": "rayjob", "controllerGroup": "ray.io", "controllerKind": "RayJob", "RayJob": {"name":"rayjob-sample","namespace":"default"}, "namespace": "default", "name": "rayjob-sample", "reconcileID": "ab326774-9d5a-4513-8bcf-a44e371c755b", "head service name": "rayjob-sample-raycluster-jnmt6-head-svc", "namespace": "default"}
    2024-02-05T00:56:30.065Z	INFO	FetchHeadServiceURL	{"controller": "rayjob", "controllerGroup": "ray.io", "controllerKind": "RayJob", "RayJob": {"name":"rayjob-sample","namespace":"default"}, "namespace": "default", "name": "rayjob-sample", "reconcileID": "ab326774-9d5a-4513-8bcf-a44e371c755b", "head service URL": "rayjob-sample-raycluster-jnmt6-head-svc.default.svc.cluster.local:8265", "port": "dashboard"}
    
  • With this PR
    2024-02-05T01:30:54.264Z	INFO	controllers.RayJob	FetchHeadServiceURL	{"head service name": "rayjob-sample-raycluster-zwnfr-head-svc", "namespace": "default"}
    2024-02-05T01:30:54.264Z	INFO	controllers.RayJob	FetchHeadServiceURL	{"head service URL": "rayjob-sample-raycluster-zwnfr-head-svc.default.svc.cluster.local:8265", "port": "dashboard"}
    

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@kevin85421 kevin85421 marked this pull request as ready for review February 5, 2024 02:24
Copy link
Contributor

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@kevin85421 kevin85421 merged commit edfc34f into ray-project:master Feb 6, 2024
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 this pull request may close these issues.

4 participants