-
Notifications
You must be signed in to change notification settings - Fork 123
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
feat: caching for custom task. #852
feat: caching for custom task. #852
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ScrapCodes The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
return nil, fmt.Errorf("failed to create a new cache entry, %#v, Error: %v", entry, t.db.Error) | ||
} | ||
rowInsert := &model.TaskCache{} | ||
d := t.db.Create(entry).Scan(rowInsert) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry where do you define the database table here? I'm new to the gorm package so I'm not sure where you are referring to the task_caches
table name. I only saw task_caches
during the Get call.
Thanks @ScrapCodes, I ran this code in my new cluster and here is what I found
|
tekton-catalog/pipeline-loops/pkg/reconciler/pipelinelooprun/pipelinelooprun.go
Outdated
Show resolved
Hide resolved
tekton-catalog/pipeline-loops/pkg/cache/task_cache_store_test.go
Outdated
Show resolved
Hide resolved
e21bfb1
to
ebe62af
Compare
tekton-catalog/pipeline-loops/pkg/reconciler/pipelinelooprun/pipelinelooprun.go
Outdated
Show resolved
Hide resolved
tekton-catalog/pipeline-loops/pkg/reconciler/pipelinelooprun/pipelinelooprun.go
Outdated
Show resolved
Hide resolved
On resubmitting the same pipeline run.
|
} | ||
|
||
// ReconcileKind compares the actual state with the desired, and attempts to converge the two. | ||
// It then updates the Status block of the Run resource with the current status of the resource. | ||
func (c *Reconciler) ReconcileKind(ctx context.Context, run *v1alpha1.Run) pkgreconciler.Event { | ||
var merr error | ||
logger := logging.FromContext(ctx) | ||
err := CacheStore.Connect(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also have an environment variable to disable the cache store for pipelineloop? I think the product team needs some time to migrate this behavior, so is better to have some flag that can turn it on/off.
Thanks @ScrapCodes, this looks good to me. We just need to have a flag to turn this feature on/off |
The SDK didn't add the default caching labels for the pipeline loop run spec. Need to open an issue to handle this |
@Tomcli Thank you for all the help ! Please take a look again. |
5a70668
to
fb3d315
Compare
fb3d315
to
2468b3a
Compare
Thanks @ScrapCodes, just a small typo |
Co-authored-by: Tommy Li <[email protected]>
thanks @ScrapCodes, this is good for the initial version and we will get more feedbacks from the internal team to further improve this. |
/lgtm |
Which issue is resolved by this Pull Request:
Resolves #
Description of your changes:
Environment tested:
python --version
):tkn version
):kubectl version
):/etc/os-release
):Checklist: