-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add environment variable for config file path #134
Comments
This is a good idea, but there is already a way to set your default configuration by using Is there any reason you would prefer the environment variable over using this command? |
Ah! I guess I wouldn't want an interactive command to manage my config values in a production environment, where configuration is usually immutable and read-only? Digging into this I discovered that I could use |
Perhaps Flintrock should take a cue from Another thing we could do is alter the behavior of Could you share more details on your workflow? It would be helpful to understand how you use Flintrock so I can see the bigger picture.
Could you elaborate on what you mean here? |
Of course! I plan to use flintrock exclusively from a Docker container, with a mostly read-only filesystem. That makes using I'd also want to be able to manage multiple types of clusters at once (different instance types & number of slaves). So my "ideal" workflow would be:
|
Hmm, OK. Here's what I would recommend: Since you know where Flintrock is going to place the config file (and you control the environment), you can copy your config there directly and get your defaults in place.
Regarding this point, and your earlier remark about needing multiple config files for multiple clusters, I would say that -- normally -- you wouldn't want to use Flintrock that way. Your config file should capture the environment you will most commonly work in, but Flintrock allows you to override specific entries at the command-line. This was designed as such with the intention that most users would have a fixed key, region, etc. they wanted to work in, but would occasionally want to change things like the instance type or number of slaves for a specific launch invocation. So, for example:
This would load all your configs from disk but override only the instance type with Unless you are working in several completely different environments where everything about them is different, and you don't want to have to pass all those differing configs at the command line, you should only need one config file. Does that make sense? |
I agree it makes sense to have some settings in a "global" file. However let's consider the case where one has 2 clusters with different specs (number of slaves, instance types, region, ..) to be used in parallel. I don't think that's a unheard-of case (for me, it's a high-CPU cluster and high-memory one). I want to keep their configurations somewhere, and the more command-line flags there are, the more painful flintrock is to use. So my solution for this workflow would be to open 2 shells and set a different config env var in each one. But it might not be the simplest solution, or you can also consider this to be beyond flintrock's scope (though I would find that unfortunate!) thanks, |
I'm going to let this issue sit for some time and marinate. There are a few libraries and standards for selecting default locations for things like config files, and if we're going to add a new Flintrock-specific environment variable we need to make sure it plays nicely with those standards. As mentioned earlier, Flintrock already follows the XDG base spec on Linux (via Click), which means that you can set # Linux
export XDG_CONFIG_HOME=/folder/that/contains/ #Flintrock/
flintrock launch ... Give that a shot. It may be enough for you to get by for now. |
I'm also interested in this issue. My use case: I want to version control my I think my current solution will be to symlink my config into the default location -> this is working fine for now. An environment variable would also solve my use case. |
I have tried yaml editor: http://www.yamllint.com/it said, ready to go. but once I launch it, receiving error like this:** |
@Fazish - It looks like you're reporting a new issue. Please open a new issue instead of commenting on an existing one. Also, I recommend you a) delete any existing Flintrock installation you have, b) delete any existing config files you have, c) reinstall Flintrock, and d) recreate your config file using If you still have issues, please report them in a new issue. |
@nchammas -Thanks a million. I will try to renew them all. in the case facing the same error. |
I'd also like to "thumbs up" this issue. My situation is that I use flintrock with multiple different AWS accounts in multiple different regions, and this means that the AMI's, VPC's, subnets, security groups, instance profiles, tags, etc. are all different. This has implications on more than just the (A related problem, which maybe should be a separate issue, is that it would be super helpful to support a Thank you for building this tool - it has been a huge help! |
For users with a non-standard config file path, it would be great to be able to set an environment variable like
FLINTROCK_CONFIG_PATH
to avoid prepending every command with--config ...
.The text was updated successfully, but these errors were encountered: