As a system administrator
I need to deploy our service to the cloud
So that we don't have to worry about physical server maintenance
Details and Assumptions
Create Cloud Foundry Application in IBM Cloud - US South
See HW2 requirement 3 for naming conventions
Create the necessary Cloud Foundry metadata files (see hw2 requirement 3)
Provision elephantsql and link it to our app
Per prof: Some of you may be confused as to which database to use on your project. If you modeled you project after: project-templae, sample-accounts, or lab-flask-tdd then it uses a Relation database called PostgreSQL. Some of my labs also use a NoSQL database called Cloudant. Please don't get confused. Your projects are not using Cloudant so there is no reason to provision one for your project.
This is explained on Slides 122-125 of 07-PlatformAsAService lecture and as shown in class:
You should be going to Elephantsql.com to provision a PostgreSQL database. This will give you a URL to connect to the database. You should use the IBM Cloud CLI to define a User Provided Service called ElephantSQL that points to your Postgres database using the following command:
ibmcloud cf cups ElephantSQL -p '{"url":"<paste-the-url-of-your-elephant-sql-database-here"}'
Then in your config.py file you will need to add the following lines of code just like the one in lab-flask-tdd :
if 'VCAP_SERVICES' in os.environ:
vcap = json.loads(os.environ['VCAP_SERVICES'])
DATABASE_URI = vcap['user-provided'][0]['credentials']['url']
You must do both of these before pushing your application to Cloud Foundry so that it can connect to your database.
Per prof:========================
ElephantSQL Protocol Change
The protocol for PostgreSQL is usually postgres:// but recently the new Python driver switched to adding ql to the end of it to make it:
postgresql://
When you define your ElephantSQL service, use postgresql:// for the protocol instead of the postgres:// in the URL you are given. So you can't just cut-n-paste the URL from elephantsql.com. You must edit it. Otherwise you will get an error when you push to the cloud that the dialect cannot be found..
Add honcho to requirements.txt
Acceptance Criteria
Given we have pushed our application to IBM Cloud
When we go to the URL of our service
Then we see our service running on IBM Cloud with all functions usable.
As a system administrator I need to deploy our service to the cloud So that we don't have to worry about physical server maintenance
Details and Assumptions
Per prof:======================== ElephantSQL Protocol Change
The protocol for PostgreSQL is usually postgres:// but recently the new Python driver switched to adding ql to the end of it to make it: postgresql:// When you define your ElephantSQL service, use postgresql:// for the protocol instead of the postgres:// in the URL you are given. So you can't just cut-n-paste the URL from elephantsql.com. You must edit it. Otherwise you will get an error when you push to the cloud that the dialect cannot be found..
Add honcho to requirements.txt
Acceptance Criteria