Convox Community

CLI support of app-level resources

Problem

We gave it a try to check how app-level resources works while we are using rack-level resources now.
In turned out that app-level resources was not usable for us as of now because we had to create resources to keep our app healthy.

For example, redis nodes should be alive when the app gets started. Of course, app should know the hosts of redis nodes. But it seems impossible to launch app-level resources before ‘convox deploy’.

Possible solution

I am not sure why an alternative command for app-level resources to ‘convox rack resources create redis’ command is not there.
We launch resources by the command and set required environment variables as of now before we deploy app for the fist time.
Defining resources in convox.yml seems good but our use case needs some tricks which other companies app might do as well.

Thanks.

To use app level resources you will want to specify them in your convox.yml. Doing so will cause those resources to be created during your next deploy, before the services are started. They will be provided to the services that reference them in their resources section as an environment variable.

@ddollar Thank you for your reply. From the same company as ‘kamiya’, Now we found the reason why our application failed to be launched was it expected different environment variables to connect required resources.

We now confirm the behavior of environment variables with convox-examples/rails repo and have created a PR to convox/docs repo about it with specific example of environment variables names. Hope it helps.