cloud foundry 百日行 振り返り

30
Cloud Foundry 100day Challenge Deploy 100 OSS apps onto CF Noburou TANIGUCHI Nippon Telegraph and Telephone CorporaAon / Japan Cloud Foundry Group

Upload: nota-ja

Post on 06-Jan-2017

505 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Cloud Foundry 百日行 振り返り

Cloud  Foundry  100-­‐day  Challenge  -­‐  Deploy  100  OSS  apps  onto  CF  

Noburou  TANIGUCHI  Nippon  Telegraph  and  Telephone  CorporaAon  

/  Japan  Cloud  Foundry  Group  

Page 2: Cloud Foundry 百日行 振り返り

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  

Page 3: Cloud Foundry 百日行 振り返り

Cloud  Foundry  100-­‐day  Challenge  

•  hNp://blog.cloudfoundry.gr.jp/search/label/百日行  

•  「百日行」in  Japanese  – 百  (hyaku):  100  – 日  (nichi):  day  – 行  (gyou):  discipline,  esp.  in  religional  context  

Page 4: Cloud Foundry 百日行 振り返り

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  

Page 5: Cloud Foundry 百日行 振り返り

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  

Page 6: Cloud Foundry 百日行 振り返り

Numbers  

•  Success  /  Failure  •  Buildpacks  •  Services  •  (ModificaAons)

Page 7: Cloud Foundry 百日行 振り返り

Numbers:  Success  /  Failure  

•  OK:  97  •  NG:  3  

–  BuNerfly  – Milkode  –  Zound  

Page 8: Cloud Foundry 百日行 振り返り

NG:  BuNerfly  

•  hNps://github.com/paradoxxxzero/buNerfly  – Web-­‐based  terminal  

•  cf  push  =>  running  •  Requires  password  of  user  'vcap'  ..  

Page 9: Cloud Foundry 百日行 振り返り

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  

Page 10: Cloud Foundry 百日行 振り返り

NG:  Zound  

•  hNps://github.com/gre/zound  –  Real  Ame  audio  streaming  (experimental)  

•  cf  push  =>  running  •  Needs  hardware  audio  device  for  realAme  audio  rendering  

Page 11: Cloud Foundry 百日行 振り返り

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  

Page 12: Cloud Foundry 百日行 振り返り

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  

Page 13: Cloud Foundry 百日行 振り返り

Some  Experience  

•  EtherSheet  •  Jenkins  •  SugarCRM  •  Feedbin  •  UNICALE  •  MaNermost  •  CommaFeed  

Page 14: Cloud Foundry 百日行 振り返り

EtherSheet  

•  hNps://github.com/ethersheet-­‐collecAve/EtherSheet/  – Web-­‐based  spreadsheet  

•  PORT  •  DATABASE_URL  

Page 15: Cloud Foundry 百日行 振り返り

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  

Page 16: Cloud Foundry 百日行 振り返り

SugarCRM  

•  hNp://www.sugarcrm.com/  – Well-­‐known  open  source  CRM  

•  PHP  extensions  •  Custom  Apache  seongs  

•  Configs  in  local  files  –  Redeploy  

Page 17: Cloud Foundry 百日行 振り返り

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  

Page 18: Cloud Foundry 百日行 振り返り

UNICALE  

•  hNp://www.unicale.com/  –  PHP-­‐based  simple  calendar  

 •  Very  simple  

•  Data  in  local  files  –  sshfs  

Page 19: Cloud Foundry 百日行 振り返り

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  

Page 20: Cloud Foundry 百日行 振り返り

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  

Page 21: Cloud Foundry 百日行 振り返り

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  

Page 22: Cloud Foundry 百日行 振り返り

Three  Important  Points  for  Apps  

•  Must  have  dynamic  port  binding  •  Should  avoid  configs  /  data  in  local  file  •  BeNer  to  get  service  credenAals  from  env  

Page 23: Cloud Foundry 百日行 振り返り

Service  CredenAals  

•  VCAP_SERVICES  •  DATABASE_URL  

Seems  having  no  standard  format  –  Ruby  on  Rails  –  Node.js  –  Golang  –  PHP  (Pear)  

•  JDBC_URL  

Page 24: Cloud Foundry 百日行 振り返り

Difficult  Things  

•  Problem  isolaAon  /  debugging  –  staging  –  starAng  –  running  

•  Should  understand  various  languages  /  frameworks  

•  Should  understand  usage  of  various  buildpacks  

Page 25: Cloud Foundry 百日行 振り返り

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/  

Page 26: Cloud Foundry 百日行 振り返り

Toughest  Thing  

•  Pressure  of  DAILY  post  

Page 27: Cloud Foundry 百日行 振り返り

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  

Page 28: Cloud Foundry 百日行 振り返り

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  

Page 29: Cloud Foundry 百日行 振り返り

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

Page 30: Cloud Foundry 百日行 振り返り

Thank  you.