-
Notifications
You must be signed in to change notification settings - Fork 31
Have PackageVariant set readiness gate on PackageRevisions #156
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
base: main
Are you sure you want to change the base?
Have PackageVariant set readiness gate on PackageRevisions #156
Conversation
|
/test presubmit-nephio-go-test |
controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go
Show resolved
Hide resolved
|
/test presubmit-nephio-go-test |
5 similar comments
|
/test presubmit-nephio-go-test |
|
/test presubmit-nephio-go-test |
|
/test presubmit-nephio-go-test |
|
/test presubmit-nephio-go-test |
|
/test presubmit-nephio-go-test |
kispaljr
left a comment
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.
I welcome this PR, and wholeheartedly agree with the general direction. :)
These are my initial comments, but could you give me also a couple more days to understand the logic a bit better?
controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go
Outdated
Show resolved
Hide resolved
controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go
Outdated
Show resolved
Hide resolved
controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go
Outdated
Show resolved
Hide resolved
controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go
Show resolved
Hide resolved
3cff6bb to
60cb107
Compare
pkg/engine/engine.go
Outdated
| return repoPkgRev, renderStatus, nil | ||
| } | ||
|
|
||
| func pushPipelineReadinessGate(ctx context.Context, repo repository.Repository, repoPr repository.PackageRevision) error { |
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.
This makes the engine handling of drafts even more complex but there is no other way to do this with the current code structure. Let's refactor engine.go in Nephio R5.
liamfallon
left a comment
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.
/approve
Very comprehensive work @JamesMcDermott
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JamesMcDermott, liamfallon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
- new document describing operation of readiness gates on PackageRevisions
- in general (no existing document for it)
- specifically the changes introduced in
nephio-project/porch#156
- including default readiness gates managed by Porch server for all
PackageRevisions and by package variant controller for PackageRevisions
controlled by a PackageVariant
- new diagram to illustrate flows
nephio-project/nephio#615
nephio-project/porch#156
|
I read through the latest code changes. All my previous comments are now resolved. all-in-all: it looks good to me, it can be merged from my part |
kispaljr
left a comment
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.
Also, as we already discussed on Slack, it would make porch behavior more consistent if the readinessGates + conditions would be also merged from the PR objects that are created with an edit task (similarly how you implemented it to clone and init), but that is not mandatory. This PR can be merged without that.
|
Need to run it through a few e2e runs. Hit an issue on the free5gc suite. Will run again and collect data if it's a recurring issue. |
- alleviates issue where config injection from PackageVariant resulted in both PackageVariant controller detecting a Kptfile change (and updating the PackageRevision with a new patch task) and the API server NOT detecting any Kptfile change, resulting in the server attempting to apply a nil patch mutation and massive panics nephio-project/nephio#615
- adjustments to usage of Kubernetes IO annotation "internal.config.kubernetes.io/path" to keep it present consistently and avoid it showing up as a diff in update operations - CLI E2E tests now respect a CLEANUP_ON_FAIL variable - if run with CLEANUP_ON_FAIL='false' and a CLI test fails, the suite will not clean that test's namespace off the Kind cluster, allowing for easier inspection of the state at at time of failure nephio-project/nephio#615
- in free5gc suite, one deployment package requires Kubernetes
IO annotation "internal.config.kubernetes.io/index" before
Nephio approval controller will take it in hand
- adjusted usage to avoid removing that annotation as well
- looks like we get away with clearing the legacy
annotations, at least
- when updating package revision resources, skip closing
pipeline readiness gate if no actual resource change
(new resources are equal to old resources)
- add text to update where we commit/push to close pipeline
readiness gate before render - better visibility in Git
history
nephio-project/nephio#615
- pushing code only - tests likely to fail; adjustments pending confirmation that this still works with free5gc suite
- PackagePipelinePassed readiness condition is now set to
"True" in genericTaskHandler, at the last possible moment
before returning to cadEngine
- unified approach for consistency
- allows us to be sure it covers all mutations in any given
create/update operation as some operations/packages may
include (for example) multiple render mutations
- also means lock/unlock commits show up as distinct commits
in Git history
- but specifically excluded them from task lists
- edit and clone operations now include default readiness
gates and conditions
- gave render mutation its own (arbitrary string) task type
"render", to better distinguish it in task list and Git
commit history
nephio-project/nephio#615
- final render mutation should now run only on actual changes to resources - and not run on empty updates, preserving state of task list nephio-project/nephio#615
- further testing revealed annotations were a red herring
- real issue lay in readiness-info patches not triggering
Kpt package render operations
nephio-project/nephio#615
- refactored package revision variable names in edit mutation - had old and new the wrong way round
- removed PackagePipelinePassed from default conditions
- left machinery in place for default conditions/readiness gates
for future use
- now setting PackagePipelinePassed only at point of pipeline render
- determined by:
- presence of pipeline element in Kptfile, AND
- presence of rendering task (type == "render" or image == "render")
in package revision's task list
nephio-project/nephio#615
- was dependent on debugging to find and fix an issue in a test artefact - see nephio-project/catalog#110 - resolved performance degradation in packagevariant_controller - added too many calls to re-read package revisions or resources - should have it pared down to the minimum to work OK - detection of pipeline now works as intended to set the "waiting for pipeline run" readiness condition only if the package has a pipeline that will do anything in the render nephio-project/nephio#615
62c015f to
b52b571
Compare
|
Other work has become higher-priority - putting this issue on hold. I've pushed the additional changes that have it working (at least for the free5gc tests). Remaining items to do:
|
|
/hold |
|
@JamesMcDermott: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Implements #615; documentation update in docs PR #204
incoming ReadinessGates and Conditions are now saved in PackageRevision creation flows
a successful pipeline run (defined as 1 or more runs in the same operation of the generictaskhandler.go::applyResourceMutations() function) sets the PackagePipelinePassed condition:
porchctl rpkg proposewhile the pipeline is runningPackageVariant controller now sets its own PVOperationsComplete condition and readiness gate on PackageRevisions it manages
PackageVariant controller can now handle optimistic concurrency conflicts when making its final (per-reconcile) status update to a PackageVariant
refactors internal conversion of Kptfiles to YAML since readiness condition information is stored in the package Kptfile
adds more info to error message in case of Git conflict when applying a patch
renderPackageMutation mutation now has its own (arbitrary string) task type "render", to better distinguish it in task list and Git commit history
CLI E2E tests now give more information on failure
CLI E2E tests now fail on first test failure to allow easier identification of the failed test's output
CLI E2E tests now respect a CLEANUP_ON_FAIL environment variable - if run with CLEANUP_ON_FAIL='false' and a CLI test fails, the suite will not clean that test's namespace off the Kind cluster, allowing for easier inspection of the state at time of failure
some refactoring/renaming for readbility
fixed typo in Makefile comment