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

feat: add reconcile strategy field in spec #748

Merged
merged 20 commits into from
Oct 23, 2024
Merged

Conversation

olevski
Copy link
Member

@olevski olevski commented Oct 18, 2024

feat: add reconcile strategy

chore: cleanup tests

@olevski
Copy link
Member Author

olevski commented Oct 18, 2024

This change is part of the following stack:

Change managed by git-spice.

@@ -65,6 +65,8 @@ type AmaltheaSessionSpec struct {

// +optional
// Additional volumes to include in the statefulset for a session
// Volumes used internally by amalthea are all prefixed with 'amalthea-' so as long as you
// avoid that naming you will avoid conflicts with the volumes that amalthea generates.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we have a validator that ensure it does not happen ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sgaist to do this properly we need a validating webhook. Which is a whole other service that requires its own tls certs and a few other things. For now we can rely on the check that already happens in the statefulset for this. I will open another PR where we need to properly surface a bunch of errors that may occur in child resource in the status of amalthea. I will address this there. And for the validating webhook I will open another issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

See #749 and #751

// The status of the session and all hibernation or auto-cleanup functionality will always work as expected.
// A few values are possible:
// - never: Amalthea will never update any of the child resources and will ignore any changes to the CR
// - always: This is the expected method of operation for an operator, changes to the spec are always reconciled
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a way to notify the user that the session needs to be restarted ? Otherwise we will have the issue of work getting interrupted at the least good moment.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sgaist we will most likely not be running Amalthea with the always strategy in renku. I am not sure who you are referring to by "user" because the only "user" we can reliably notify from Amalthea is the admin/service that created the session in k8s. And we can do this via the status field in the CR. But in the case of always, notifying the user that the session needs to be restarted makes no sense. The whole point of this strategy is that things will just happen immediately without action from the user or admin.

We can add a notification that the session will be updated with the whenHibernatedOrFailed strategy. So that users and admins know that the session is out of date and will be updated when the session is hibernated.

We can do a similar thing for the never strategy.

With always what we can try to do is add something that indicates that the session has been updated.

I will do this in a follow up PR.

Copy link
Member Author

@olevski olevski Oct 21, 2024

Choose a reason for hiding this comment

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

See #750

Copy link
Member

@Panaetius Panaetius left a comment

Choose a reason for hiding this comment

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

just a minor comments. Looks good otherwise, though I agree with Samuel's comments.

Panaetius
Panaetius previously approved these changes Oct 22, 2024
Base automatically changed from chore-combine-modules to main October 23, 2024 11:30
@olevski olevski dismissed Panaetius’s stale review October 23, 2024 11:30

The base branch was changed.

@olevski olevski force-pushed the feat-improve-reconciliation branch from 8968307 to da54b8c Compare October 23, 2024 11:36
@olevski olevski enabled auto-merge (squash) October 23, 2024 11:37
@olevski olevski requested a review from Panaetius October 23, 2024 11:38
@olevski olevski merged commit 85f34fe into main Oct 23, 2024
16 checks passed
@olevski olevski deleted the feat-improve-reconciliation branch October 23, 2024 11:59
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.

3 participants