-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
minio: declarative creation of buckets/groups/policies/users (#89559) #164235
base: master
Are you sure you want to change the base?
Conversation
Oh no... more |
@aanderse Hm, you might be right on that. The solution is not really declarative, do you have any proposal on how we could have s3 stuff like buckets, policies and users scripted in minio with nix? I have looked at the config files that get generated when you create these entities via the GUI, but I'm not sure how to create those from nix directly. |
While I agree with you, I feel like this should be end-user responsibility to choose or not, this compromise. Bootstrapping many MinIO resources is very annoying and require to use their ugly GUI, I am very interested into having something like this. |
@RaitoBezarius it sounds like you're looking for a solution more like terraform, not NixOS... The two can go well together. Let's not mix them up. |
While it's true that Terraform providers or NixOps providers might do a better job at this, there is no reason we cannot have weaker solutions in NixOS as we already have The only reason for why I would say this PR would be a bad idea is, if it rots and never get maintained, breaking things at some point. |
Terraform, by design, manages state. NixOS, by design, does not. "might" was the wrong choice of wording.
Which I authored and deeply regret. There are a ton of problems with the
I'll continue my point above about the I'll summarize my position by quoting myself from above:
That being said... we're both members of the community and respect each other's decisions and positions. I have stated my case and would be happy to discuss further if you think there would be value in that. If not I will at least feel satisfied that I made the argument against when someone hits the merge button. Thanks for hearing me out ❤️ |
Well, I disagree because you can clearly manage state using NixOS, e.g. by managing in-tree of your NixOS configuration as simple files. Nevertheless, this situation is not necessarily one that will never change, and I do think there is a need for a spectrum of solutions, even if they are less than desirable and introduces a lot of caveats. Tools are always abused by their end-users and (system) designers have to take this possibility in account, therefore, I am not surprised to offer escape hatches. But, this bring me to my next point.
I definitely see how Therefore, as long as we can get the ~same level of reliability for a new option, I would not say "no" to another attempt. Of course, at some point, this proliferation of But there is a long way until upstream software will support this and a lot of people including me cannot buy into Terraform-like things for many other reliability reasons and KISS principles (and I say this as someone who started a NixOps backend and was bummed by the difficulty of maintaining the world's view in sync with my Nix expression view).
That's true and understandable, but in that case, I think we have a dire need to introduce a clear-cut separation between "well behaved NixOS machines" and "clunky NixOS machines that could be well behaved as long as this anti feature X is not broken" and let people adopt their compromise and propagate it through the whole NixOS module. But I do agree I would like to keep these features to their bare minimum and necessary and on a very specific perimeter to avoid having them growing uncontrollably.
Thank you for clarifying and having this discussion! :) I hope we did not annoy @pinpox too much, though. Apologies for this meta discussion. My proposal would be the following: we should discuss more of this in another place, it could be RFC or it could be an issue in nixpkgs architecture team, etc. I think I will ask for more members of the community to weigh in on that. I do have an usecase for this PR and would really love to get it, but I get your points. |
Sounds good. Thanks so much @RaitoBezarius! |
Question regarding this meta-discussion about state: Where does "configuration" end and "state" start? I'm having trouble pinpointing the difference between a S3 bucket that is declaratively configured to "be there" as part of a setup and something like e.g. a virtual host in nginx, which is considered part of the configuration. Staying with minio as an example, would you consider a policy to be state or configuration? It could be defined in a json configuration document and generated from nix code. While I haven't seen a way to do this for buckets, where is the difference? |
Unfortunately some applications don't differentiate between state and configuration. Some applications use configuration to initially define state. Not always easy to reconcile this with
For the purpose of this conversation let's ask a simple questions for each scenario: Can your S3 bucket or virtual host ever deviate from what is described in |
The virtual host can not. The S3 bucket (currently) can. But that is exactly what I'm trying to change: I would like the buckets to be in an inmutable, declared state. Of course the content should be mutable, but the bucket itself should not. |
The bucket will remain mutable, though. Since you use imperative commands to create buckets this implies that you can later issue more commands imperatively to undo/alter these buckets and make your configuration deviate from reality. It boils down to |
Right, so the idea is that some piece of state (the set of buckets that exist) is managed declaratively, while another part (the content of the buckets) is not. That by itself is not a problem, it's how all of NixOS works. What makes this tricky in this case is that the dynamic part of the state depends on the static part of the state. We need to ask: What should NixOS, when applying a configuration, do if it finds a bucket that's not declared.
FWIW, I don't think that this is a blocker for this PR. As others have noted, |
Description of changes
I'd like to add the functionality as requested in #89559 to allow creating buckets, groups, users and policies declaratively in minio. The units added are based on the work of @expipiplus1 and @JosephLucas.
Pinging @bachp and @hamishmack for review and test. I'm going to need help testing and implementing this, let me know where to start and what is still missing. There might be more elegant ways of doing this.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes