Skip to content

feat: add kubernetes support#284

Draft
kyteinsky wants to merge 27 commits intomasterfrom
feat/noid/rev-content-flow
Draft

feat: add kubernetes support#284
kyteinsky wants to merge 27 commits intomasterfrom
feat/noid/rev-content-flow

Conversation

@kyteinsky
Copy link
Copy Markdown
Contributor

No description provided.

@kyteinsky kyteinsky force-pushed the feat/noid/rev-content-flow branch from 4ca116f to 8e53243 Compare March 5, 2026 10:53
stop_bg_threads()
except Exception as e:
logger.exception('Error in enabled handler:', exc_info=e)
return f'Error in enabled handler: {e}'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would leave the threads running, regardless of whether the app is enabled, app_enabled can be checked inside the threads

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes it would be simpler, although I imagine we wouldn't have the guarantee that the thread completed its processes until we hold the line, which is to say, we wait for the thread to complete before allowing the lifespan of the fastapi app to proceed with the shutdown.
app_enabled would signal the thread but the app would still proceed with the cleanup.

the thread.wait() is kind of the equivalent of SHUTDOWN_CLEAR.wait() in the llm2 PR.

this pointed out an important fact, one event for each thread is overkill, only one event for all the threads should suffice and why not let it be the app_enabled one as you suggest.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

app_enabled=False and shutdown is not the same thing though, I think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

app_api switched to a new behaviour recently (not sure when exactly) where disabling the app from the GUI/occ command first sends the enable=False request and then stops the container

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mh, ok. but we can't get rid of the entire app_enabled route because of backwards compatibility, probably?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

maybe we can guess that the app stopping event (the yield in lifespan) is the result of app being disabled if we remove the app_enabled route but it's not ideal, so would be nice if we keep it for now.

app_enabled=False and shutdown is not the same thing though, I think

and you were right :)
added a dedicated event.

@marcelklehr
Copy link
Copy Markdown
Member

marcelklehr commented Mar 10, 2026

Shall we set the context_chat php app to the branch of the corresponding PR here, so we can use CI properly? (temporarily)

@kyteinsky
Copy link
Copy Markdown
Contributor Author

Shall we set the context_chat php app to the branch of the corresponding PR here, so we can use CI properly? (temporarily)

good idea!

@kyteinsky kyteinsky force-pushed the feat/noid/rev-content-flow branch 2 times, most recently from 83b7587 to 84f6896 Compare March 12, 2026 12:20
kyteinsky and others added 22 commits March 26, 2026 23:02
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
@kyteinsky kyteinsky force-pushed the feat/noid/rev-content-flow branch 2 times, most recently from ee9aee5 to 3459ba5 Compare March 26, 2026 20:15
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
@kyteinsky kyteinsky force-pushed the feat/noid/rev-content-flow branch from 3459ba5 to 85d29f1 Compare March 26, 2026 20:26
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
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.

2 participants