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

woodpecker-{agent,cli,server}: init at 0.15.3 #178441

Merged
merged 4 commits into from
Jun 24, 2022

Conversation

ambroisie
Copy link
Contributor

@ambroisie ambroisie commented Jun 21, 2022

Description of changes

Supersedes #169470.
Closes #178332.

Some notes :

  • We probably want to prefix the different binaries with woodpecker-, instead of just cli, agent, and server.
  • Address/remove the FIXME about musl.
  • Perhaps add an update script.
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@wyndon
Copy link
Contributor

wyndon commented Jun 21, 2022

Do you plan to add a module?

@ambroisie
Copy link
Contributor Author

Do you plan to add a module?

I plan on migrating my own configuration from Drone to Woodpecker, if nothing breaks in that process.

I don't think I'll be adding a module (in this MR at least), mostly because one might want to have multiple instances of the agent running at once on the same machine (which is not supported very well by the module system), e.g: a docker backend and an exec backend.

@ambroisie
Copy link
Contributor Author

Not sure why ofborg is unhappy about (what seems to be) the mkYarnPackage derivation.

@ambroisie ambroisie marked this pull request as ready for review June 21, 2022 14:14
@06kellyjac
Copy link
Member

it's because yarn2nix is reading the package json into eval, so it's a build output -> eval aka IFD

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix#L176

you'll want to copy the package json over into the repo. or I can see about removing the IFD issues

@ambroisie
Copy link
Contributor Author

@06kellyjac I would rather not copy the package.json file since upstream is doing everything correctly, and it would just be one more hurdle when updating the package.

My wondering is more along the lines of why other packages that make use of mkYarnPackage either don't have that issue with ofborg, or if they do then why hasn't it been fixed/changed?

@06kellyjac
Copy link
Member

they all just copy in package.json, its a simple wget or curl in the update script. Again I'll see if I can tweak yarn2nix to stop the IFD issues when I get some time


I made some changes e243a8c

  • adds prefixes to bins
  • removes the need for libexec/xyz etc by just keeping the dist folder
    • before: λ du -h -d 0 ./result/ -> 359M
    • after: λ du -h -d 0 ./result/ -> 664K
  • seperate the frontend to its own input, this is important so people can fix it if it breaks like jellyfin and all other node stuff did recently jellyfin-web does not build on master #176288
  • drop the extra static stuff, it seems to cause more issues than it solves, we don't need to exactly copy the upstream builds
    • LMK if this resolves the glibc musl stuff, not sure what the actual issue was in order to test it

server started and ui shows fine but that's all I did:

WOODPECKER_GITHUB=true ./result/bin/woodpecker-server --server-host http://192.168.0.111

image

@ambroisie
Copy link
Contributor Author

@06kellyjac I think we should only keep the front-end as a passthru attribute, I don't think it makes much sense to have it as an actual package in nixpkgs but it would still allow overriding thusly (approximately? not tested):

self: super:
{
  woodpecker-server = super.woodpecker-server.override {
    woodpecker-frontend = super.woodpecker-server.passthru.woodpecker-frontend.override {
      # Override here
    };
  };
}

Copy link
Member

@06kellyjac 06kellyjac left a comment

Choose a reason for hiding this comment

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

I'm not super familiar with passthru but yeah since it's an input to server you could replace it with anything, in this case an overriden frontend grabbed from passthru

so yeah that looks fine


As for the remaining eval/IFD issues I think it's because you need to set offlineCache or it just does it magically with IFD stuff

@ambroisie
Copy link
Contributor Author

Pushed some fixups (which will need to be rebased/squashed).

@wyndon
Copy link
Contributor

wyndon commented Jun 22, 2022

Result of nixpkgs-review pr 178441 run on x86_64-linux 1

3 packages built:
  • woodpecker-agent
  • woodpecker-cli
  • woodpecker-server

@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/531

06kellyjac and others added 3 commits June 24, 2022 14:43
* Use 'callPackage' to import 'common.nix'.
* Prefix the binaries with 'woodpecker-', removing the need for
  'meta.mainProgram'.
* Remove IFD in 'mkYarnPackage' by committing 'package.json'.
* Simplify the server derivation, by not building it statically.
* Expose 'woodpecker-frontend' as a package for overriding purposes.
* Reduce package size for 'woodpecker-frontend' by just keeping the 'dist'
  folder.
* Have common `ldflags` and `postBuild` values.
@SuperSandro2000 SuperSandro2000 merged commit 32aa830 into NixOS:master Jun 24, 2022
@wyndon wyndon mentioned this pull request Jun 24, 2022
13 tasks
@devusb devusb mentioned this pull request Aug 23, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Woodpecker CI server, runner, and CLI
6 participants