Skip to content

Commit

Permalink
[Caching] Add a cached label for cached pods (kubeflow#3623)
Browse files Browse the repository at this point in the history
* Update mutation.go

* Update mutation.go

* Update mutation.go

* Update mutation.go
  • Loading branch information
Bobgy authored and Jeffwan committed Dec 9, 2020
1 parent 245915e commit 48aca5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/src/cache/server/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (
const (
KFPCacheEnabledLabelKey string = "pipelines.kubeflow.org/cache_enabled"
KFPCacheEnabledLabelValue string = "true"
KFPCachedLabelKey string = "pipelines.kubeflow.org/reused_from_cache"
KFPCachedLabelValue string = "true"
ArgoWorkflowNodeName string = "workflows.argoproj.io/node-name"
ArgoWorkflowTemplate string = "workflows.argoproj.io/template"
ExecutionKey string = "pipelines.kubeflow.org/execution_cache_key"
Expand Down Expand Up @@ -124,6 +126,9 @@ func MutatePodIfCached(req *v1beta1.AdmissionRequest, clientMgr ClientManagerInt

annotations[ArgoWorkflowOutputs] = getValueFromSerializedMap(cachedExecution.ExecutionOutput, ArgoWorkflowOutputs)
labels[CacheIDLabelKey] = strconv.FormatInt(cachedExecution.ID, 10)
labels[KFPCachedLabelKey] = KFPCachedLabelValue // This label indicates the pod is taken from cache.

// These labels cache results for metadata-writer.
labels[MetadataExecutionIDKey] = getValueFromSerializedMap(cachedExecution.ExecutionOutput, MetadataExecutionIDKey)
labels[MetadataWrittenKey] = "true"

Expand Down

0 comments on commit 48aca5b

Please sign in to comment.