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

When available, use Mistral workflows to scale stacks #1533

Merged
merged 3 commits into from
Oct 30, 2017

Conversation

rwsu
Copy link
Contributor

@rwsu rwsu commented Jun 12, 2017

Modifies update_stack to queue tasks to scale up or down stacks
using Mistral if the workflows are available. Workflows are
available starting with OSP10.

For OSP9 and older environments, the existing behavior of updating
the stack directly is used.

Depends on ManageIQ/manageiq-providers-openstack#55

@rwsu rwsu changed the title Use Mistral workflows, if available, to scale stacks When available, use Mistral workflows to scale stacks Jun 13, 2017
@chessbyte chessbyte requested a review from tzumainn June 15, 2017 10:47
@tzumainn
Copy link
Contributor

This looks good in principle! Scaling down a node doesn't require updating the heat parameters? Does the delete_node workflow take care of that?

@rwsu
Copy link
Contributor Author

rwsu commented Jun 15, 2017 via email

Copy link
Contributor

@tzumainn tzumainn left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@tzumainn
Copy link
Contributor

@h-kataria can this be merged?

@martinpovolny
Copy link
Member

@rwsu, @tzumainn : is it possible to fix the Rubocop issues before we merge this?

@rwsu rwsu force-pushed the scale-using-workflows branch 4 times, most recently from ed7ad42 to 3f6092e Compare September 6, 2017 03:27
@rwsu
Copy link
Contributor Author

rwsu commented Sep 6, 2017

@martinpovolny all fixed. Can you take a look?

@rwsu
Copy link
Contributor Author

rwsu commented Oct 4, 2017

@martinpovolny the rubocop issues have been fixed. Can this be merged?

@martinpovolny martinpovolny assigned blomquisg and unassigned h-kataria Oct 9, 2017
@martinpovolny
Copy link
Member

Guys, the code looks good. Sure. But there's a fundamental problem with the approach.

 +        if can_use_scale_up_workflow?
 +          # OSP >= 10 use workflows
 +          stack.scale_up_queue(session[:userid], stack_parameters)
 +        else
 +          # OSP < 10 use heat stack update
 +          stack.update_stack_queue(session[:userid], nil, stack_parameters)
 +        end

This looks like a business logic. Based on some condition:

+  def can_use_scale_up_workflow?
 +    !workflow_service.nil? && workflow_service.has_action?("tripleo.parameters.update") && workflow_service.has_workflow?("tripleo.deployment.v1.deploy_plan")
 +  end

you are deciding how a particular operation should be accomplished. I can't see why this would live in the frontend.

I am sorry, but if there's any reason for this to be in the frontend, I need to hear it from the core guys. Ping @Ladas, @blomquisg

@agrare
Copy link
Member

agrare commented Oct 9, 2017

@rwsu @tzumainn all of this should be done in the provider stack code, the only thing the UI controller should do is queue the action for the stack instance.

Also stack.update_ready? connects to the provider directly to get the status, the UI appliance isn't guaranteed to be able to route to the provider API. This is why we queue provider operations for the generic worker running in the provider's zone. We cannot do any direct API calls to the provider from any UI code.

@martinpovolny
Copy link
Member

the UI appliance isn't guaranteed to be able to route to the provider API

It's actually a supported usecase where it CANNOT route there. We had this discussion a couple of times already ;-)

@tzumainn
Copy link
Contributor

tzumainn commented Oct 9, 2017

Ah, that makes sense. @rwsu can we move that business logic into a unified scaling method in the backend?

@blomquisg
Copy link
Member

@martinpovolny @h-kataria I don't have commit rights to this repo. So, if this PR has to be closed, merged, or whatever, I'm not going to be able to deal with it.

@martinpovolny
Copy link
Member

@blomquisg : I asked for your expertise, but all is resolved already.

@rwsu : do you prefer carrying on in this PR or will you open a new one? Thanks and sorry for the trouble.

@martinpovolny martinpovolny changed the title When available, use Mistral workflows to scale stacks [WIP] When available, use Mistral workflows to scale stacks Oct 10, 2017
rwsu added 2 commits October 10, 2017 16:54
Modifies update_stack to queue tasks to scale up or down stacks
using Mistral if the workflows are available. Workflows are
available starting with OSP10.

For OSP9 and older environments, the existing behavior of updating
the stack directly is used.

Depends on ManageIQ/manageiq-providers-openstack#55
or expect_any_instance_of
@rwsu rwsu force-pushed the scale-using-workflows branch from 3f6092e to 03f50d2 Compare October 13, 2017 19:15
Moved calls hitting the provider into queued methods under the
orchestration_stack model. The controller now simply calls the
queue methods.

Depends on ManageIQ/manageiq-providers-openstack#117
@rwsu rwsu force-pushed the scale-using-workflows branch from 03f50d2 to 1488c9b Compare October 16, 2017 03:42
@miq-bot
Copy link
Member

miq-bot commented Oct 16, 2017

Checked commits rwsu/manageiq-ui-classic@f97c26d~...1488c9b with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@rwsu rwsu changed the title [WIP] When available, use Mistral workflows to scale stacks When available, use Mistral workflows to scale stacks Oct 16, 2017
@rwsu
Copy link
Contributor Author

rwsu commented Oct 16, 2017

Hi @martinpovolny, I've moved the calls that were hitting the OpenStack API into the orchestration stack model (ManageIQ/manageiq-providers-openstack#117). Does this look better?

@miq-bot miq-bot removed the wip label Oct 16, 2017
@mansam
Copy link
Contributor

mansam commented Oct 30, 2017

@martinpovolny could someone from the UI team review whether this needs any further changes?

@martinpovolny martinpovolny merged commit f1e577a into ManageIQ:master Oct 30, 2017
@martinpovolny martinpovolny added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants