-
Notifications
You must be signed in to change notification settings - Fork 33
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
Quiet flag for uninterrupted single cluster run of quickstart script #744
Quiet flag for uninterrupted single cluster run of quickstart script #744
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #744 +/- ##
==========================================
+ Coverage 80.20% 82.95% +2.74%
==========================================
Files 64 77 +13
Lines 4492 5978 +1486
==========================================
+ Hits 3603 4959 +1356
- Misses 600 673 +73
- Partials 289 346 +57
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I like the idea of the QUIET flag. What about env vars for each of the prompts? For example, if DNS_PROVIDER is set, skip the prompt for that. |
Having a quiet flag raised the question in my head is the quickstart to noisy to begin with and should we remove some extra prompts or combine prompts ? For example remove the are you ready prompt and combine the 2 DNS provider ones together so by inputting a provider that's a yes and have no also as a option @david-martin Thoughts ? |
sounds reasonable to make it easier for users and to simplify the script. |
I have thoughts on this and in general I think this is solving the symptom of the problem but not the problem. Firstly I think the flag name of Finally, if we look at the problem, you are trying to configure the script to only run the single cluster setup in a hands free mode (I am guessing to make your dev process easier). What stops a user wanting to run the multi cluster configuration in a hands free mode, maybe be in a pipeline for example? What I think the correct approach here should be to allow the user pass in and / or be auto read from the directory the script is ran from, a configuration file. This configuration file should hold the answer to any input the script expects and the script asks any question that the user forgot to set configuration parameter for. If the values are there, log that the value comes from the configuration file. The use of a configuration file in this manner means that very hand holding questions can be asked to new user the first time they use the script. While at the same time allowing someone that runs the script regularly to have multiply configurations saved that they can run in a hands free experience. |
Sounds good to me. It would allow for better flexibility . |
Makes sense to me. :) |
This is true - I guess the name of the variable would have to be more specific if we were going with the original case. However, I believe that by adding further variables suggested by @david-martin, that this would allow the purpose of the
I can see where you're coming from. If the
I can see the benefits of using such an approach - it would mitigate the factor of someone already having that environment variable set on their machine as it would be reading these configurations from a file. On the other hand, it would make the quickstart script less convenient to use as a new file with configurations would need to be created. As such, I don't think it is something we should implement into a quickstart script, something that allows a user to get set up quite quickly. However, I believe a compromise here would be to add the additional flags mentioned by @david-martin while changing the What are your thoughts ? |
There is one detail that maybe I was clear about in the first comment. The configuration file would only be used if it is present. So you don't make the script less convenient by needing to generate the configuration file. It should work with out it. Also remember that a lot of our guides expect the user to create files, like But it does raise a valid question for this PR. Where is this new flag documented. How is a new user meant to know what it does? If that involves reading and understand all the documentation then why not write it to build up a configuration file during that process? The same would go for One more thing that should be in the back of you mind when doing this is what happens to the cardinality caused by the introduction of the external configurations. I say external configurations as this affects both environment variable and configuration files. Take this example if |
This makes much more sense to me, thanks for clarifying that! I can now see the benefit of using such a configuration file, and will look to implement.
Thanks for pointing that out - I am now a fan of the idea with the idea that it is to complement, not to replace the quiet flag idea.
You are right, I will write up a ticket for documenting this new flag. I believe if we re-factor how we think about documenting, where this is an additional feature, and we can leave what we already have there in place, while adding this new section that outlines how to use these new environment variables or configuration, that it would require less work while still providing the user with the context. Thinking about it, maybe it could also be another ticket for implementing the configuration too. That is to say, it could be something worked on after this PR, or simultaneously. I'll go ahead and write that one up, too.
Thanks for mentioning this! My understanding would be that when To summarise, I will continue on the path with creating the environment variables needed as mentioned above, while creating tickets for documenting the process and creating a configuration file to complement the quickstart . How does that sound ? |
Yes for the most of it. I disagree with the use of environment variable in general. While yes a configuration file would complement the environment variable, I still see the problem of using environment variables. If it was feature flags, ya, they go hand in hand with configuration files. When I say feature flags an example call would look like The other piece of information I will share, more for context then any else. Environment variables do not act the same every where. I use Fish for my shell. There is 5 main levels of environment variables. The first being local which is only accessible from within the fish function that defines it. The there is shell level access which allows access within that session shell only. So you can do I should say, the plan you outlined in your summary sound good under the circumstances. |
I can see the benefit of using feature flags, but wouldn't it nearly be over engineering the quickstart script if we were to start using them alongside env vars ? It could become confusing, and to mitigate, would mean re-designing the script entirely. Since we are already using env vars, I think it would be best to continue using them for now .
I believe we defined exactly which shell to use at the top of the script, so it should use bash by default when running . I can see where it can present issue if using different shells, but since we have already defined the shell, I would expect the behaviour of running the script to be bash .
Thanks for letting me know! I will continue with that plan for now. :) |
PR closed as new issue replaces it. |
What:
KUADRANT_QUIET
,DNS_PROVIDER
andMULTICLUSTER
flag detection for running quickstart script uninterrupted has been added.How:
It checks for whether
KUADRANT_QUIET
exists and if so, will run an uninterrupted run of quickstart in single cluster and no DNS provider mode.If
DNS_PROVIDER
is set alongsideKUADRANT_QUIET
, then it will run the quickstart script in single cluster mode, with dns provider.If
MULTICLUSTER
is set alongsideKUADRANT_QUIET
orDNS_PROVIDER
, or both, it will run in multicluster mode with or without dns provider .Why:
Developers or System Administrators may find this useful so they do not need to use prompts to spin up Kuadrant quickly, such as for testing purposes in CI/CD pipelines.
Verify:
Run:
KUADRANT_QUIET=<whatever> ./hack/quickstart-setup.sh
KUADRANT_QUIET=<whatever> DNS_PROVIDER=<whatever> ./hack/quickstart-setup.sh
KUADRANT_QUIET=<whatever> DNS_PROVIDER=<whatever> MULTICLUSTER=<whatever> ./hack/quickstart-setup.sh
KUADRANT_QUIET=<whatever> MULTICLUSTER=<whatever> ./hack/quickstart-setup.sh
Of course, other combinations exist for those env vars. The idea is that all these combinations run successfully and without error to make the script more automated.