manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

[WIP] Move MiqWorker record creation out of run_single_worker.rb on podified

Open agrare opened this issue 6 months ago • 2 comments

On a podified environment we cannot pass a unique GUID to a worker due to how the environment is defined by the deployment (all replicas have to have the same environment).

We worked around this by creating the MiqWorker record in the pod once it starts up which allows us to create a record with a unique GUID.

This is an issue however for non-rails/ruby workers which don't use run_single_worker.rb, resulting in a pod running with not MiqWorker record created at all.

The goal here is to move creating the worker record into MiqServer for all platform types (kubernetes, systemd, and process).

TODO:

  • [x] Create a worker record on podified when starting the worker
  • [x] Update run_single_worker to not create/update the worker record
  • [x] Update MiqWorker::Runner to be able to lookup a worker record by system_uid not GUID
  • [x] Update MiqServer::WorkerManagement::Kubernetes to link up worker records without a system_uid
  • [ ] Do we need to create MiqWorker records in development when running run_single_worker.rb directly?

Depends on:

  • [x] https://github.com/ManageIQ/manageiq/pull/23109
  • [x] https://github.com/ManageIQ/manageiq/pull/23112

Fixes https://github.com/ManageIQ/manageiq-providers-embedded_terraform/issues/67

agrare avatar Jul 25 '24 16:07 agrare