Applications can depend on one another and thus must be configured and set up in a specific order. Oftentimes, for example, the application server must be dependent on the database application. In practical terms this means we only want to start the application server once the database is up and running and reported as healthy.
Specifying dependencies between applications is straightforward:
#blueprint.yaml --- kind: blueprint spec_version: 1 ... applications: - acme_appserver: depends_on: - acme_database - acme_database
In the above example, when the sandbox is created, the 'acme_database' application will be set up first and configured. All 'acme_webserver' instances are deployed but the application will be configured and launched only once the database server is ready and reported as healthy.
You can create a hierarchy of dependent applications. According to these constraints, CloudShell Colony will automatically calculate the correct order in which the applications should be configured and launched after the instances are ready. For example, in this scenario:
#blueprint.yaml --- kind: blueprint spec_version: 1 ... applications: - acme_dashboard: depends_on: - acme_appserver - acme_bi_engine: - acme_database - acme_appserver: depends_on: - acme_database - acme_database
In this example the 'acme_database' will first be created, then both the 'acme_appserver' and the acme_bi_engine will be launched in parallel once the database is reported as healthy. Finally, once the 'acme_appserver' application is healthy, the 'acme_dashboard' application will be configured and run.