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

Cross-compile arm releases & include insert-user in release #291

Closed
wants to merge 5 commits into from

Conversation

ahdinosaur
Copy link

hi, i'm keen for go-ssb-room on a Raspberry Pi. 🥧

so i improved the release dev tools, using Vagrant (a friendly wrapper around VirtualBox).

open to feedback! 💜

related:

also now i see #266 and #241, happy to incorporate other changes as need be, could also cross-compile armel and armhf if need be.

@ahdinosaur ahdinosaur force-pushed the feature/cross-builds branch from 22ea114 to 6d88458 Compare January 10, 2022 10:15
@ahdinosaur ahdinosaur changed the title WIP: cross-compile arm64 releases WIP: cross-compile arm releases Jan 10, 2022
turns out even Raspberry Pi 1 supports armhf, also Raspbian packages are all armhf.

refs:

- rclone/rclone#5107 (comment)
@ahdinosaur ahdinosaur changed the title WIP: cross-compile arm releases cross-compile arm releases Jan 10, 2022
@ahdinosaur
Copy link
Author

this is ready for review! 🍰

here's some compiled releases: https://github.com/ahdinosaur/go-ssb-room/releases/tag/v2.1.0-pre.1

/cc @mhfowler

# create a user to run the server as
adduser --system --home /var/lib/go-ssb-room go-ssb-room
chown go-ssb-room /var/lib/go-ssb-room

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
Copy link
Author

Choose a reason for hiding this comment

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

i stole these systemd script things from peachcloud/peach-package-builder who stole them from mmstick/cargo-deb 📦

Copy link
Author

@ahdinosaur ahdinosaur Jan 10, 2022

Choose a reason for hiding this comment

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

however, they do change things such that the service starts automatically when installed (and is enabled to start on boot), as this is the usual behavior on Debian. if we follow this behavior, we should update the postinstall message to tell you to restart the service rather than reload daemon after making changes.

would there be a problem with the service first running with the wrong config, then changing it and restarting the service?

as a side note, we shouldn't be recommending updating services by writing to the systemd file directly, there's a whole built-in edit workflow with conf overrides and such that we should be doing: https://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services.

Copy link
Member

@decentral1se decentral1se Nov 9, 2022

Choose a reason for hiding this comment

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

would there be a problem with the service first running with the wrong config, then changing it and restarting the service?

According to:

Before you start using room server via the systemd service, you need to at least change the https domain in the systemd service.

The startup will fail? Maybe we can avoid automatically starting up & recommend the commands? Unsure what Debian does when installed packages need to be configured first? Or perhaps there is a standard way to ask for input here and then sed'in the relevant files / updating templated files? Just throwing out some options...

as a side note, we shouldn't be recommending updating services by writing to the systemd file directly, there's a whole built-in edit workflow with conf overrides and such that we should be doing: https://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services.

One for the docs I guess, can do here or let's open an issue to catch that another time?

Copy link
Member

@decentral1se decentral1se left a comment

Choose a reason for hiding this comment

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

Nice work! I'm curious if it is possible to avoid the vagrant/vm requirement and instead use Docker? As far as I understand, you're using a Debian image & running a series of build commands which could be done with Docker?

@ahdinosaur
Copy link
Author

I'm curious if it is possible to avoid the vagrant/vm requirement and instead use Docker? As far as I understand, you're using a Debian image & running a series of build commands which could be done with Docker?

🤷

i usually use Docker, but here i used Vagrant and had a lovely time. 😺

@decentral1se decentral1se mentioned this pull request Nov 8, 2022
@decentral1se
Copy link
Member

decentral1se commented Nov 9, 2022

@ahdinosaur

Thanks for this PR. I'd love to get it out in the near future and am doing a review now.

I think the current change set needs a rebase, sorry for letting it sit for so long.

i usually use Docker, but here i used Vagrant

Would you be up for using Docker instead? I think I'd love to avoid having to work with Vagrant going forward because it assumes a workstation that has virtualisation wired up and sometimes that is a bit tricky / can be a barrier to working on this. We could wire up a Debian-based Dockerfile and acommpanying commands instead? I could do that or if you feel like it, please go for it.

@decentral1se decentral1se changed the title cross-compile arm releases Cross-compile arm releases & include insert-user in release Nov 9, 2022
@ahdinosaur
Copy link
Author

@decentral1se great, i'm happy for you to continue from where i left off, i'll be here on the sidelines if you need me. 😺

decentral1se added a commit to decentral1se/go-ssb-room that referenced this pull request Nov 11, 2022
All credit goes to @ahdinosaur for this work.

Follows ssbc#291.
@decentral1se
Copy link
Member

Cut a trimmed version of this in #355. Opened #354 also.

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