Skip to content

Instantly share code, notes, and snippets.

@ihuston
ihuston / Flask on CF.md
Last active February 11, 2023 19:16
Simple Flask application for Cloud Foundry

Simple Python Flask app on Cloud Foundry

This is a (very) simple Flask application that shows how the built-in Python buildpack detection on Cloud Foundry works.

To push to Cloud Foundry, log in and then use

$ cf push myapp-name

Python on Cloud Foundry

@ihuston
ihuston / concourse_bumpme
Created January 3, 2018 11:51
For S&W Concourse tutorial
e
@ihuston
ihuston / app.py
Created March 6, 2017 13:46
Minimal Pandas + Conda CF app
from io import StringIO
import requests
import pandas as pd
r = requests.get("https://www.plants.usda.gov/java/downloadData?fileName=plantlst.txt&static=true").text
df = pd.read_csv(StringIO(r))
print(df)
while True:
pass
exit(0)
@ihuston
ihuston / Spyre app on Cloud Foundry
Last active February 25, 2017 18:56
Example PyData app on Cloud Foundry using Spyre (https://github.com/adamhajari/spyre) and the Python conda buildpack (https://github.com/ihuston/python-conda-buildpack)
## PyData stack on Cloud Foundry
The current Python buildpack uses `pip` to install dependencies. Anyone who has tried to install NumPy or SciPy using `pip` knows that the process can be lengthy and painful often requiring manual intervention to correct library paths and install Fortran compilers.
Fortunately [Continuum Analytics'](http://continuum.io/) [conda package manager](conda.pydata.org) was created to solve these problems by packaging and distributing the standard tools of the Python data stack in compiled binaries.
I wanted to build web apps on Cloud Foundry using the PyData stack so with help from [a colleague](https://github.com/nebhale) I have written a [Cloud Foundry buildpack](https://github.com/ihuston/python-conda-buildpack) which uses both conda and pip to install required packages.
You can specify packages to be installed by `conda` in the `conda_requirements.txt` file and these will be installed first, followed by packages in the `requirements.txt` which will be installed as usual by `pi