-
Notifications
You must be signed in to change notification settings - Fork 76
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
democratic-csi plugin #113
Conversation
25310c3
to
85035ba
Compare
app { | ||
url = "https://github.com/democratic-csi/democratic-csi" | ||
author = "Tim Gross <tgross@hashicorp.com>" | ||
} |
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.
@mikenomitch @angrycub something I noticed here is that we're conflating app.author
and a hypothetical pack.maintainer
metadata field. Most package managers have a distinction between the two because they're rarely the same person. Ex. redis on Debian Buster is maintained by Chris Lamb, who is not the author of Redis (antirez or Redis Labs).
We also don't include as a requirement any kind of contact info for the pack maintainer. Maybe we don't need it as required metadata for all registries but as a requirement for this registry, so that we have someone to ping as the codeowner. (Also maybe not an email address but a GitHub handle here?)
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.
Yeah, this was originally the author of the underlying app itself (not the pack). But about 40% of PRs get this "wrong" and do pack author. IDK what value its really providing as author of the underlying app.
Git/GitHub will naturally point us to the maintainer (in a roundabout way), so I'm not sure we really even need it for that purpose.
Maybe its something we should just remove?
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.
But about 40% of PRs get this "wrong" and do pack author.
Most likely because that's what Writing Packs recommends. Seems reasonable to me to remove it. I'll fix up the docs as well.
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.
Oh wow! Maybe I'm "wrong" then 🙃
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've opened hashicorp/nomad-pack#240 to update the docs and/or discuss it more generally.
pack { | ||
name = "democratic_csi_nfs" | ||
description = "This pack deploys the democratic-csi plugin, configured for use with NFS" | ||
url = "https://github.com/hashicorp/nomad-pack-community-registry/democratic_csi_nfs" |
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.
The docs on this url
field are a little vague. It's not really the URL to the directory, right?
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.
It's not really the URL to the directory, right?
It is... but @angrycub and I want to remove it and just make this implicit when they grab the registry itself. Because once you fork a registry, all of these are wrong.
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 more meant that our docs say to use a URL like https://github.com/hashicorp/nomad-pack-community-registry/nginx but the actual URL to the pack directory is https://github.com/hashicorp/nomad-pack-community-registry/tree/main/packs/nginx
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've opened hashicorp/nomad-pack#240 to update the docs and/or discuss it more generally.
780c33a
to
656cbb0
Compare
need to have a source NFS volume mounted to any client host that runs | ||
the controller task. | ||
|
||
### Example NFS Server |
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.
The democratic-csi
plugin supports a lot of different NFS and ZFS setups. I'm not sure if we want to try to support arbitrary configurations in this one pack. It'd be awfully nice, but the client requirements end up being a chore to document (and not feasible for us to test, where this one is pretty simple). Open to suggestion here though for sure.
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 we did want to support a broader range of configs, we'd want to have something more like a blob or object for the config file (ref #113 (comment))
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 think there are ways we could handle both using the sprig fail
function in the template.
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.
Because it's very hard to test without buying an appropriate NAS appliance, I'm going to leave this as-is for now and if someone comes along later and wants to improve upon it they can.
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.
My point in the earlier comment is that you could provide variables to ingest a shapely configuration for something that is easily testable, but allow for a blob in cases where we don't have the ability to know the configuration in advance. Then it would be up to the template to fail if neither way was provided by the user at runtime. If they're bringing a custom config, then they will have to ensure that they are doing the right thing.
(I've tagged @davemay99 on this review because I'd like to use packs like this to help document CSI configurations and want to know his thoughts on what's in the README here. I'll have more packs coming for AWS EBS, GCP, etc.) |
|
||
## Variables | ||
|
||
The following variables are required: |
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 there a way to express this requirement in our variables.hcl
? There aren't really reasonable defaults for these values here.
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.
No way to do this :(
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 you don't default them, they should end up being required? If they aren't this seems like a bug. (It's inconsistent with my experience with Nomad's HCL2, that is)
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.
No, unfortunately. For example if I render this pack with no variables set I end up with a partially empty template:
template {
destination = "${NOMAD_TASK_DIR}/driver-config-file.yaml"
data = <<EOH
driver: nfs-client
instance_id:
nfs:
shareHost:
shareBasePath: ""
controllerBasePath: "/storage"
dirPermissionsMode: "0777"
dirPermissionsUser: root
dirPermissionsGroup: root
EOH
}
For Nomad fields, this usually up throwing an error when we try to submit the job because Nomad will reject it. But for something like the interior of a template, Nomad has no way of knowing whether the field is valid.
656cbb0
to
f5508a5
Compare
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.
One suggestion on template. Haven't run locally though yet
389facc
to
2c77235
Compare
This looks great, why hasn't it been merged so far? |
Hi @Brandl! While working on and reviewing this pack we hit a couple of "is this really the way we want to do this in Pack?" questions and we just haven't had time to come back. |
A pack for deploying
democratic-csi
CSI plugins in their NFS client mode. I've left a few questions too.Example runs in my Vagrant environment:
plan output
run output