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

[YUNIKORN-2504] Support canonical labels and align metadata retrievin order in shim #64

Closed
wants to merge 1 commit into from

Conversation

chenyulin0719
Copy link
Owner

What is this PR for?

Support canonical Queue/ApplicationId labels in Pod, allows it coexist with the existing metadata.

  • yunikorn.apache.org/app-id (New, Canonical Label)
  • yunikorn.apache.org/queue (New, Canonical Label)

ApplicationID is fetched from pod in below order:

  1. Label: constants.CanonicalLabelApplicationID (New)
  2. Annotation: constants.AnnotationApplicationID
  3. Label: constants.LabelApplicationID
  4. Label: constants.SparkLabelAppID

Queue name is fetched from pod in below ortder

  1. Label: constants.CanonicalLabelQueueName (New)
  2. Annotation: constants.AnnotationQueueName
  3. Label: constants.LabelQueueName (Previous: constants.LabelQueueName > constants.AnnotationQueueName)

What type of PR is it?

  • - Feature

Todos

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-2504

How should this be tested?

  • Run the existing tests.
  • Or create below pod:

apiVersion: v1
kind: ConfigMap
metadata:
  name: yunikorn-configs
  namespace: yunikorn
data:
  queues.yaml: |
    partitions:
      - name: default
        queues:
          - name: root
            submitacl: '*'
            queues:
              - name: sandbox
        placementrules:
          - name: provided
            create: true

---

apiVersion: v1
kind: Pod
metadata:
  labels:
    yunikorn.apache.org/app-id: "canonical-app-id"
    yunikorn.apache.org/queue: "root.sandbox"
  annotations:
    yunikorn.apache.org/app-id: "non-canonical-app-id"
    yunikorn.apache.org/queue: "root.sandbox-non-canonical"
  name: pod-with-canonical-metadata
spec:
  schedulerName: yunikorn
  restartPolicy: Never
  containers:
    - name: sleep-6000s
      image: "alpine:latest"
      command: ["sleep", "6000"]
      resources:
        requests:
          cpu: "100m"
          memory: "500M"

Check http://localhost:9889/ws/v1/partition/default/application/canonical-app-id:

  • app-id = canonical-app-id
  • queue = root.sandbox

Screenshots (if appropriate)

image

Questions:

NA

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.11%. Comparing base (fabbce3) to head (36b7e48).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
+ Coverage   68.05%   68.11%   +0.06%     
==========================================
  Files          70       70              
  Lines        7575     7583       +8     
==========================================
+ Hits         5155     5165      +10     
+ Misses       2204     2203       -1     
+ Partials      216      215       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant