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

Adds post deployment script for jaas/jujushell #697

Merged

Conversation

jcsackett
Copy link
Contributor

@jcsackett jcsackett commented Nov 27, 2018

https://github.com/juju/jujushell has added support for post-deployment commands to be run in the gui. This feature in the gui looks for a file in bundles, post-deployment.sh, and sends commands listed there to the jujushell.

Additionally, we'e added a k8s specific post deploy command to the limited shell used in jaas, which this added post-deploy script uses.

@tvansteenburgh
Copy link
Contributor

@Jaycee Thanks! I was wondering if you can describe what the k8s-postdeploy command actually does?

@jcsackett
Copy link
Contributor Author

@tvansteenburgh I can do one better--I can show it to you: https://github.com/juju/termserver/blob/master/files/k8s-postdeploy

To save you a click though:

  • Grabs kubectl config from the master k8s machine for kubectl (kubectl is now already installed in the jujushell lxc image)
  • Deploys and relates the aws-integrator if the bundle has been deployed on aws

@jcsackett
Copy link
Contributor Author

Also, I realize I said it automatically runs this, which is inaccurate; it allows you to run it all at once via one action in the GUI. I've amended the description above.

@tvansteenburgh
Copy link
Contributor

That is really cool, thanks @Jaycee !

@kwmonroe
Copy link
Member

@Jaycee this depends on changes to the bundle script to support post-deployment.sh -- i've added those in #698. Note that this adds empty post files to each fragment.

I couldn't find any refs to post-deployment in https://github.com/juju/jujushell, so I'm not sure about the ramifications of having an empty post-deployment.sh script in the bundles. Can you enlighten me? Will empty scripts simply be ignored, or do they need to be removed?

@jcsackett
Copy link
Contributor Author

So, postdeployment.sh is something the GUI uses -- see https://github.com/juju/juju-gui/blob/develop/jujugui/static/gui/src/app/components/post-deployment/post-deployment.js -- with the jujushell service and the termserver (as part of jujushell) which is the bit I've linked above. It's quite a mix of applications.

A zero-length postdeployment script shouldn't cause any issues, technically, but it does create an odd experience, as the post deployment button will be rendered but not do anything aside from opening the juju terminal within the GUI--that's not broken in that it doesn't damage anything a user is deploying, but it's a bad interaction.

Is it possible to make it an optional thing on your end, or should we make sure the GUI doesn't render the button when the file is empty?

@kwmonroe
Copy link
Member

A zero-length postdeployment script shouldn't cause any issues, technically, but it does create an odd experience, as the post deployment button will be rendered but not do anything aside from opening the juju terminal within the GUI--that's not broken in that it doesn't damage anything a user is deploying, but it's a bad interaction.

@Jaycee agreed

Is it possible to make it an optional thing on your end, or should we make sure the GUI doesn't render the button when the file is empty?

We could belt-and-suspender it and do it in both places -- i'll leave it to you to decide what should happen on the gui rendering for empty post-dep files. On this side, I've made the file optional so it's only written if we have content. Once #699 is merged, this should be g2g.

Copy link
Member

@kwmonroe kwmonroe left a comment

Choose a reason for hiding this comment

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

LGTM

@kwmonroe kwmonroe merged commit d03eb09 into charmed-kubernetes:master Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants