Package: resotoworker
resotoworkerResoto worker daemonTable of contentsOverviewUsageExample usageDetailsActions and TasksActionsTasksContactLicenseOverviewresotoworkerdoes all the collection and cleanup work in Resoto. It is connected toresotocoreover a websocket connection and waits for instructions. By default it subscribes to thecollectandcleanupactions as well astagtasks.resotoworkerloads collectorpluginslike AWS, GCP, Slack, Onelogin, etc.
Only those plugins have knowledge about how to communicate with each cloud. How to collect resources and how to clean them up.There can be one or more instances ofresotoworkerin a Resoto deployment. A singleresotoworkercan collect many clouds or you could have multipleresotoworkercollecting one cloud or even one account in one cloud each.More information can be found below and inthe docs.Usageresotoworkeruses the following commandline arguments:--subscriber-id SUBSCRIBER_ID
                        Unique subscriber ID (default: resoto.worker)
  --psk PSK             Pre-shared key
  --verbose, -v         Verbose logging
  --quiet               Only log errors
  --resotocore-uri RESOTOCORE_URI
                        resotocore URI (default: https://localhost:8900)
  --override CONFIG_OVERRIDE [CONFIG_OVERRIDE ...]
                        Override config attribute(s)
  --ca-cert CA_CERT     Path to custom CA certificate file
  --cert CERT           Path to custom certificate file
  --cert-key CERT_KEY   Path to custom certificate key file
  --cert-key-pass CERT_KEY_PASS
                        Passphrase for certificate key file
  --no-verify-certs     Turn off certificate verificationENV Prefix:RESOTOWORKER_Every CLI arg can also be specified using ENV variables.For instance the boolean--forkwould becomeRESOTOWORKER_FORK=true.DetailsOnceresotoworkeris started you do not have to interact with it at all. It will just sit there, wait for work and do its job. The following are details on howresotoworkerworks internally and how it integrates withresotocore.Actions and TasksThink of actions and tasks like topics and queues in a messaging system. Actions are broadcast to everyone subscribed for that action. A task is always given to exactly one worker that knows how to handle it.ActionsWhen thecollectworkflow withinresotocoreis triggered (by either an event or a schedule or because the user manually triggered it),resotocorewill broadcast a"start collecting all the cloud accounts you know about"message to all the subscribed workers.
Once all the workers finish collecting and sent their graph to the core, the workflow will proceed to the next step which would beplan_cleanup. This one tells anyone interested to start planing their cleanup based on the just collected graph data. Once everyone has planed their cleanup and flagged resources that should get cleaned up with thedesired.clean = trueflag, the workflow proceeds to thecleanupstep which again notifies anyone subscribed to now perform cleanup of those flagged resources. Because the cleaner withinresotoworkerhas knowledge of all dependencies in the graph, it will ensure that resources are cleaned up in the right order.TasksWhen a plugin or a user decides that a resource tag should be added, changed or removed, e.g. by runningsearch id = i-039e06bb2539e5484 | tag update owner lukasresotocorewill put this tagging task onto a task queue. This task is then consumed by aresotoworkerthat knows how to perform tagging for that particular resource and its particular cloud and account. In our example above where we are setting the tagowner: lukasfor an AWS EC2 instance with IDi-039e06bb2539e5484the task would be given to aresotoworkerthat knows how to update AWS EC2 instance tags in that resources account.ContactIf you have any questions feel free tojoin our Discordoropen a GitHub issue.LicenseSeeLICENSEfor details.