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

How to not allow PR's merged in Staging to get merged in Prod! #2889

Open
balajialg opened this issue Oct 16, 2021 · 12 comments
Open

How to not allow PR's merged in Staging to get merged in Prod! #2889

balajialg opened this issue Oct 16, 2021 · 12 comments
Assignees

Comments

@balajialg
Copy link
Contributor

balajialg commented Oct 16, 2021

If we want to play around with staging environment without making changes to prod/ensuring that the changes get merged in prod, what would be an effective way forward?

@balajialg balajialg self-assigned this Oct 16, 2021
@balajialg balajialg changed the title Cherrypick PR's from Staging to Prod! How to not allow PR's merged in Staging to get merged in Prod! Oct 16, 2021
@yuvipanda
Copy link
Contributor

I think this depends on the kinds of changes. What kinds of changes do you have in mind?

@felder
Copy link
Contributor

felder commented Oct 18, 2021

@yuvipanda the idea would be to permit me to make changes to things to grafana or perhaps the hubs that would require testing over multiple days without holding up other deploys to prod. Essentially is there a way to cherry pick commits to staging for deployments to prod?

@yuvipanda
Copy link
Contributor

@felder the way I do this is to deploy from my local machine to particular staging instances. It'll get wiped everytime anyone merges a PR though, but then I just deploy again and go as it just takes a minute or two. What do you think of that?

@felder
Copy link
Contributor

felder commented Oct 18, 2021

@yuvipanda that will probably work. I may need a short tutorial on hubploy to make sure I know how to do this.

@yuvipanda
Copy link
Contributor

@felder makes sense!

I think it would be:

  1. Make sure pre-reqs are installed (pip install -r requirements.txt)
  2. Make sure you have gcloud installed, and are authenticated correctly so sops works
  3. Run hubploy deploy <hub-name> hub <staging|prod> to do a deploy
  4. Make changes, repeat (3) as needed

Can you try that out?

@ryanlovett
Copy link
Collaborator

@yuvipanda That worked for me back in the git-crypt days, but not with sops. hubploy wants things to be decrypted. CI decrypts in place at various stages with sops -d -i support/secrets.yaml.

Since hubploy ultimately runs helm with the path to deployments/{deployment}/secrets/staging.yaml, I suppose you can manually replace that with process substitution, e.g. helm ... -f <(sops -d deployments/{deployment}/secrets/staging.yaml)

@yuvipanda
Copy link
Contributor

@ryanlovett are you on the latest version of hubploy? I added sops support to hubploy so you wouldn't have to do that.

@ryanlovett
Copy link
Collaborator

@yuvipanda No, sorry, I should have checked!

@ryanlovett
Copy link
Collaborator

Per @yuvipanda 's advice in slack, one should install hubploy from github, https://github.com/yuvipanda/hubploy.

@felder felder self-assigned this Oct 20, 2021
@felder
Copy link
Contributor

felder commented Oct 21, 2021

I tried to use hubploy to deploy biology-staging yesterday, I was not successful but also have not yet tried other hubs or dug into why it failed.

@yuvipanda
Copy link
Contributor

@felder cool, let me know what errors you run into and I'll see how I can help! You'll need to install it from git, not from pypi

@felder
Copy link
Contributor

felder commented Oct 21, 2021

@yuvipanda yeah did the git installation and before roping you in I definitely wanted to confirm myself whether or not it was chair to computer interface problem.

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

No branches or pull requests

4 participants