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

[ installation ] Bundle the daemon in a Debian Package #3

Open
brian-pond opened this issue Jun 29, 2022 · 4 comments
Open

[ installation ] Bundle the daemon in a Debian Package #3

brian-pond opened this issue Jun 29, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@brian-pond
Copy link
Contributor

brian-pond commented Jun 29, 2022

Background

Currently to use the BTU Scheduler, prospective users must do the following:

  • Download 2 binaries hosted here on GitHub in Releases.
  • Save those binaries in a reasonable location on the PATH (e.g. /usr/local/bin)
  • Create a /etc/btu_scheduler/ directory.
  • Create their own btu_scheduler.toml configuration file.
  • Ensure that btu-daemon starts automatically on boot (probably using systemd init files)
  • (Optional) Make sure log files are rotated, so they don't grow too large.
  • (Optional) Create some new Users/Groups for handling permissions.

For some seasoned Linux administrators, the above might be thought trivial. But everyone is different, and the above is still a small chore.

Goal

The whole process could be a lot easier by just doing this:

sudo apt-get install btu_scheduler

So. The purpose of this issue is to wrap the BTU Scheduler in a Debian dpkg. So that installation is a breeze.

Misc

I don't own/use any Red Hat or CentOS AlmaLinux/Rocky Linux systems. If someone else wants to design and build an RPM equivalent, I'd be happy to host it. Otherwise, I don't intend on working on this, until there's enough momentum to justify it. Manually installation the long way is always available.

@brian-pond brian-pond self-assigned this Jun 29, 2022
@brian-pond brian-pond changed the title [feature] Bundle the daemon in a Debian Package [ installation ] Bundle the daemon in a Debian Package Jun 29, 2022
@brian-pond brian-pond added the enhancement New feature or request label Jun 29, 2022
@brian-pond
Copy link
Contributor Author

Update

  • The CLI application is now successfully packaged into a Debian .dpkg 🎉

The scheduler daemon is trickier, because I have to handle:

  1. Creating the directory for the configuration.
  2. Creating a default configuration file.
  3. Creating a Systemd Unit file for automatic startup.

But the hard part is done, thanks to cargo-deb (https://crates.io/crates/cargo-deb, https://github.com/kornelski/cargo-deb#readme)

@brian-pond
Copy link
Contributor Author

brian-pond commented Sep 25, 2022

Update

  • Both CLI and background daemon are now bundled in the Debian package (.dpkg)

However. GitHub only offers "runners" for Ubuntu 20.04 and 22.04. They do -not- offer runners for other Linux such as Debian. Although Ubuntu is derived from Debian, that does not guarantee they share the same GLIBC libraries. Matter of fact, at least in 1 test, I found them to be different. Because my Rust binaries are dynamically linked to C libraries, I need to create the correct binary, per GLIBC.

So. Automatic deployment for Ubuntu is now easy.

Automatic deployment for <other_Linux> is harder. Next, I need to learn about GitHub's so-called Self-Hosted Runners.. With those, I -should- be able to automatically deploy Debian Buster and Bullseye binaries and packages automatically...

@bkm888
Copy link

bkm888 commented Sep 25, 2022 via email

@brian-pond
Copy link
Contributor Author

brian-pond commented Sep 25, 2022

Debian package is successfully writing the binaries to /usr/bin.

Next, need to run some Post Installation commands:

  1. Create the /etc/btu_scheduler directory.
  2. Add a default TOML configuration file to that directory.
  3. Create the Systemd Unit Files for automatic startup.

This should be possible by writing shell script in a "postinst" file in the "/debian" folder. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants