SlideShare a Scribd company logo
Cloud	
  Foundry	
  100-­‐day	
  Challenge	
  
-­‐	
  Deploy	
  100	
  OSS	
  apps	
  onto	
  CF	
  
Noburou	
  TANIGUCHI	
  
Nippon	
  Telegraph	
  and	
  Telephone	
  CorporaAon	
  
/	
  Japan	
  Cloud	
  Foundry	
  Group	
  
Who	
  I	
  am	
  
•  Work	
  for	
  NTT	
  
–  NTT:	
  Nippon	
  Telegraph	
  and	
  Telephone	
  Corp.	
  
•  A	
  member	
  of	
  cfgrjp	
  
–  cfgrjp:	
  Japan	
  Cloud	
  Foudry	
  Group	
  
•  A	
  CF-­‐related	
  work	
  
–  Cheap	
  Update	
  Buildpack	
  
hNps://bitbucket.org/nota-­‐ja/cheap-­‐update-­‐buildpack	
  
Cloud	
  Foundry	
  100-­‐day	
  Challenge	
  
•  hNp://blog.cloudfoundry.gr.jp/search/
label/百日行	
  
•  「百日行」in	
  Japanese	
  
–  百	
  (hyaku):	
  100	
  
–  日	
  (nichi):	
  day	
  
–  行	
  (gyou):	
  discipline,	
  esp.	
  in	
  religional	
  context	
  
Cloud	
  Foundry	
  100-­‐day	
  Challenge	
  
•  What	
  
–  Deploy	
  100	
  OSS	
  apps	
  onto	
  CF	
  
–  One	
  app	
  (and	
  blog	
  post)	
  per	
  (business)	
  day	
  
–  Since	
  2015/06/04	
  
–  100	
  posts	
  finished	
  at	
  2015/11/16	
  
•  6	
  core	
  writers	
  +	
  3	
  guest	
  writers	
  
•  All	
  in	
  Japanese	
  
Cloud	
  Foundry	
  100-­‐day	
  Challenge	
  
•  Why	
  
–  More	
  CF	
  recogniAon	
  in	
  Japan	
  
–  Learn	
  how	
  to	
  make	
  apps	
  run	
  on	
  CF	
  
–  Explore	
  new	
  features	
  desirable	
  for	
  CF	
  users	
  
Numbers	
  
•  Success	
  /	
  Failure	
  
•  Buildpacks	
  
•  Services	
  
•  (ModificaAons)
Numbers:	
  Success	
  /	
  Failure	
  
•  OK:	
  97	
  
•  NG:	
  3	
  
–  BuNerfly	
  
–  Milkode	
  
–  Zound	
  
NG:	
  BuNerfly	
  
•  hNps://github.com/paradoxxxzero/
buNerfly	
  
–  Web-­‐based	
  terminal	
  
•  cf	
  push	
  =>	
  running	
  
•  Requires	
  password	
  of	
  user	
  'vcap'	
  ..	
  
NG:	
  Milkode	
  
•  hNps://github.com/ongaeshi/milkode	
  
–  Source	
  code	
  search	
  engine	
  with	
  Web	
  UI	
  
•  Runs	
  on	
  Heroku	
  
•  Failed	
  to	
  stage	
  on	
  CF	
  
–  failed	
  compiling	
  "rroonga"	
  gem's	
  naAve	
  extension	
  
•  Need	
  to	
  compile	
  some	
  binaries	
  against	
  cflinuxfs2	
  
environment	
  
•  May	
  run	
  if	
  we	
  have	
  enough	
  Ame	
  
NG:	
  Zound	
  
•  hNps://github.com/gre/zound	
  
–  Real	
  Ame	
  audio	
  streaming	
  (experimental)	
  
•  cf	
  push	
  =>	
  running	
  
•  Needs	
  hardware	
  audio	
  device	
  for	
  
realAme	
  audio	
  rendering	
  
Numbers:	
  Buildpacks	
  
•  Total: 	
  113	
  
–  Binary	
  (Null): 	
  1	
  
–  Go: 	
  4	
  
–  Java:	
  8	
  
–  Node.js:	
  24	
  
–  PHP:	
  22	
  
–  Python: 	
  3	
  
–  Ruby: 	
  21	
  
–  StaAcfile: 	
  16	
  
–  app-­‐specific: 	
  4	
  
–  heroku-­‐buildpack-­‐apt: 	
  4	
  
–  heroku-­‐buildpack-­‐mulA: 	
  6	
  
Numbers:	
  Services	
  
•  Total: 	
  52	
  
–  MongoDB: 	
  8	
  
–  MySQL: 	
  27	
  
•  (incl.	
  ClearDB: 	
  1)	
  
–  PostgreSQL:	
  12	
  
–  Redis: 	
  3	
  
–  SendGrid: 	
  1	
  
•  non-­‐CF	
  services	
  
–  MongoDB: 	
  1	
  
–  PostgreSQL:	
  2	
  
•  apps	
  using	
  mulAple	
  services:	
  3	
  
Some	
  Experience	
  
•  EtherSheet	
  
•  Jenkins	
  
•  SugarCRM	
  
•  Feedbin	
  
•  UNICALE	
  
•  MaNermost	
  
•  CommaFeed	
  
EtherSheet	
  
•  hNps://github.com/ethersheet-­‐
collecAve/EtherSheet/	
  
–  Web-­‐based	
  spreadsheet	
  
•  PORT	
  
•  DATABASE_URL	
  
Jenkins	
  
•  hNp://jenkins-­‐ci.org/	
  
–  Most	
  popular	
  CI	
  tool	
  
•  Very	
  easy	
  with	
  jenkins-­‐buildpack	
  
•  Configs	
  in	
  local	
  file	
  	
  
–  Jenkins	
  Job	
  Builder	
  
–  (Database	
  plugin)	
  
•  Master	
  /	
  Slave	
  composiAon	
  
•  =>	
  Testbed	
  
SugarCRM	
  
•  hNp://www.sugarcrm.com/	
  
–  Well-­‐known	
  open	
  source	
  CRM	
  
•  PHP	
  extensions	
  
•  Custom	
  Apache	
  seongs	
  
•  Configs	
  in	
  local	
  files	
  
–  Redeploy	
  
Feedbin	
  
•  hNps://feedbin.com/	
  
–  Ruby	
  on	
  Rails-­‐based	
  feed	
  reader	
  
•  Complex	
  
–  RDBMS	
  
–  Redis	
  
–  (Memcached)	
  
–  Honeybadger	
  
–  worker	
  processes	
  
•  SSL	
  customizability	
  
•  StaAc	
  file	
  serving	
  customizability	
  
•  Gemfile.lock	
  generaAon	
  
UNICALE	
  
•  hNp://www.unicale.com/	
  
–  PHP-­‐based	
  simple	
  calendar	
  
	
  
•  Very	
  simple	
  
•  Data	
  in	
  local	
  files	
  
–  sshfs	
  
MaNermost	
  
•  hNp://www.maNermost.org/	
  
–  Open	
  source	
  Slack	
  alternaAve	
  
	
  
•  Most	
  hardest	
  ever	
  
•  Go	
  +	
  Node.js	
  (+	
  Ruby)	
  
–  go-­‐buildpack	
  
–  heroku-­‐buildpack-­‐apt	
  
•  with	
  many	
  workarounds	
  
•  PORT	
  
•  DATABASE_URL	
  /	
  VCAP_SERVICES	
  
MulA	
  vs	
  App-­‐Specific	
  Buildpack	
  
•  heroku-­‐buildpack-­‐mulA	
  
–  Easy	
  to	
  understand	
  
–  Less	
  flexible	
  
–  Bothersome	
  
•  Requires	
  addiAonal	
  file(s)	
  
•  App-­‐specific	
  buildpack	
  
–  More	
  flexibile	
  
–  Less	
  (mostly	
  no)	
  addiAonal	
  files	
  
–  Requires	
  to	
  be	
  maintained	
  outside	
  of	
  CF	
  
CommaFeed
•  hNps://www.commafeed.com/	
  
–  Java	
  /	
  Dropwizard-­‐based	
  feed	
  reader	
  
	
  
•  My	
  first	
  actual	
  java-­‐buildpack	
  study	
  
–  Know	
  so	
  many	
  features	
  in	
  java-­‐buildpack	
  
•  Finally	
  use	
  Java	
  Main	
  Container	
  and	
  Java	
  OpAons	
  
•  Configs	
  in	
  local	
  file	
  
•  PORT	
  
•  DATABASE_URL	
  
Three	
  Important	
  Points	
  for	
  Apps	
  
•  Must	
  have	
  dynamic	
  port	
  binding	
  
•  Should	
  avoid	
  configs	
  /	
  data	
  in	
  local	
  file	
  
•  BeNer	
  to	
  get	
  service	
  credenAals	
  from	
  env	
  
Service	
  CredenAals	
  
•  VCAP_SERVICES	
  
•  DATABASE_URL	
  
Seems	
  having	
  no	
  standard	
  format	
  
–  Ruby	
  on	
  Rails	
  
–  Node.js	
  
–  Golang	
  
–  PHP	
  (Pear)	
  
•  JDBC_URL	
  
Difficult	
  Things	
  
•  Problem	
  isolaAon	
  /	
  debugging	
  
–  staging	
  
–  starAng	
  
–  running	
  
•  Should	
  understand	
  various	
  languages	
  /	
  
frameworks	
  
•  Should	
  understand	
  usage	
  of	
  various	
  
buildpacks	
  
Some	
  Debugging	
  Tricks
•  Basic	
  
–  `cf	
  logs	
  <appname>`	
  in	
  another	
  terminal	
  
•  Staging	
  
–  JBP_LOG_LEVEL=DEBUG	
  
–  fork	
  buildpack	
  and	
  `set	
  –x`	
  
•  StarAng	
  
–  netcat	
  dummy	
  daemon	
  
–  (ssh	
  to	
  dea_ng	
  &	
  login	
  to	
  container)	
  
•  Running	
  /	
  Overall	
  
–  How	
  to	
  debug	
  the	
  Cloud	
  Foundry	
  Java	
  Buildpack
hNp://blog.anynines.com/debug-­‐cloud-­‐foundry-­‐java-­‐buildpack/	
  
Toughest	
  Thing	
  
•  Pressure	
  of	
  DAILY	
  post	
  
Good	
  things	
  
•  Experience	
  how	
  to	
  use	
  Cloud	
  Foundry	
  
–  (not	
  how	
  to	
  build	
  /	
  operate)	
  	
  
–  What	
  applicaAon	
  is	
  good	
  for	
  CF	
  
–  How	
  to	
  migrate	
  exisAng	
  applicaAons	
  to	
  CF	
  
–  Many	
  skills	
  for	
  trouble	
  shooAng	
  
A	
  Retrospect	
  
•  More	
  CF	
  recogniAon	
  
–  A	
  certain	
  result	
  
–  But	
  the	
  aNenAon	
  to	
  CF	
  in	
  Japan	
  is	
  sAll	
  not	
  
so	
  high	
  
•  Making	
  apps	
  run	
  on	
  CF	
  
–  Our	
  team	
  have	
  learned	
  a	
  lot	
  
•  New	
  features	
  desirable	
  for	
  CF	
  users	
  
–  Ease	
  of	
  debugging	
  for	
  dev	
  
–  Ops	
  requirements	
  is	
  yet	
  to	
  explore	
  
Finally	
  ..
•  Most	
  applicaAons	
  can	
  be	
  made	
  to	
  run	
  
on	
  Cloud	
  Foundry	
  
–  With	
  a	
  certain	
  effort	
  and	
  Ame	
  
•  I	
  want	
  MORE	
  apps	
  to	
  be	
  CF-­‐ready
Thank	
  you.	
  

More Related Content

Cloud Foundry 百日行 振り返り

  • 1. Cloud  Foundry  100-­‐day  Challenge   -­‐  Deploy  100  OSS  apps  onto  CF   Noburou  TANIGUCHI   Nippon  Telegraph  and  Telephone  CorporaAon   /  Japan  Cloud  Foundry  Group  
  • 2. Who  I  am   •  Work  for  NTT   –  NTT:  Nippon  Telegraph  and  Telephone  Corp.   •  A  member  of  cfgrjp   –  cfgrjp:  Japan  Cloud  Foudry  Group   •  A  CF-­‐related  work   –  Cheap  Update  Buildpack   hNps://bitbucket.org/nota-­‐ja/cheap-­‐update-­‐buildpack  
  • 3. Cloud  Foundry  100-­‐day  Challenge   •  hNp://blog.cloudfoundry.gr.jp/search/ label/百日行   •  「百日行」in  Japanese   –  百  (hyaku):  100   –  日  (nichi):  day   –  行  (gyou):  discipline,  esp.  in  religional  context  
  • 4. Cloud  Foundry  100-­‐day  Challenge   •  What   –  Deploy  100  OSS  apps  onto  CF   –  One  app  (and  blog  post)  per  (business)  day   –  Since  2015/06/04   –  100  posts  finished  at  2015/11/16   •  6  core  writers  +  3  guest  writers   •  All  in  Japanese  
  • 5. Cloud  Foundry  100-­‐day  Challenge   •  Why   –  More  CF  recogniAon  in  Japan   –  Learn  how  to  make  apps  run  on  CF   –  Explore  new  features  desirable  for  CF  users  
  • 6. Numbers   •  Success  /  Failure   •  Buildpacks   •  Services   •  (ModificaAons)
  • 7. Numbers:  Success  /  Failure   •  OK:  97   •  NG:  3   –  BuNerfly   –  Milkode   –  Zound  
  • 8. NG:  BuNerfly   •  hNps://github.com/paradoxxxzero/ buNerfly   –  Web-­‐based  terminal   •  cf  push  =>  running   •  Requires  password  of  user  'vcap'  ..  
  • 9. NG:  Milkode   •  hNps://github.com/ongaeshi/milkode   –  Source  code  search  engine  with  Web  UI   •  Runs  on  Heroku   •  Failed  to  stage  on  CF   –  failed  compiling  "rroonga"  gem's  naAve  extension   •  Need  to  compile  some  binaries  against  cflinuxfs2   environment   •  May  run  if  we  have  enough  Ame  
  • 10. NG:  Zound   •  hNps://github.com/gre/zound   –  Real  Ame  audio  streaming  (experimental)   •  cf  push  =>  running   •  Needs  hardware  audio  device  for   realAme  audio  rendering  
  • 11. Numbers:  Buildpacks   •  Total:  113   –  Binary  (Null):  1   –  Go:  4   –  Java:  8   –  Node.js:  24   –  PHP:  22   –  Python:  3   –  Ruby:  21   –  StaAcfile:  16   –  app-­‐specific:  4   –  heroku-­‐buildpack-­‐apt:  4   –  heroku-­‐buildpack-­‐mulA:  6  
  • 12. Numbers:  Services   •  Total:  52   –  MongoDB:  8   –  MySQL:  27   •  (incl.  ClearDB:  1)   –  PostgreSQL:  12   –  Redis:  3   –  SendGrid:  1   •  non-­‐CF  services   –  MongoDB:  1   –  PostgreSQL:  2   •  apps  using  mulAple  services:  3  
  • 13. Some  Experience   •  EtherSheet   •  Jenkins   •  SugarCRM   •  Feedbin   •  UNICALE   •  MaNermost   •  CommaFeed  
  • 14. EtherSheet   •  hNps://github.com/ethersheet-­‐ collecAve/EtherSheet/   –  Web-­‐based  spreadsheet   •  PORT   •  DATABASE_URL  
  • 15. Jenkins   •  hNp://jenkins-­‐ci.org/   –  Most  popular  CI  tool   •  Very  easy  with  jenkins-­‐buildpack   •  Configs  in  local  file     –  Jenkins  Job  Builder   –  (Database  plugin)   •  Master  /  Slave  composiAon   •  =>  Testbed  
  • 16. SugarCRM   •  hNp://www.sugarcrm.com/   –  Well-­‐known  open  source  CRM   •  PHP  extensions   •  Custom  Apache  seongs   •  Configs  in  local  files   –  Redeploy  
  • 17. Feedbin   •  hNps://feedbin.com/   –  Ruby  on  Rails-­‐based  feed  reader   •  Complex   –  RDBMS   –  Redis   –  (Memcached)   –  Honeybadger   –  worker  processes   •  SSL  customizability   •  StaAc  file  serving  customizability   •  Gemfile.lock  generaAon  
  • 18. UNICALE   •  hNp://www.unicale.com/   –  PHP-­‐based  simple  calendar     •  Very  simple   •  Data  in  local  files   –  sshfs  
  • 19. MaNermost   •  hNp://www.maNermost.org/   –  Open  source  Slack  alternaAve     •  Most  hardest  ever   •  Go  +  Node.js  (+  Ruby)   –  go-­‐buildpack   –  heroku-­‐buildpack-­‐apt   •  with  many  workarounds   •  PORT   •  DATABASE_URL  /  VCAP_SERVICES  
  • 20. MulA  vs  App-­‐Specific  Buildpack   •  heroku-­‐buildpack-­‐mulA   –  Easy  to  understand   –  Less  flexible   –  Bothersome   •  Requires  addiAonal  file(s)   •  App-­‐specific  buildpack   –  More  flexibile   –  Less  (mostly  no)  addiAonal  files   –  Requires  to  be  maintained  outside  of  CF  
  • 21. CommaFeed •  hNps://www.commafeed.com/   –  Java  /  Dropwizard-­‐based  feed  reader     •  My  first  actual  java-­‐buildpack  study   –  Know  so  many  features  in  java-­‐buildpack   •  Finally  use  Java  Main  Container  and  Java  OpAons   •  Configs  in  local  file   •  PORT   •  DATABASE_URL  
  • 22. Three  Important  Points  for  Apps   •  Must  have  dynamic  port  binding   •  Should  avoid  configs  /  data  in  local  file   •  BeNer  to  get  service  credenAals  from  env  
  • 23. Service  CredenAals   •  VCAP_SERVICES   •  DATABASE_URL   Seems  having  no  standard  format   –  Ruby  on  Rails   –  Node.js   –  Golang   –  PHP  (Pear)   •  JDBC_URL  
  • 24. Difficult  Things   •  Problem  isolaAon  /  debugging   –  staging   –  starAng   –  running   •  Should  understand  various  languages  /   frameworks   •  Should  understand  usage  of  various   buildpacks  
  • 25. Some  Debugging  Tricks •  Basic   –  `cf  logs  <appname>`  in  another  terminal   •  Staging   –  JBP_LOG_LEVEL=DEBUG   –  fork  buildpack  and  `set  –x`   •  StarAng   –  netcat  dummy  daemon   –  (ssh  to  dea_ng  &  login  to  container)   •  Running  /  Overall   –  How  to  debug  the  Cloud  Foundry  Java  Buildpack hNp://blog.anynines.com/debug-­‐cloud-­‐foundry-­‐java-­‐buildpack/  
  • 26. Toughest  Thing   •  Pressure  of  DAILY  post  
  • 27. Good  things   •  Experience  how  to  use  Cloud  Foundry   –  (not  how  to  build  /  operate)     –  What  applicaAon  is  good  for  CF   –  How  to  migrate  exisAng  applicaAons  to  CF   –  Many  skills  for  trouble  shooAng  
  • 28. A  Retrospect   •  More  CF  recogniAon   –  A  certain  result   –  But  the  aNenAon  to  CF  in  Japan  is  sAll  not   so  high   •  Making  apps  run  on  CF   –  Our  team  have  learned  a  lot   •  New  features  desirable  for  CF  users   –  Ease  of  debugging  for  dev   –  Ops  requirements  is  yet  to  explore  
  • 29. Finally  .. •  Most  applicaAons  can  be  made  to  run   on  Cloud  Foundry   –  With  a  certain  effort  and  Ame   •  I  want  MORE  apps  to  be  CF-­‐ready