Skip to content

Commit d013161

Browse files
committed
Update README with more instructions.
1 parent edf8ba6 commit d013161

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,108 @@ instance with
1515

1616
$ cf push
1717

18+
The slides are available [on Speakerdeck](https://speakerdeck.com/ihuston/pydata-london-2015-getting-started-with-cloud-foundry-for-data-science).
19+
20+
Getting Started
21+
===============
22+
23+
If you do not have an account on a Cloud Foundry installation you can
24+
register for a free trial at [Pivotal Web Services (PWS)](http://run.pivotal.io).
25+
26+
Download the Cloud Foundry Command Line Interface from the CF management console
27+
or [the CF Github repo](https://github.com/cloudfoundry/cli).
28+
This provides the `cf` command which you will use to interact with a CF installation.
29+
30+
Target the CF installation API with `cf api`. For example for PWS:
31+
32+
$ cf api https://api.run.pivotal.io
33+
34+
Pushing your first app
35+
======================
36+
37+
The first app is in the folder `01-simple-python-app`.
38+
Have a look at the code and then deploy using `cf push`.
39+
40+
$ cd 01-simple-python-app
41+
$ cf push
42+
43+
You can inspect the app's streaming logs using `cf logs myapp`.
44+
45+
You can scale your app by changing the number of instances and the available RAM:
46+
47+
$ cf scale myapp -i 5
48+
$ cf scale myapp -m 256M
49+
50+
Pushing an app with PyData dependencies
51+
=======================================
52+
53+
The second app is in the folder `02-pydata-spyre-app`.
54+
This app is built using [Spyre](https://github.com/adamhajari/spyre) by Adam Hajari.
55+
56+
This application uses the [Python Conda Buildpack](https://github.com/ihuston/python-conda-buildpack)
57+
to provision dependencies using `conda`. This buildpack is specified in the `manifest.yml` file.
58+
59+
The `environment.yml` file contains the `conda` environment specification.
60+
61+
Push the app using `cf push` and visit the app URL to see a simple interactive visualisation.
62+
63+
$ cd ../02-pydata-spyre-app
64+
$ cf push
65+
66+
Using data services
67+
===================
68+
69+
The third app is in the folder '03-services-redis'.
70+
71+
Services provide persistent storage and other useful resources for your applications.
72+
73+
First, create a free Redis service provided by Rediscloud:
74+
75+
$ cf create-service rediscloud 30mb myredis
76+
77+
You can bind this to your apps making it available via the `VCAP_SERVICES`
78+
environmental variable.
79+
80+
$ cf bind-service myapp myredis
81+
82+
Look at the environmental variables your app has with `cf env myapp`.
83+
84+
Now you can push the third app which uses Redis as its backing store.
85+
86+
$ cd ../03-services-redis
87+
$ cf push
88+
89+
The manifest specifies that this app should be bound to the myredis service instancet
90+
that you just created.
91+
92+
Putting it all together
93+
=======================
94+
95+
The fourth app is in the folder '04-learning-api'.
96+
97+
We can put everything we've learned into practice by building our own simple
98+
machine learning API.
99+
100+
This is a simplified version of [a project](https://github.com/alexkago/ds-cfpylearning)
101+
by [Alex Kagoshima](http://twitter.com/akagoshima).
102+
103+
**Don't forget to stop all your apps when you are finished with**
104+
105+
$ cf stop myapp
106+
$ cf stop sinewave
107+
$ cf stop testredis
108+
$ cf stop learning-api
109+
110+
Resources
111+
=========
112+
113+
* [Cloud Foundry documentation](http://docs.cloudfoundry.org)
114+
* [Pivotal Web Services](http://run.pivotal.io)
115+
* [CF Summit Videos](https://www.youtube.com/playlist?list=PLhuMOCWn4P9g-UMN5nzDiw78zgf5rJ4gR)
116+
* [CF Meetups](http://cloud-foundry.meetup.com)
117+
* [Slides for this tutorial](https://speakerdeck.com/ihuston/pydata-london-2015-getting-started-with-cloud-foundry-for-data-science)
118+
119+
18120
License: See LICENSE.txt in each example folder
19121

20122
Author: Ian Huston

0 commit comments

Comments
 (0)