flock not a dependency #29

Closed
opened 2022-10-26 18:11:31 +00:00 by quinn-dougherty · 2 comments
quinn-dougherty commented 2022-10-26 18:11:31 +00:00 (Migrated from github.com)

I'm deploying my herc agent on digital ocean from itself, with a herc effect.

bug from logs

🚀 Deploying nixosConfigurations.herc-agent from /nix/store/dxbvs58xw7c7pzjq9xdgnj59d1a49nib-source
👤 SSH User: root
🌐 SSH Host: 142.93.190.80
🔨 Building system closure locally, copying it to remote store and activating it:
+++ NIX_SSHOPTS=-t
+++ flock -w 60 /dev/shm/nixinate-herc-agent -c '/nix/store/z7pwpz0fkdcnqhypmjqrqpj11m9ny8pc-nixos-rebuild/bin/nixos-rebuild  switch --flake /nix/store/dxbvs58xw7c7pzjq9xdgnj59d1a49nib-source#herc-agent --target-host root@142.93.190.80 --use-remote-sudo -s'
/nix/store/4k148qpmy1b9xck6v4dah417k6w22p25-deploy-herc-agent.sh: line 6: flock: command not found

See my effect/default.nix at the relevant commit

It would be nice if flock was made explicit. I do not currently have a workaround. In the commit after the one I linked above, I tried to put flock in environment.systemPackages, which also did not work.

Btw, my agent says it has a flock, so maybe this is on the herc agent codebase...

[herc-admin@herc-agent:~]$ which flock
/run/current-system/sw/bin/flock

Edit, workaround

with agent.pkgs;
effects.runIf (ref == "refs/heads/main") (effects.mkEffect {
  effectScript = ''
    mkdir -p flockpath
    cp ${util-linux}/bin/flock flockpath/flock
    export PATH=$PATH:flockpath
    ${nixination.${agent.hostname}.program}
  '';
I'm deploying my herc agent on digital ocean from itself, with a herc effect. [bug from logs](https://hercules-ci.com/github/quinn-dougherty/configuration.nix/jobs/410/effects/effects.deployment.run/log) ``` 🚀 Deploying nixosConfigurations.herc-agent from /nix/store/dxbvs58xw7c7pzjq9xdgnj59d1a49nib-source 👤 SSH User: root 🌐 SSH Host: 142.93.190.80 🔨 Building system closure locally, copying it to remote store and activating it: +++ NIX_SSHOPTS=-t +++ flock -w 60 /dev/shm/nixinate-herc-agent -c '/nix/store/z7pwpz0fkdcnqhypmjqrqpj11m9ny8pc-nixos-rebuild/bin/nixos-rebuild switch --flake /nix/store/dxbvs58xw7c7pzjq9xdgnj59d1a49nib-source#herc-agent --target-host root@142.93.190.80 --use-remote-sudo -s' /nix/store/4k148qpmy1b9xck6v4dah417k6w22p25-deploy-herc-agent.sh: line 6: flock: command not found ``` See my [`effect/default.nix`](https://github.com/quinn-dougherty/configuration.nix/blob/22b708c643d5f190ce2cddce73b1aa5d71e0b06b/agent/effect/default.nix) at the relevant commit It would be nice if `flock` was made explicit. I do not currently have a workaround. In the commit after the one I linked above, I tried to put `flock` in `environment.systemPackages`, which also did not work. Btw, my agent says it has a `flock`, so maybe this is on the herc agent codebase... ``` [herc-admin@herc-agent:~]$ which flock /run/current-system/sw/bin/flock ``` ## Edit, workaround ```nix with agent.pkgs; effects.runIf (ref == "refs/heads/main") (effects.mkEffect { effectScript = '' mkdir -p flockpath cp ${util-linux}/bin/flock flockpath/flock export PATH=$PATH:flockpath ${nixination.${agent.hostname}.program} ''; ```
quinn-dougherty commented 2022-10-26 22:00:08 +00:00 (Migrated from github.com)

Thanks a ton! (for the record, ssh was the same deal and I'm doing the same workaround)

Thanks a ton! (for the record, `ssh` was the same deal and I'm doing the same workaround)
MatthewCroughan commented 2022-10-26 22:02:10 +00:00 (Migrated from github.com)

Ah of course.. I need to generally fix the structure of Nixinate to be more proper anyway, I will sort this out as soon as I get a moment to myself.

Ah of course.. I need to generally fix the structure of Nixinate to be more proper anyway, I will sort this out as soon as I get a moment to myself.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tristan/nixinate#29
No description provided.