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

layers/meta-opentrons: app uses sd_notify #63

Merged
merged 2 commits into from
Mar 16, 2023
Merged

Conversation

sfoster1
Copy link
Member

@sfoster1 sfoster1 commented Mar 10, 2023

It is now a notify service.

Don't merge before Opentrons/opentrons#12266

Environment=@@application-environment@@
ExecStart=/usr/bin/opentrons-robot-app.sh
RestartSec=1
TimeoutStartSec=30
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this enough startup time?

Copy link
Member Author

Choose a reason for hiding this comment

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

don't really know, honestly. i'll be messing with it to verify.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it is!

It is now a notify service.
@sfoster1 sfoster1 force-pushed the add-sd-notify-to-app branch from 03c04fe to 34e4098 Compare March 13, 2023 18:26
sfoster1 added a commit to Opentrons/opentrons that referenced this pull request Mar 15, 2023
sd-notify is a utility for a program to communicate back to the systemd process manager that started it. It can be used in a variety of ways; the one that is most critical is to positively assert that it has started OK. Since this is a function call you can make any time you want to, this lets your program define when it has "started" on its own terms.

The app, especially on the ODD, takes a long time to start - chrome takes a long time to start, and then we load up all our stuff. Currently, systemd considers us "started" as soon as the shell script that invokes chrome exits, which is long before anything useful is rendered. By making ourselves a notify service (in Opentrons/oe-core#63) and putting the notify at the time we receive the first ipc message, which indicates that the frontend is up, we can delay that "ready" status until we're actually rendering.

This can then be used as a criterion in systemd to take down a loading screen.

Closes RCORE-683
@sfoster1 sfoster1 merged commit 493b596 into main Mar 16, 2023
@sfoster1 sfoster1 deleted the add-sd-notify-to-app branch March 16, 2023 20:52
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