Skip to content
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 two additional helm options #35

Merged
merged 6 commits into from
Dec 1, 2019

Conversation

tjcrone
Copy link
Contributor

@tjcrone tjcrone commented Nov 30, 2019

I think it might make more sense to have hubploy options parallel helm's. Open to doing this differently. Please let me know!

Copy link
Collaborator

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this better too! Thanks, @tjcrone.

A few comments about argparse, otherwise lgtm

@@ -52,6 +52,15 @@ def main():
deploy_parser.add_argument(
'--version',
)
deploy_parser.add_argument(
'--timeout',
nargs=1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nargs=1 produces a list with one item instead of the value itself. Is there a reason to want to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know this. I will remove this.

)
deploy_parser.add_argument(
'--force',
nargs=0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this with action='store_true' I think - it sets the default to false & doesn't allow args to be passed to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want the default to be false, and we don't want any arguments to --force. Isn't this what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't use store_true, I will need to set a default value in helm.py, which is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, as I look more carefully, it appears that if we do not use store_true, then True would need to be passed, which is not parallel to helm. Helm does not have any arguments to --force. So I think we should keep it like this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry for the confusion. I meant the nargs=0 is not necessary with store_true, since it is superfluous. Hope this makes more sense.

@jhamman
Copy link
Collaborator

jhamman commented Dec 1, 2019

Late to the party here but thought I'd say that I think these sorts of configuration options would fit really well in the hubploy.yaml config files. For example:

images:
  ...
cluster:
  ...
deploy:
  extra_helm_args: "--timeout 1200 --force --recreate_pods"

This would allow for per-deployment customization of deploy arguments.

@tjcrone
Copy link
Contributor Author

tjcrone commented Dec 1, 2019

Great suggestion @jhamman. This is certainly another way to go with this. However with the current changes, per-deployment customization would go into the CircleCI config. I think your suggestion is an intriguing different pathway. @yuvipanda, what do you think?

@tjcrone
Copy link
Contributor Author

tjcrone commented Dec 1, 2019

Original discussion on how to make this happen here: /issues/34.

@yuvipanda yuvipanda merged commit 9ab545f into berkeley-dsep-infra:master Dec 1, 2019
@yuvipanda
Copy link
Collaborator

@jhamman that's an interesting idea, but I think @tjcrone has convinced me that we should have individual settings for what we want than something en-masse. I'm also wary of setting --force as something that's done on each deploy automatically - for example, it could theoreticlaly delete & recreate your hub pod's disk - or worse, your user's disk (losing all data). It does make sense for timeout (or even recreate-pods, if there's a need) to be there though.

What do you think, @tjcrone?

@tjcrone
Copy link
Contributor Author

tjcrone commented Dec 1, 2019

Well, I think both methods seem to offer similar flexibility in terms of per-deployment settings, with one method putting the directive into the CircleCI config, and the other into hubploy.yaml. I agree with @yuvipanda that defined options are a bit safer. Since this one is done and merged, I think we have our answer! Thanks!

@jhamman
Copy link
Collaborator

jhamman commented Dec 1, 2019

Another downside to the approach chosen here is that you'll have to add new command line args to hubploy for every helm option that you want to pass through (e.g. --recreate-pods). Since hubploy doesn't do anything with these, I don't see why they need to be explicitly exposed in the hubploy interface.

It may also be worth coming up with a philosophy for what the hubploy.yaml file is for. A personal peeve of mine is when configuration options are split between the command line and various config files. As you can tell, my personal preference would be to lean on the config file as the place where options like this go.

@yuvipanda
Copy link
Collaborator

@jhamman I agree re: config file vs commandline. For me, it's 'one time use on my commandline, interactively' vs 'repeatedly, every time, on CI'.

For example, I think something like '--dry-run' should be in hubploy.yaml, but timeout should definitely be. --force should also be in commandline, since I don't think it is safe to do that in CI/CD. I guess it becomes a judgement call at this point, but might be useful to write this down?

Does this make sense? Or does it feel like I've too many specific opinions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants