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

Run workflows asyncrhonously on MiqAutomationWorker #50

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

agrare
Copy link
Member

@agrare agrare commented Sep 21, 2023

Comment on lines -72 to +75
wf.step
wf.run_nonblock
Copy link
Member

Choose a reason for hiding this comment

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

🎉

@@ -87,6 +89,6 @@ def run(args = {})
object.after_ae_delivery(ae_result)
end

run_queue(:zone => zone, :role => role, :object => object) unless wf.end?
run_queue(:zone => zone, :role => role, :object => object, :deliver_on => 1.minute.from_now.utc) unless wf.end?
Copy link
Member

Choose a reason for hiding this comment

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

think I want to expose wf.waiting

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I was hoping to contain that knowledge inside the .wait method

@agrare agrare added enhancement New feature or request quinteros/yes? labels Sep 25, 2023
@agrare agrare force-pushed the run_workflows_on_miq_automation_worker branch 2 times, most recently from 8c502d1 to 0589b64 Compare September 26, 2023 19:18
Rather than running each step in a single queue message synchronously,
execute WorkflowInstances asynchronously and requeue once the workflow
would block.
@agrare agrare force-pushed the run_workflows_on_miq_automation_worker branch from 0589b64 to 98832ba Compare September 26, 2023 19:21
@agrare agrare changed the title [WIP] Run workflows asyncrhonously on MiqAutomationWorker Run workflows asyncrhonously on MiqAutomationWorker Sep 26, 2023
@agrare agrare removed the wip label Sep 26, 2023
@miq-bot
Copy link
Member

miq-bot commented Sep 26, 2023

Checked commits agrare/manageiq-providers-workflows@98832ba~...2d1adb9 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@@ -87,6 +90,6 @@ def run(args = {})
object.after_ae_delivery(ae_result)
end

run_queue(:zone => zone, :role => role, :object => object) unless wf.end?
run_queue(:zone => zone, :role => role, :object => object, :deliver_on => 10.seconds.from_now.utc, :server_guid => MiqServer.my_server.guid) unless wf.end?
Copy link
Member

Choose a reason for hiding this comment

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

@agrare Is this what you mentioned to me?

So my question here is why we need the pinning and deliver time at all?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because this re-queue while the docker/podman/k8s task is still running so we don't want it to spin (hence deliver on) and we need to run it on the same server so podman inspect will be able to see the running container.

Copy link
Member

Choose a reason for hiding this comment

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

ohhh I see - ok, this is what I wasn't understanding in our discussion yesterday because I thought it worked differently.

@Fryguy Fryguy merged commit be6f4d1 into ManageIQ:master Sep 27, 2023
@Fryguy Fryguy self-assigned this Sep 27, 2023
@agrare agrare deleted the run_workflows_on_miq_automation_worker branch September 27, 2023 15:20
@Fryguy
Copy link
Member

Fryguy commented Sep 27, 2023

Backported to quinteros in commit 0d1e031.

commit 0d1e031d66c96dcd4e55dac39782d73bbd989926
Author: Jason Frey <[email protected]>
Date:   Wed Sep 27 11:16:50 2023 -0400

    Merge pull request #50 from agrare/run_workflows_on_miq_automation_worker
    
    Run workflows asyncrhonously on MiqAutomationWorker
    
    (cherry picked from commit be6f4d1e202f6ea61510a3488281ba62452e5f25)

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

Successfully merging this pull request may close these issues.

4 participants