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
ipfs: initialConfig option + fixes #43089
Conversation
@GrahamcOfBorg test ipfs |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: tests.ipfs Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: tests.ipfs Partial log (click to expand)
|
/cc @seppeljordan |
(path: value: | ||
(mapAttrsRecursiveCond (value: ! value ? _type) | ||
(path: value: let | ||
value' = if value ? _type then value.content else value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this suddenly needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attrsets in configuration.nix evaluate to these kind of attrset wrappers (for purposes of handling mkOverride
IIUC), rather than the attrsets literally provided. I had not sufficiently tested using attrsets as values, so I only recently found this change was necessary for proper marshalling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get it, can you add a comment explaining this with an example of what wouldn't work without it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
services.ipfs.extraConfig.Swarm.AddrFilters = [];
wouldn't work right now in master, because the attrset Swarm
is not flattened into a simple attrset at the time the recursive map is evaluated. I can't explain why, because I don't understand it myself. I only know that the attrset I'm expecting is in .contents
whenever .type
is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't reproduce, with or without this change, the mentioned setting works without problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update on this?
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.ipfsMountDir} | ||
install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.ipnsMountDir} | ||
# XXX Sometimes, the daemon stops or crashes without unmounting. | ||
umount -l "${cfg.ipfsMountDir}" || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a lazy unmount?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If some process has an open handle in there, I don't want that to prevent a remount. This is a FUSE virtual FS, anyway, so I can't imagine how any harm could result from this.
Any updates on this pull request, please? |
78fc0c3
to
83aa7da
Compare
I've combined the original initialConfig featrue with a few other fixes. This is ready to be reviewed again. |
umount -l "${cfg.ipnsMountDir}" || true | ||
install -m 0755 -o "${cfg.user}" -g "${cfg.group}" -d "${cfg.ipfsMountDir}" | ||
install -m 0755 -o "${cfg.user}" -g "${cfg.group}" -d "${cfg.ipnsMountDir}" | ||
>>>>>>> 03a4ab9399b... ipfs: initialConfig option + fixes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge artifact
@elitak can we please have this rebase with the fix? |
We want to land https://github.com/NixOS/nixpkgs/pull/90157/files, either with a fix, or a fix right after. |
Huh? This doesn't fix anything crucial. I can rebase it later. Not sure what the hangup was over this PR; I opened it almost 2 years ago... |
fix: include wrapped binary in system PATH fix: init service now attempts to umount mountpoints fix: properly evaluate overridden extraConfig options.
Oh, I meant that I wasn't gonna rebase this myself. But fine if you do, we can |
@@ -192,6 +207,20 @@ in { | |||
default = true; | |||
}; | |||
|
|||
initialConfig = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is initialConfig needed when extraConfig is also available?
serviceConfig.User = cfg.user; | ||
serviceConfig.Group = cfg.group; | ||
}; | ||
|
||
baseService = recursiveUpdate commonEnv { | ||
wants = [ "ipfs-init.service" ]; | ||
# NB: migration must be performed prior to pre-start, else we get the failure message! | ||
preStart = optionalString cfg.autoMount '' | ||
preStart = '' | ||
install -m 0755 -o "${cfg.user}" -g "${cfg.group}" -d "${cfg.dataDir}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still needed in ipfs 0.5.1? ideally we would get some more diagnostics and report this as a bug
There is no wrapped binary, and I think the other 3 things would be better to configure separately. We have two bugs that cannot be reproduced, and |
I marked this as stale due to inactivity. → More info |
I think we've taken everything we should from this. |
added initialConfig option
fix: include wrapped binary in system PATH
fix: init service now attempts to umount mountpoints
fix: properly evaluate overridden extraConfig options.
Motivation for this change
fixes #42672
Addresses #82580 and ipfs/kubo#4214 (#29133 (comment))
initialConfig option is useful for fresh deployments via nixops etc.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)