- Jupyter Notebooks - code/data IDE
- Using IBM Watson Studio notebooksfor this application for easy scheduling and model deployment
- Recommend downloading Anaconda for local development, includes notebooks.
- Object storage - data persistence
- This is a very simple app just using IBM Cloud object storage for managing data
- This app can easily be upgraded to a NoSQL document store DB like Cloudant
- Text editor of your choice (I like Atom)
- Python environment capable of running Flask (think Anaconda install will cover this dependency)
If you want to deploy your app to the IBM Cloud, you'll need the following:
Now you're ready to start working with the app. Clone the repo and change to the directory where the sample app is located.
git clone https://github.com/gfilla/pycon2018
cd pycon2018
Peruse the files in the pycon2018 directory to familiarize yourself with the contents.
Install the dependencies listed in the requirements.txt file to be able to run the app locally.
You can optionally use a virtual environment to avoid having these dependencies clash with those of other Python projects or your operating system.
pip install -r requirements.txt
Run the app.
python app.py
View your app at: http://localhost:8000
- Requirements gathering
- Data Collection
- Machine Learning - Model training / experimentation
- Flask application Development
- Model deployment and management
See these slides for more details
To deploy to IBM Cloud, it can be helpful to set up a manifest.yml file. One is provided for you with the sample. Take a moment to look at it.
The manifest.yml includes basic information about your app, such as the name, how much memory to allocate for each instance and the route. In this manifest.yml random-route: true generates a random route for your app to prevent your route from colliding with others. You can replace random-route: true with host: myChosenHostName, supplying a host name of your choice. Learn more...
applications:
- name: pycon2018
random-route: true
memory: 128M
You can use the Cloud Foundry CLI to deploy apps.
Choose your API endpoint
cf api <API-endpoint>
Replace the API-endpoint in the command with an API endpoint from the following list.
URL | Region |
---|---|
https://api.ng.bluemix.net | US South |
https://api.eu-de.bluemix.net | Germany |
https://api.eu-gb.bluemix.net | United Kingdom |
https://api.au-syd.bluemix.net | Sydney |
Login to your IBM Cloud account
cf login
From within the pycon2018 directory push your app to IBM Cloud
cf push
This can take a minute. If there is an error in the deployment process you can use the command cf logs <Your-App-Name> --recent
to troubleshoot.
When deployment completes you should see a message indicating that your app is running. View your app at the URL listed in the output of the push command. You can also issue the
cf apps
command to view your apps status and see the URL.