Applications can depend on one another and so need to be configured and set up at a specific order. One common scenario, for example, is for the application server to 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 application is straightforward as you can see below:
#blueprint.yaml --- kind: blueprint spec_version: 1 ... applications: - acme_appserver: depends_on: - acme_database - acme_database
In the example above, when the sandbox is created the 'acme_database' application will first be set up and configured. All 'acme_webserver' instances be deployed but the application will be configured and launched only once the database server is ready and reported healthy.
It is possible to create a hierarchy of dependent applications. CloudShell colony will automatically calculate the right order in which the applications should be configured and launched after the instances are ready according to these constraints. 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 healthy. Finally, once the 'acme_appserver' application is healthy, the 'acme_dashboard' application will be configured and run.