degica / barcelona

PaaS built on top of AWS
MIT License
52 stars 6 forks source link

Add priority to plugin hook #806

Closed essa closed 6 months ago

essa commented 6 months ago

Continue from #805

The Datadog agent must be invoked after the instance has been set up, otherwise it will alert about setup activity, such as installing a yum package.

This PR adds a priority to Plugin and updates the calling order of plugin hooks so that we can be sure that datadog is installed and invoked last.

This plugin should be registered with max priority in the district.

$ bcn district put-plugin -a api_key=8e53.... -a hook_priority=10 ec-staging datadog

And it also updates the instance type of bastion to 't3.small'. 't3.micro' was too small for all the plugin and sometimes the cloud-init fails.

degikko commented 6 months ago

@showwin can you help us review this PR, please?

essa commented 6 months ago

@showwin Sorry, hold the review please. I found one issue to fix.

essa commented 6 months ago

@showwin I moved the hook_priority from a model attribute to a plugin attribute. To add the priority by bcn cli, it must be a plugin attribute.

And I also make the default value to zero as your suggestion.

Could you review it again? 🙏

showwin commented 6 months ago

LGTM about the latest code👍