Skip to content

chore: preserve binaries across reboots #708

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

Merged
merged 3 commits into from
Jul 27, 2023
Merged

Conversation

pcnc
Copy link
Member

@pcnc pcnc commented Jul 21, 2023

What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

@pcnc pcnc requested a review from a team as a code owner July 21, 2023 13:15
@notion-workspace
Copy link

@pcnc pcnc force-pushed the pcnc/preserve-binaries branch from 3cbd337 to b0b0b54 Compare July 21, 2023 14:48

if [ ! -f "${ADMINMGR_CUSTOM_DIR}/admin-mgr" ]; then
echo "Copying existing admin-mgr binary from /usr/bin/admin-mgr to ${ADMINMGR_CUSTOM_DIR}"
cp "/usr/bin/admin-mgr" "${ADMINMGR_CUSTOM_DIR}/admin-mgr"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what the ideal place is since we're doing this for each of the services, but the general flow of operations here could use a comment describing it

Copy link
Member Author

Choose a reason for hiding this comment

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

Though about pulling this out in a generic function - but its maintainability might take a hit given the number of args and options per service. Will take a different approach, so that we also save on boot time overhead

cp "/usr/bin/admin-mgr" "${ADMINMGR_CUSTOM_DIR}/admin-mgr"
fi

rm -f "/usr/bin/admin-mgr"
Copy link
Contributor

Choose a reason for hiding this comment

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

All this has to be executed each time the machine starts up?

What if we shipped a dangling symlink as part of the image, and the init script moved the base version of the binary to the data vol as part of the very first boot? Maybe that's complicating things unnecessarily though

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that'd be better - copying over a few config files doesn't bring much overhead, but copying over tens of MB on every boot can bring a noticeable overhead, especially if we aim for our boot times to generate minimal friction

@pcnc pcnc force-pushed the pcnc/preserve-binaries branch from 6591bdc to 3cab4a8 Compare July 27, 2023 05:41
@pcnc pcnc merged commit e48b505 into develop Jul 27, 2023
@pcnc pcnc deleted the pcnc/preserve-binaries branch July 27, 2023 06:43
damonrand pushed a commit to cepro/postgres that referenced this pull request Jun 15, 2025
* chore: preserve binaries across reboots

* chore: add shims

* chore: reference binaries using dangling symlinks
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