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

Easier ruby use #487

Merged
merged 2 commits into from
Aug 29, 2019
Merged

Easier ruby use #487

merged 2 commits into from
Aug 29, 2019

Conversation

KnVerey
Copy link
Contributor

@KnVerey KnVerey commented May 24, 2019

What are you trying to accomplish with this PR?

Make it easier to use our Ruby interface, i.e. DeployTask, RunnerTask, RenderTask and RestartTask by:

  • Moving requires around so that requiring a specific task (e.g. require 'kubernetes-deploy/deploy_task') actually gets you the dependencies you need to run it (and not dependencies you don't need).
  • Making all the tasks give you a logger out of the box if you don't pass one in. People rarely want to customize the logger (outside our tests), so making them construct one of our fancy loggers is unnecessary friction.
  • Making require kubernetes-deploy require ALL the tasks so that it still has a purpose in the world where the correct way to require any specific task--including DeployTask--is require kubernetes-deploy/TASK.

cc @stefanmb

What could go wrong?

The requires could be incomplete, causing the tasks to blow up in production when executing a line my manual tests didn't cover. I tried making the test files only require the code for their respective tasks, but in addition to being a bit of a mess, it was pointless because all but the RenderTask suite need to require DeployTask (i.e. most of the code) for setup purposes.

Todo

  • Look carefully about which files each task is losing access to
  • Investigate the OJ conflict with Rails apps and consider requiring that file from common While a valid issue, this is not actually related to this PR.

After review but before shipping, test the tasks:

  • invoke each of the tasks from the command line with various options to make sure none are broken
  • invoke each of the tasks from a Ruby console session to make sure this PR works as stated
  • use cumulus-cat's Shipit task to test this branch

@KnVerey KnVerey self-assigned this May 24, 2019
@KnVerey KnVerey force-pushed the easier_ruby_use branch 2 times, most recently from e455ea8 to 8e25558 Compare August 22, 2019 17:28
@KnVerey KnVerey changed the title [WIP] Easier ruby use Easier ruby use Aug 22, 2019
@KnVerey
Copy link
Contributor Author

KnVerey commented Aug 22, 2019

@Shopify/cloudx This is ready for review. @dturn kindly agreed to take over getting it merged. I already manually tested invoking all the tasks with all possible args from the command line, plus requiring only the stated files in the console and successfully invoking the task from ruby. If changes are required after review, some of those tests may need to be repeated, but otherwise this just needs a test deploy using cumulus-cat.

We need to document our Ruby interface, both with inline docs and in the readme. That could be added to this PR, but at this point I'd be inclined to save it for Krane.

Copy link
Contributor

@dturn dturn left a comment

Choose a reason for hiding this comment

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

🎩 deploy/restart/run & render with various issues against cumulus-cat and cloud-portal. No issues

@jessie-JNing
Copy link
Contributor

🎩 in my local

  • kubernetes-deploy
REVISION="4f7d6697fb5a20d4c960cd1cc6530774069489b6" bundle exec kubernetes-deploy cumulus-cat-production tier4 --template-dir=/Users/jessie.ning/src/github.com/Shopify/cumulus-cat/config/k8s/resources --bindings=@/Users/jessie.ning/src/github.com/Shopify/cumulus-cat/config/k8s/runtimes/production-unrestricted.json
  • kubernetes-render
REVISION="4f7d6697fb5a20d4c960cd1cc6530774069489b6" bundle exec kubernetes-render --template-dir=/Users/jessie.ning/src/github.com/Shopify/cumulus-cat/config/k8s/resources --bindings=@/Users/jessie.ning/src/github.com/Shopify/cumulus-cat/config/k8s/runtimes/production-unrestricted.json
  • kubernetes-restart
REVISION="4f7d6697fb5a20d4c960cd1cc6530774069489b6" bundle exec kubernetes-restart cumulus-cat-production tier4

😞 I wasn't able to test kubernetes-run in my local, will try to figure it out

@dturn
Copy link
Contributor

dturn commented Aug 28, 2019 via email

@jessie-JNing
Copy link
Contributor

jessie-JNing commented Aug 28, 2019

I used:
be exe/kubernetes-run cloud-portal-staging tierstaging-us-east1-2
flush-cache

test kubernetes-run against tierstaging-central, now look good to me ✅
Thanks @dturn ~

@dturn dturn merged commit 410812f into master Aug 29, 2019
@dturn dturn deleted the easier_ruby_use branch August 29, 2019 16:09
@timothysmith0609 timothysmith0609 mentioned this pull request Sep 4, 2019
@timothysmith0609 timothysmith0609 temporarily deployed to rubygems September 5, 2019 12:08 Inactive
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.

4 participants