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

pds: init at 0.4.74, nixos/pds: init #350645

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

t4ccer
Copy link
Member

@t4ccer t4ccer commented Oct 23, 2024

Things done

Self hosted server for https://bsky.social/

Closes #357466

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Oct 23, 2024
@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from f315d95 to 6afa70f Compare October 23, 2024 06:02
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 labels Oct 23, 2024
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Oct 24, 2024
@pyrox0
Copy link
Member

pyrox0 commented Oct 27, 2024

Upstream uses PNPM, why not use the existing PNPM tooling to generate the package? That means then there's no need to store an additional lockfile in-tree.

See https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm for how to use nixpkgs' pnpm tooling.

Edit: I see your comment. Let me see if I can improve that for the pnpm tooling.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4786

@soopyc
Copy link
Member

soopyc commented Nov 1, 2024

Upstream has updated to 0.4.67, you might want to consider updating.

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 6afa70f to 0b35498 Compare November 1, 2024 15:49
@t4ccer t4ccer changed the title pds: init at 0.4.59, nixos/pds: init pds: init at 0.4.67, nixos/pds: init Nov 1, 2024
Copy link
Contributor

@BatteredBunny BatteredBunny left a comment

Choose a reason for hiding this comment

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

Small changes

nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pds/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pds/package.nix Show resolved Hide resolved
@BatteredBunny
Copy link
Contributor

Managed to successfully deploy it to my server :)
Had to modify the pdsadmin scripts though https://github.com/BatteredBunny/pds

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 0b35498 to 4065add Compare November 1, 2024 18:28
@t4ccer
Copy link
Member Author

t4ccer commented Nov 1, 2024

Yeah, I didn't bother packaging the admin scripts because the main one just fetches scripts for subcommands and they all have wrong shebang. Probably upstream should be fixed to use /usr/bin/env bash

Edit: opened a PR upstream bluesky-social/pds#121

@pyrox0
Copy link
Member

pyrox0 commented Nov 7, 2024

Yeah, I didn't bother packaging the admin scripts because the main one just fetches scripts for subcommands and they all have wrong shebang. Probably upstream should be fixed to use /usr/bin/env bash

Edit: opened a PR upstream bluesky-social/pds#121

You should also be able to run the patchShebangs script on the scripts. Does that work?

Copy link
Member

@pyrox0 pyrox0 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 on the service, found a few nits though

nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
@pyrox0
Copy link
Member

pyrox0 commented Nov 7, 2024

Also, having looked into the sharp issue, I believe it's an issue with sharp being version 0.32.x, not 0.33.x, where there are now prebuilt binaries available. I'm looking into submitting a patch upstream to update this dependency

Edit: bluesky-social/atproto#2958

@t4ccer
Copy link
Member Author

t4ccer commented Nov 7, 2024

You should also be able to run the patchShebangs script on the scripts. Does that work?

Not really. It'll fix the main script but all it's doing is download subsequent ones that will still fail because they're not patched https://github.com/bluesky-social/pds/blob/main/pdsadmin.sh#L22-L30

Other way would be to patch the main script to use store path instead of downloading it but I wasn't sure if that's not too much change. But maybe that's a good idea to keep them locked to pds version

@pyrox0
Copy link
Member

pyrox0 commented Nov 7, 2024

You should also be able to run the patchShebangs script on the scripts. Does that work?

Not really. It'll fix the main script but all it's doing is download subsequent ones that will still fail because they're not patched bluesky-social/pds@main/pdsadmin.sh#L22-L30

Other way would be to patch the main script to use store path instead of downloading it but I wasn't sure if that's not too much change. But maybe that's a good idea to keep them locked to pds version

yeah I'd say vendor the scripts, you could even make a new pdsadmin script in-tree and replace the one in the repo with it if you want. Removing what's essentially curl | bash is a great idea in my book. Them being in the nix store is fine, since if you look at the history for the scripts folder, they're not really touched much.

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch 3 times, most recently from ac7f4dc to 2d67d86 Compare November 8, 2024 04:40
@t4ccer t4ccer marked this pull request as draft November 8, 2024 04:46
@t4ccer
Copy link
Member Author

t4ccer commented Nov 8, 2024

Hm ExecStart = getExe cfg.package; doesn't seem to work? I get

(pds)[1989597]: pds.service: Failed to execute /nix/store/w25c005jjb98frrvhd7bkwjqmnlrjg96-pds-0.4.67/bin/pds: Exec format error
(pds)[1989597]: pds.service: Failed at step EXEC spawning /nix/store/w25c005jjb98frrvhd7bkwjqmnlrjg96-pds-0.4.67/bin/pds: Exec format error

on my server

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch 2 times, most recently from 913a3a8 to 8cabcfb Compare November 8, 2024 04:53
@t4ccer t4ccer changed the title pds: init at 0.4.67, nixos/pds: init pds: init at 0.4.74, nixos/pds: init Dec 9, 2024
@t4ccer
Copy link
Member Author

t4ccer commented Dec 9, 2024

We should be fine to merge now, bumped to 0.4.74 and use pnpm.fetchDeps, dropped custom lock file

@t4ccer
Copy link
Member Author

t4ccer commented Dec 9, 2024

I guess release notes should go to 25.05 now though, how do I rebase without causing a mass ping?
Edit: thanks to #348642 apparently you just do it 🎉

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from cc12960 to bf43938 Compare December 9, 2024 01:30
@lucasew
Copy link
Contributor

lucasew commented Dec 9, 2024

@lucasew
Copy link
Contributor

lucasew commented Dec 9, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 350645


x86_64-linux

✅ 1 test built:
  • nixosTests.pds

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from bf43938 to b7516fe Compare December 13, 2024 01:53
@lucasew
Copy link
Contributor

lucasew commented Dec 17, 2024

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from b7516fe to a9dd238 Compare December 19, 2024 11:20
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/2158

pkgs/by-name/pd/pds/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/pd/pds/package.nix Outdated Show resolved Hide resolved
nixos/tests/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
Comment on lines +27 to +28
DUMMY_PDS_ENV_FILE="$(mktemp)"
trap 'rm -f "$DUMMY_PDS_ENV_FILE"' EXIT
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need a temporary file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Cause the script tries to source it and it almost always does not exist (the default is /pds/pds.env which looks docker-ish) but even if it does we still want to use our variables instead
https://github.com/bluesky-social/pds/blob/main/pdsadmin/account.sh#L6-L7

nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/pds.nix Outdated Show resolved Hide resolved
@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch 3 times, most recently from 1387952 to 3ff967c Compare December 30, 2024 19:54
@lucasew
Copy link
Contributor

lucasew commented Dec 30, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 350645


x86_64-linux

✅ 1 test built:
  • nixosTests.pds
✅ 2 packages built:
  • pds
  • pdsadmin

@t4ccer
Copy link
Member Author

t4ccer commented Dec 30, 2024

The branch this PR will merge in to does not cleanly evaluate, and so this PR cannot be checked.

I don't even have the Details button, how do I debug that?

@t4ccer
Copy link
Member Author

t4ccer commented Dec 30, 2024

@ofborg eval

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 3ff967c to 9e2f53f Compare December 30, 2024 20:56
@lucasew
Copy link
Contributor

lucasew commented Dec 30, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 350645


x86_64-linux

✅ 1 test built:
  • nixosTests.pds
✅ 2 packages built:
  • pds
  • pdsadmin

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: pds (Bluesky Personal Data Server)