Find file
Fetching contributors…
Cannot retrieve contributors at this time
169 lines (98 sloc) 3.74 KB
cf-plugins local-push, update-cli
CF meetup at Tokyo
31 Mar 2016
Taichi Nakashima
* About me
.image img/deeeet.png 200 _
- *@deeeet* (Twitter) / *@tcnksm* (GitHub)
- [[][]]
- CloudFoundry Dev&Ops in Rakuten
* Love golang
- [[][gcli]] - The easy way to build Golang command-line application
- [[][gotests]] - A tool to generate Go test functions from the given source code like gofmt
- [[][ghr]] - Create Github Release and upload artifacts in parallel
- [[][license]] - Generate LICENSE file you want
- kafka-firehose-nozzle (Coming soon) - Integrate CloudFoundry with [[][Apache Kafka]]
- [[][go-input]] - Go package for ideal tty prompt
- [[][go-latest]] - Simple way to check version is latest or not from various sources in Go
* Cf plugins
- [[][cf-plugin-local-push]]
- [[][cf-plugin-update-cli]]
* Cf plugins
- cf/cli has functionality
- cf plugins enable developers to add custom commands to the cf/cli
* local-push
* local-push
`local-push` allows you to push your CF application to your local docker container with buildpacks 🐳
* local-push
.image img/local-push.gif 500 _
* local-push
Target user?
- Application developer who deploys & runs their service on CF
Application developer (at least me) wants *debug* application on own PC
- It's fast
- You can play with test data and break it
- You can see what buildpack does
* local-push vs. Others
BOSH Lite?
- It's very very heavy
- It's for who operates CF. Not for application developer
- It's also heavy (`7.4GB`)
- You don't need all components
* How local-push works? (1/2)
In one word, `local-push` emulates DEA environment with docker and cf-buildpack.
0. Bulding base docker image: `tcnksm/cf-buildstep`
- Forked `progrium/buildstep`
- Base image is `cloudfoundry/cflinuxfs2` (Same as DEA)
- Installing cf-buidpacks
(It's already uploaded on docker registry)
* How local-push works? (2/2)
1. Building docker image (tcnksm/local-push)
- Add application code
- Fetch dependencies and compile application with buildpack
2. Run container
- Parse `Procfile`
- `docker run -p 8080:8080 -e PORT=8080 tcnkms/local-push`
* Benefit?
- Very light-weight ( base image size is around `1.1` GB )
- Extreamly fast build & boot by docker cache function
- Login to container and see what's happening by `docker exec`
* Install
Use `install-plugin` command,
$ cf add-plugin-repo tcnksm
$ cf install-plugin -r tcnksm local-push
* Next step?
- Interact with DB or MQ
- Integrate with LB (sending special header)
- Parse `manifest.yml` ([[][tcnksm/cf-go-manifest]])
* update-cli
* update-cli
`update-cli` allows you to update cf/cli to the latest version.
* update-cli
.image img/update-cli.gif 500 _
* update-cli
I want this function on cf/cli itself. Kind of proposal to show how it useful.
* How update-cli work?
Core of this plugin is [[][tcnksm/go-latest]]
githubTag := &latest.GithubTag{
Owner: "cloudfoundry",
Repository: "cli",
res, _ := latest.Check(githubTag, "0.1.0")
if res.Outdated {
fmt.Printf("0.1.0 is not latest, you should upgrade to %s", res.Current)
* Install
Use `install-plugin` command,
$ cf add-plugin-repo tcnksm
$ cf install-plugin -r tcnksm update-cli
* Next time?
- How to write good cf plugins