Each custom service can provide a service advisor as a Python script named service-advisor.py in their service folder. A Service Advisor allows custom services to integrate into the stack advisor behavior which only applies to the services within the stack.
Service Advisor Inheritance
Unlike the Stack-advisor scripts, the service-advisor scripts do not automatically extend the parent service's service-advisor scripts. The service-advisor script needs to explicitly extend their parent's service service-advisor script. The following code sample shows how you would refer to a parent's service_advisor.py. In this case it is extending the root service-advisor.py file in the resources/stacks directory.
Service Advisor Behavior
Like the stack advisors, service advisors provide information on 4 important aspects for the service:
- Recommend layout of the service on cluster
- Recommend service configurations
- Validate layout of the service on cluster
- Validate service configurations
By providing the service-advisor.py file, one can control dynamically each of the above for the service.
The main interface for the service-advisor scripts contains documentation on how each of the above are called, and what data is provided.