SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Writing Docker
monitoring agent with Go
ainoya
About me
• Naoki Ainoya( ainoya)
• iOS(new!)/Server/Infra engineer
• Swift/Scala/Go/Docker
• Recruit Marketing Partners Co, Ltd.
A tiny deployment pipeline tool
Written in Go
walter-cd/walter
Open source project
Introduction of Fune
• An event emitter triggered by Docker Event API
• The agent process (fune-agent) communicates with docker
daemon via its socket
• https://github.com/ainoya/fune
Docker daemon
Funeagent
ConttainerA
ConttainerB
ConttainerC
Nginx/Redis
vulcand(etcd)
Slack notification etc..
Listens docker
events API
notifies each containers are
created/died/stopped/started
Emits pluggable
actions
Your
arbitrary docker ecosystem
ECS/k8s/fleet/etc..
Docker Host
Deploy containers
Overview of Fune
• Docker Events API provides a lifecycle of container
as JSON format
• create/start/die/stop
Overview of Fune
fune-agent listens these events
Docker daemon
Funeagent
ConttainerA
ConttainerB
ConttainerC
Listens docker
events API
notifies each containers are
created/died/stopped/started
Your
arbitrary docker ecosystem
ECS/k8s/fleet/etc..
Docker Host
Deploy containers
Overview of Fune
fune-agent emits Action

when received Docker events

from event
Docker daemon
Funeagent
ConttainerA
ConttainerB
Nginx/Redis
vulcand(etcd)
Slack notification etc..
Listens docker
events API
notifies each containers are
created/died/stopped/started
Emits pluggable
actions
Your
arbitrary docker ecosystem
ECS/k8s/fleet/etc..
Docker Host
Deploy containers
Overview of Fune
Docker daemon
Funeagent
ConttainerA
ConttainerB
Nginx/Redis
vulcand(etcd)
Slack notification etc..
Listens docker
events API
notifies each containers are
created/died/stopped/started
Emits pluggable
actions
Your
arbitrary docker ecosystem
ECS/k8s/fleet/etc..
Docker Host
Deploy containers
• Action, for example;
• Set/Del a container information to Redis as
FQDN/IP:Port pair for proxy
• Slack notification
• More details are next time :)
Today I talk about:
• Some tips I learned with writing fune
• Studied a lot of stuffs from coreos/etcd
Setup project
• Standard structure for 

working with Godeps correctly
• /src/github.com/ainoya/fune
./${GOPATH}/src
!"" 9fans.net
#   %"" go
!"" code.google.com
#   %"" p
!"" github.com
#   !"" ainoya/fune
#   !"" barakmich
#   !"" coreos etc...
Godeps for the package
dependencies
• Using Godeps once, all dependencies copied into
directory and rewrite import statement
• Then you need Godeps command only if package
dependency is added
import "github.com/fsouza/go-dockerclient"
// after `Godep save -r ./…`
import "github.com/ainoya/fune/Godeps/_workspace/
src/github.com/fsouza/go-dockerclient"
Godeps for the package
dependencies
• All dependencies are included in git repos
• But it makes dirty commit log!!
• Keep off its dirtiness by split commits :)
How about vendor feature in
go1.5?
• go1.5 vendor feature have some problems yet
• ex) go	
  tool	
  "./…" doesn't works well
• https://github.com/golang/go/issues/11659
• See also ) http://deeeet.com/writing/2015/06/26/golang-dependency-
vendoring/
Write tests
• Rerun automatically if files are changed
• rerun is awesome! (but ruby tool gem)
rerun -x -c -d directory1, directory2,...
—pattern '**/*.{go}' -- go test ./...
Be careful about race condition
• Test with "-­‐race" option if you often use goroutine in your code
• "-­‐cpu	
  N" option may reveal race condition you didn't expected
• I use "go	
  test	
  ./…	
  -­‐race	
  -­‐cpu	
  1,2,4" inside test script
WARNING: DATA RACE
Write by goroutine 8:
sync.raceWrite()
/usr/local/Cellar/go/1.5/libexec/src/sync/race.go:41 +0x2e
sync.(*WaitGroup).Wait()
/usr/local/Cellar/go/1.5/libexec/src/sync/waitgroup.go:124 +0xf9
github.com/ainoya/fune/emitter.TestBroadCast()
/Users/ainoya/.go/src/github.com/ainoya/fune/gopath/src/github.com/
ainoya/fune/emitter/emitter_test.go:57 +0x444
testing.tRunner()
/usr/local/Cellar/go/1.5/libexec/src/testing/testing.go:456 +0xdc
Is Go1.5 compilation time
slower than 1.4?
• "go	
  test" obviously takes time much longer
• It's probably because of GoGo compiler
performance

Ref) Performance section of https://golang.org/doc/go1.5
• It should be improved with Go1.6
Channel tips
• coreos/etcd implements a shutdown feature with
using close(channel)
type	
  Server	
  struct	
  {	
  
	
   name	
  	
  	
  	
  string	
  
	
   channel	
  chan	
  struct{}	
  
	
   done	
  	
  	
  	
  chan	
  struct{}	
  
	
   stop	
  	
  	
  	
  chan	
  struct{}	
  
}	
  
func	
  main()	
  {	
  
	
   done	
  :=	
  make(chan	
  struct{})	
  
	
   stop	
  :=	
  make(chan	
  struct{})	
  
	
   s	
  :=	
  &Server{done:	
  done,	
  stop:	
  stop,	
  
hoge:	
  hoge}	
  
	
   go	
  s.run()	
  
	
   s.channel	
  <-­‐	
  struct{}{}	
  
	
   osutil.RegisterInterrputHandler(s.Stop)	
  
	
   <-­‐s.done	
  
}
func	
  (s	
  *Server)	
  run()	
  {	
  
	
   defer	
  func()	
  {	
  close(s.done)	
  }()	
  
	
   for	
  {	
  
	
   	
   select	
  {	
  
	
   	
   case	
  <-­‐s.channel:	
  
	
   	
   	
   fmt.Println("do	
  something")	
  
	
   	
   case	
  <-­‐s.stop:	
  
	
   	
   	
   return	
  
	
   	
   }	
  
	
   }	
  
}	
  
func	
  (s	
  *S)	
  Stop()	
  {	
  
	
   select	
  {	
  
	
   case	
  s.stop	
  <-­‐	
  struct{}{}:	
  
	
   case	
  <-­‐s.done:	
  
	
   	
   return	
  
	
   }	
  
	
   <-­‐s.done	
  
}	
  
Channel tips
• coreos/etcd implements a shutdown feature with
using close(channel)
type	
  Server	
  struct	
  {	
  
	
   name	
  	
  	
  	
  string	
  
	
   channel	
  chan	
  struct{}	
  
	
   done	
  	
  	
  	
  chan	
  struct{}	
  
	
   stop	
  	
  	
  	
  chan	
  struct{}	
  
}	
  
func	
  main()	
  {	
  
	
   done	
  :=	
  make(chan	
  struct{})	
  
	
   stop	
  :=	
  make(chan	
  struct{})	
  
	
   s	
  :=	
  &Server{done:	
  done,	
  stop:	
  stop,	
  
hoge:	
  hoge}	
  
	
   go	
  s.run()	
  
	
   s.channel	
  <-­‐	
  struct{}{}	
  
	
   osutil.RegisterInterrputHandler(s.Stop)	
  
	
   <-­‐s.done	
  
}
func	
  (s	
  *Server)	
  run()	
  {	
  
	
   defer	
  func()	
  {	
  close(s.done)	
  }()	
  
	
   for	
  {	
  
	
   	
   select	
  {	
  
	
   	
   case	
  <-­‐s.channel:	
  
	
   	
   	
   fmt.Println("do	
  something")	
  
	
   	
   case	
  <-­‐s.stop:	
  
	
   	
   	
   return	
  
	
   	
   }	
  
	
   }	
  
}	
  
func	
  (s	
  *S)	
  Stop()	
  {	
  
	
   select	
  {	
  
	
   case	
  s.stop	
  <-­‐	
  struct{}{}:	
  
	
   case	
  <-­‐s.done:	
  
	
   	
   return	
  
	
   }	
  
	
   <-­‐s.done	
  
}	
  
Channel tips
• coreos/etcd implements a shutdown feature with
using close(channel)
type	
  Server	
  struct	
  {	
  
	
   name	
  	
  	
  	
  string	
  
	
   channel	
  chan	
  struct{}	
  
	
   done	
  	
  	
  	
  chan	
  struct{}	
  
	
   stop	
  	
  	
  	
  chan	
  struct{}	
  
}	
  
func	
  main()	
  {	
  
	
   done	
  :=	
  make(chan	
  struct{})	
  
	
   stop	
  :=	
  make(chan	
  struct{})	
  
	
   s	
  :=	
  &Server{done:	
  done,	
  stop:	
  stop,	
  
hoge:	
  hoge}	
  
	
   go	
  s.run()	
  
	
   s.channel	
  <-­‐	
  struct{}{}	
  
	
   osutil.RegisterInterrputHandler(s.stop)	
  
	
   <-­‐s.done	
  
}
func	
  (s	
  *Server)	
  run()	
  {	
  
	
   defer	
  func()	
  {	
  close(s.done)	
  }()	
  
	
   for	
  {	
  
	
   	
   select	
  {	
  
	
   	
   case	
  <-­‐s.channel:	
  
	
   	
   	
   fmt.Println("do	
  something")	
  
	
   	
   case	
  <-­‐s.stop:	
  
	
   	
   	
   return	
  
	
   	
   }	
  
	
   }	
  
}	
  
func	
  (s	
  *S)	
  Stop()	
  {	
  
	
   select	
  {	
  
	
   case	
  s.stop	
  <-­‐	
  struct{}{}:	
  
	
   case	
  <-­‐s.done:	
  
	
   	
   return	
  
	
   }	
  
	
   <-­‐s.done	
  
}	
  
Channel tips
• coreos/etcd implements a shutdown feature with
using close(channel)
type	
  Server	
  struct	
  {	
  
	
   name	
  	
  	
  	
  string	
  
	
   channel	
  chan	
  struct{}	
  
	
   done	
  	
  	
  	
  chan	
  struct{}	
  
	
   stop	
  	
  	
  	
  chan	
  struct{}	
  
}	
  
func	
  main()	
  {	
  
	
   done	
  :=	
  make(chan	
  struct{})	
  
	
   stop	
  :=	
  make(chan	
  struct{})	
  
	
   s	
  :=	
  &Server{done:	
  done,	
  stop:	
  stop,	
  
hoge:	
  hoge}	
  
	
   go	
  s.run()	
  
	
   s.channel	
  <-­‐	
  struct{}{}	
  
	
   osutil.RegisterInterrputHandler(s.Stop)	
  
	
   <-­‐s.done	
  
}
func	
  (s	
  *Server)	
  run()	
  {	
  
	
   defer	
  func()	
  {	
  close(s.done)	
  }()	
  
	
   for	
  {	
  
	
   	
   select	
  {	
  
	
   	
   case	
  <-­‐s.channel:	
  
	
   	
   	
   fmt.Println("do	
  something")	
  
	
   	
   case	
  <-­‐s.stop:	
  
	
   	
   	
   return	
  
	
   	
   }	
  
	
   }	
  
}	
  
func	
  (s	
  *S)	
  Stop()	
  {	
  
	
   select	
  {	
  
	
   case	
  s.stop	
  <-­‐	
  struct{}{}:	
  
	
   case	
  <-­‐s.done:	
  
	
   	
   return	
  
	
   }	
  
	
   <-­‐s.done	
  
}	
  
Channel tips
• coreos/etcd implements a shutdown feature with
using close(channel)
type	
  Server	
  struct	
  {	
  
	
   name	
  	
  	
  	
  string	
  
	
   channel	
  chan	
  struct{}	
  
	
   done	
  	
  	
  	
  chan	
  struct{}	
  
	
   stop	
  	
  	
  	
  chan	
  struct{}	
  
}	
  
func	
  main()	
  {	
  
	
   done	
  :=	
  make(chan	
  struct{})	
  
	
   stop	
  :=	
  make(chan	
  struct{})	
  
	
   s	
  :=	
  &Server{done:	
  done,	
  stop:	
  stop,	
  
hoge:	
  hoge}	
  
	
   go	
  s.run()	
  
	
   s.channel	
  <-­‐	
  struct{}{}	
  
	
   osutil.RegisterInterrputHandler(s.Stop)	
  
	
   <-­‐s.done	
  
}
func	
  (s	
  *Server)	
  run()	
  {	
  
	
   defer	
  func()	
  {	
  close(s.done)	
  }()	
  
	
   for	
  {	
  
	
   	
   select	
  {	
  
	
   	
   case	
  <-­‐s.channel:	
  
	
   	
   	
   fmt.Println("do	
  something")	
  
	
   	
   case	
  <-­‐s.stop:	
  
	
   	
   	
   return	
  
	
   	
   }	
  
	
   }	
  
}	
  
func	
  (s	
  *S)	
  Stop()	
  {	
  
	
   select	
  {	
  
	
   case	
  s.stop	
  <-­‐	
  struct{}{}:	
  
	
   case	
  <-­‐s.done:	
  
	
   	
   return	
  
	
   }	
  
	
   <-­‐s.done	
  
}	
  
Test goroutine easily
"s.done" channel makes testing goroutine easily
//	
  https://github.com/coreos/etcd/blob/master/etcdserver/
server_test.go#L1031	
  
//	
  TestPublishRetry	
  tests	
  that	
  publish	
  will	
  keep	
  retry	
  until	
  success.	
  
func	
  TestPublishRetry(t	
  *testing.T)	
  {	
  
	
   n	
  :=	
  &nodeRecorder{}	
  
	
   srv	
  :=	
  &EtcdServer{	
  
	
   	
   cfg:	
  	
  	
  	
  	
  	
  &ServerConfig{TickMs:	
  1},	
  
	
   	
   r:	
  	
  	
  	
  	
  	
  	
  	
  raftNode{Node:	
  n},	
  
	
   	
   w:	
  	
  	
  	
  	
  	
  	
  	
  &waitRecorder{},	
  
	
   	
   done:	
  	
  	
  	
  	
  make(chan	
  struct{}),	
  
	
   	
   reqIDGen:	
  idutil.NewGenerator(0,	
  time.Time{}),	
  
	
   }	
  
	
   time.AfterFunc(500*time.Microsecond,	
  func()	
  {	
  close(srv.done)	
  })	
  
	
   srv.publish(10	
  *	
  time.Nanosecond)	
  
Run go as Docker container
• Go single binary with "SCRATCH"
• You can run a go stuff inside extremely simple container!
FROM	
  scratch	
  
EXPOSE	
  8080	
  
COPY	
  your-­‐golang-­‐app	
  /app/your-­‐golang-­‐app	
  
ENV	
  PATH=/app:$PATH	
  
ENTRYPOINT	
  ["/app/your-­‐golang-­‐app"]	
  
CMD	
  ["-­‐some-­‐option=haha"]
Round up
• Learned a lot of stuffs from well-knowned products
(coreos/etcd)
• project structure, test, golang-way
See you next kyobashi.*!
• 9/7: kyobashi.dex
• 9/16: potatotips
• ???: kyobashi.???

Contenu connexe

Tendances

Utilizing Powerful Extensions for Analytics and Operations
Utilizing Powerful Extensions for Analytics and OperationsUtilizing Powerful Extensions for Analytics and Operations
Utilizing Powerful Extensions for Analytics and OperationsNeo4j
 
Higher Order Components and Render Props
Higher Order Components and Render PropsHigher Order Components and Render Props
Higher Order Components and Render PropsNitish Phanse
 
GeeCON 2014 - Functional Programming without Lambdas
GeeCON 2014 - Functional Programming without LambdasGeeCON 2014 - Functional Programming without Lambdas
GeeCON 2014 - Functional Programming without LambdasMattias Severson
 
Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...
Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...
Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...GeeksLab Odessa
 
lldb – Debugger auf Abwegen
lldb – Debugger auf Abwegenlldb – Debugger auf Abwegen
lldb – Debugger auf Abwegeninovex GmbH
 
Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)Nikki Attea
 
Common mistakes functional java vjug
Common mistakes functional java vjugCommon mistakes functional java vjug
Common mistakes functional java vjugBrian Vermeer
 
Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018Brian Vermeer
 
Transducers in JavaScript
Transducers in JavaScriptTransducers in JavaScript
Transducers in JavaScriptPavel Forkert
 
Scu scsi-summary
Scu scsi-summaryScu scsi-summary
Scu scsi-summaryjmichel99
 
Flux and InfluxDB 2.0
Flux and InfluxDB 2.0Flux and InfluxDB 2.0
Flux and InfluxDB 2.0InfluxData
 
Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18Brian Vermeer
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event LoopDesignveloper
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating languagejgrahamc
 
Async data pipelines for client-side JavaScript
Async data pipelines for client-side JavaScriptAsync data pipelines for client-side JavaScript
Async data pipelines for client-side JavaScriptIsmael Celis
 
Os Fetterupdated
Os FetterupdatedOs Fetterupdated
Os Fetterupdatedoscon2007
 

Tendances (20)

Utilizing Powerful Extensions for Analytics and Operations
Utilizing Powerful Extensions for Analytics and OperationsUtilizing Powerful Extensions for Analytics and Operations
Utilizing Powerful Extensions for Analytics and Operations
 
Higher Order Components and Render Props
Higher Order Components and Render PropsHigher Order Components and Render Props
Higher Order Components and Render Props
 
GeeCON 2014 - Functional Programming without Lambdas
GeeCON 2014 - Functional Programming without LambdasGeeCON 2014 - Functional Programming without Lambdas
GeeCON 2014 - Functional Programming without Lambdas
 
Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...
Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...
Java/Scala Lab: Руслан Шевченко - Implementation of CSP (Communication Sequen...
 
High Performance tDiary
High Performance tDiaryHigh Performance tDiary
High Performance tDiary
 
lldb – Debugger auf Abwegen
lldb – Debugger auf Abwegenlldb – Debugger auf Abwegen
lldb – Debugger auf Abwegen
 
Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)
 
Common mistakes functional java vjug
Common mistakes functional java vjugCommon mistakes functional java vjug
Common mistakes functional java vjug
 
Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018
 
Transducers in JavaScript
Transducers in JavaScriptTransducers in JavaScript
Transducers in JavaScript
 
Scu scsi-summary
Scu scsi-summaryScu scsi-summary
Scu scsi-summary
 
Elixir @ Paris.rb
Elixir @ Paris.rbElixir @ Paris.rb
Elixir @ Paris.rb
 
Flux and InfluxDB 2.0
Flux and InfluxDB 2.0Flux and InfluxDB 2.0
Flux and InfluxDB 2.0
 
Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
Adb instructions
Adb instructionsAdb instructions
Adb instructions
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating language
 
Async data pipelines for client-side JavaScript
Async data pipelines for client-side JavaScriptAsync data pipelines for client-side JavaScript
Async data pipelines for client-side JavaScript
 
Os Fetterupdated
Os FetterupdatedOs Fetterupdated
Os Fetterupdated
 

En vedette

このあと滅茶苦茶LGTMした
このあと滅茶苦茶LGTMしたこのあと滅茶苦茶LGTMした
このあと滅茶苦茶LGTMしたshinnosuke kugimiya
 
Performance Monitoring for Docker Environments - Docker Amsterdam June Meetup
Performance Monitoring for Docker Environments - Docker Amsterdam June MeetupPerformance Monitoring for Docker Environments - Docker Amsterdam June Meetup
Performance Monitoring for Docker Environments - Docker Amsterdam June MeetupStijn Polfliet
 
Discussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machinesDiscussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machinesSteven Grzbielok
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios
 
Running Netflix OSS on Docker with Nirmata
Running Netflix OSS on Docker with NirmataRunning Netflix OSS on Docker with Nirmata
Running Netflix OSS on Docker with NirmataDamien Toledo
 
Docker Indy Meetup Monitoring 30-Aug-2016
Docker Indy Meetup Monitoring 30-Aug-2016Docker Indy Meetup Monitoring 30-Aug-2016
Docker Indy Meetup Monitoring 30-Aug-2016Matt Bentley
 
Netflix and Containers: Not A Stranger Thing
Netflix and Containers:  Not A Stranger ThingNetflix and Containers:  Not A Stranger Thing
Netflix and Containers: Not A Stranger Thingaspyker
 
Microservices with Netflix OSS and Spring Cloud - Dev Day Orange
Microservices with Netflix OSS and Spring Cloud -  Dev Day OrangeMicroservices with Netflix OSS and Spring Cloud -  Dev Day Orange
Microservices with Netflix OSS and Spring Cloud - Dev Day Orangeacogoluegnes
 
NetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker TalkNetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker Talkaspyker
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Christian Posta
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftChristian Posta
 
Goだけでモバイルアプリを作る
Goだけでモバイルアプリを作るGoだけでモバイルアプリを作る
Goだけでモバイルアプリを作るTakuya Ueda
 
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...Docker, Inc.
 
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...Docker, Inc.
 
Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok   Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok Docker, Inc.
 
Docker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker, Inc.
 
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy LimBuild Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy LimDocker, Inc.
 

En vedette (20)

このあと滅茶苦茶LGTMした
このあと滅茶苦茶LGTMしたこのあと滅茶苦茶LGTMした
このあと滅茶苦茶LGTMした
 
cert
certcert
cert
 
Performance Monitoring for Docker Environments - Docker Amsterdam June Meetup
Performance Monitoring for Docker Environments - Docker Amsterdam June MeetupPerformance Monitoring for Docker Environments - Docker Amsterdam June Meetup
Performance Monitoring for Docker Environments - Docker Amsterdam June Meetup
 
Gobotについて
GobotについてGobotについて
Gobotについて
 
Discussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machinesDiscussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machines
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
Running Netflix OSS on Docker with Nirmata
Running Netflix OSS on Docker with NirmataRunning Netflix OSS on Docker with Nirmata
Running Netflix OSS on Docker with Nirmata
 
Docker Indy Meetup Monitoring 30-Aug-2016
Docker Indy Meetup Monitoring 30-Aug-2016Docker Indy Meetup Monitoring 30-Aug-2016
Docker Indy Meetup Monitoring 30-Aug-2016
 
Netflix and Containers: Not A Stranger Thing
Netflix and Containers:  Not A Stranger ThingNetflix and Containers:  Not A Stranger Thing
Netflix and Containers: Not A Stranger Thing
 
Microservices with Netflix OSS and Spring Cloud - Dev Day Orange
Microservices with Netflix OSS and Spring Cloud -  Dev Day OrangeMicroservices with Netflix OSS and Spring Cloud -  Dev Day Orange
Microservices with Netflix OSS and Spring Cloud - Dev Day Orange
 
NetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker TalkNetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker Talk
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes
 
Microservices and APIs
Microservices and APIsMicroservices and APIs
Microservices and APIs
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShift
 
Goだけでモバイルアプリを作る
Goだけでモバイルアプリを作るGoだけでモバイルアプリを作る
Goだけでモバイルアプリを作る
 
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
 
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
 
Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok   Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok
 
Docker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott Coulton
 
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy LimBuild Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
 

Similaire à Writing Docker monitoring agent with Go

Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
Go Concurrency Patterns
Go Concurrency PatternsGo Concurrency Patterns
Go Concurrency PatternsElifTech
 
用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構Bo-Yi Wu
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfOrtus Solutions, Corp
 
こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門tanacasino
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleSaúl Ibarra Corretgé
 
Beyond parallelize and collect - Spark Summit East 2016
Beyond parallelize and collect - Spark Summit East 2016Beyond parallelize and collect - Spark Summit East 2016
Beyond parallelize and collect - Spark Summit East 2016Holden Karau
 
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
NDC Sydney 2019 - Async Demystified -- Karel ZikmundNDC Sydney 2019 - Async Demystified -- Karel Zikmund
NDC Sydney 2019 - Async Demystified -- Karel ZikmundKarel Zikmund
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scalaRuslan Shevchenko
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of GoFrank Müller
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015Michiel Borkent
 
Lego: A brick system build by scala
Lego: A brick system build by scalaLego: A brick system build by scala
Lego: A brick system build by scalalunfu zhong
 
Concurrency in go
Concurrency in goConcurrency in go
Concurrency in goborderj
 
Reitit - Clojure/North 2019
Reitit - Clojure/North 2019Reitit - Clojure/North 2019
Reitit - Clojure/North 2019Metosin Oy
 
Building a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and SparkBuilding a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and SparkEvan Chan
 
Go Web Development
Go Web DevelopmentGo Web Development
Go Web DevelopmentCheng-Yi Yu
 

Similaire à Writing Docker monitoring agent with Go (20)

Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Go Concurrency Patterns
Go Concurrency PatternsGo Concurrency Patterns
Go Concurrency Patterns
 
用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
 
こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio module
 
Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI
 
Using zone.js
Using zone.jsUsing zone.js
Using zone.js
 
Beyond parallelize and collect - Spark Summit East 2016
Beyond parallelize and collect - Spark Summit East 2016Beyond parallelize and collect - Spark Summit East 2016
Beyond parallelize and collect - Spark Summit East 2016
 
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
NDC Sydney 2019 - Async Demystified -- Karel ZikmundNDC Sydney 2019 - Async Demystified -- Karel Zikmund
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scala
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
 
Lego: A brick system build by scala
Lego: A brick system build by scalaLego: A brick system build by scala
Lego: A brick system build by scala
 
Concurrency in go
Concurrency in goConcurrency in go
Concurrency in go
 
Reitit - Clojure/North 2019
Reitit - Clojure/North 2019Reitit - Clojure/North 2019
Reitit - Clojure/North 2019
 
Building a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and SparkBuilding a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and Spark
 
Java 8
Java 8Java 8
Java 8
 
Go Web Development
Go Web DevelopmentGo Web Development
Go Web Development
 

Dernier

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Dernier (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

Writing Docker monitoring agent with Go

  • 2. About me • Naoki Ainoya( ainoya) • iOS(new!)/Server/Infra engineer • Swift/Scala/Go/Docker • Recruit Marketing Partners Co, Ltd.
  • 3. A tiny deployment pipeline tool Written in Go walter-cd/walter Open source project
  • 4. Introduction of Fune • An event emitter triggered by Docker Event API • The agent process (fune-agent) communicates with docker daemon via its socket • https://github.com/ainoya/fune Docker daemon Funeagent ConttainerA ConttainerB ConttainerC Nginx/Redis vulcand(etcd) Slack notification etc.. Listens docker events API notifies each containers are created/died/stopped/started Emits pluggable actions Your arbitrary docker ecosystem ECS/k8s/fleet/etc.. Docker Host Deploy containers
  • 5. Overview of Fune • Docker Events API provides a lifecycle of container as JSON format • create/start/die/stop
  • 6. Overview of Fune fune-agent listens these events Docker daemon Funeagent ConttainerA ConttainerB ConttainerC Listens docker events API notifies each containers are created/died/stopped/started Your arbitrary docker ecosystem ECS/k8s/fleet/etc.. Docker Host Deploy containers
  • 7. Overview of Fune fune-agent emits Action
 when received Docker events
 from event Docker daemon Funeagent ConttainerA ConttainerB Nginx/Redis vulcand(etcd) Slack notification etc.. Listens docker events API notifies each containers are created/died/stopped/started Emits pluggable actions Your arbitrary docker ecosystem ECS/k8s/fleet/etc.. Docker Host Deploy containers
  • 8. Overview of Fune Docker daemon Funeagent ConttainerA ConttainerB Nginx/Redis vulcand(etcd) Slack notification etc.. Listens docker events API notifies each containers are created/died/stopped/started Emits pluggable actions Your arbitrary docker ecosystem ECS/k8s/fleet/etc.. Docker Host Deploy containers • Action, for example; • Set/Del a container information to Redis as FQDN/IP:Port pair for proxy • Slack notification • More details are next time :)
  • 9. Today I talk about: • Some tips I learned with writing fune • Studied a lot of stuffs from coreos/etcd
  • 10. Setup project • Standard structure for 
 working with Godeps correctly • /src/github.com/ainoya/fune ./${GOPATH}/src !"" 9fans.net #   %"" go !"" code.google.com #   %"" p !"" github.com #   !"" ainoya/fune #   !"" barakmich #   !"" coreos etc...
  • 11. Godeps for the package dependencies • Using Godeps once, all dependencies copied into directory and rewrite import statement • Then you need Godeps command only if package dependency is added import "github.com/fsouza/go-dockerclient" // after `Godep save -r ./…` import "github.com/ainoya/fune/Godeps/_workspace/ src/github.com/fsouza/go-dockerclient"
  • 12. Godeps for the package dependencies • All dependencies are included in git repos • But it makes dirty commit log!! • Keep off its dirtiness by split commits :)
  • 13. How about vendor feature in go1.5? • go1.5 vendor feature have some problems yet • ex) go  tool  "./…" doesn't works well • https://github.com/golang/go/issues/11659 • See also ) http://deeeet.com/writing/2015/06/26/golang-dependency- vendoring/
  • 14. Write tests • Rerun automatically if files are changed • rerun is awesome! (but ruby tool gem) rerun -x -c -d directory1, directory2,... —pattern '**/*.{go}' -- go test ./...
  • 15. Be careful about race condition • Test with "-­‐race" option if you often use goroutine in your code • "-­‐cpu  N" option may reveal race condition you didn't expected • I use "go  test  ./…  -­‐race  -­‐cpu  1,2,4" inside test script WARNING: DATA RACE Write by goroutine 8: sync.raceWrite() /usr/local/Cellar/go/1.5/libexec/src/sync/race.go:41 +0x2e sync.(*WaitGroup).Wait() /usr/local/Cellar/go/1.5/libexec/src/sync/waitgroup.go:124 +0xf9 github.com/ainoya/fune/emitter.TestBroadCast() /Users/ainoya/.go/src/github.com/ainoya/fune/gopath/src/github.com/ ainoya/fune/emitter/emitter_test.go:57 +0x444 testing.tRunner() /usr/local/Cellar/go/1.5/libexec/src/testing/testing.go:456 +0xdc
  • 16. Is Go1.5 compilation time slower than 1.4? • "go  test" obviously takes time much longer • It's probably because of GoGo compiler performance
 Ref) Performance section of https://golang.org/doc/go1.5 • It should be improved with Go1.6
  • 17. Channel tips • coreos/etcd implements a shutdown feature with using close(channel) type  Server  struct  {     name        string     channel  chan  struct{}     done        chan  struct{}     stop        chan  struct{}   }   func  main()  {     done  :=  make(chan  struct{})     stop  :=  make(chan  struct{})     s  :=  &Server{done:  done,  stop:  stop,   hoge:  hoge}     go  s.run()     s.channel  <-­‐  struct{}{}     osutil.RegisterInterrputHandler(s.Stop)     <-­‐s.done   } func  (s  *Server)  run()  {     defer  func()  {  close(s.done)  }()     for  {       select  {       case  <-­‐s.channel:         fmt.Println("do  something")       case  <-­‐s.stop:         return       }     }   }   func  (s  *S)  Stop()  {     select  {     case  s.stop  <-­‐  struct{}{}:     case  <-­‐s.done:       return     }     <-­‐s.done   }  
  • 18. Channel tips • coreos/etcd implements a shutdown feature with using close(channel) type  Server  struct  {     name        string     channel  chan  struct{}     done        chan  struct{}     stop        chan  struct{}   }   func  main()  {     done  :=  make(chan  struct{})     stop  :=  make(chan  struct{})     s  :=  &Server{done:  done,  stop:  stop,   hoge:  hoge}     go  s.run()     s.channel  <-­‐  struct{}{}     osutil.RegisterInterrputHandler(s.Stop)     <-­‐s.done   } func  (s  *Server)  run()  {     defer  func()  {  close(s.done)  }()     for  {       select  {       case  <-­‐s.channel:         fmt.Println("do  something")       case  <-­‐s.stop:         return       }     }   }   func  (s  *S)  Stop()  {     select  {     case  s.stop  <-­‐  struct{}{}:     case  <-­‐s.done:       return     }     <-­‐s.done   }  
  • 19. Channel tips • coreos/etcd implements a shutdown feature with using close(channel) type  Server  struct  {     name        string     channel  chan  struct{}     done        chan  struct{}     stop        chan  struct{}   }   func  main()  {     done  :=  make(chan  struct{})     stop  :=  make(chan  struct{})     s  :=  &Server{done:  done,  stop:  stop,   hoge:  hoge}     go  s.run()     s.channel  <-­‐  struct{}{}     osutil.RegisterInterrputHandler(s.stop)     <-­‐s.done   } func  (s  *Server)  run()  {     defer  func()  {  close(s.done)  }()     for  {       select  {       case  <-­‐s.channel:         fmt.Println("do  something")       case  <-­‐s.stop:         return       }     }   }   func  (s  *S)  Stop()  {     select  {     case  s.stop  <-­‐  struct{}{}:     case  <-­‐s.done:       return     }     <-­‐s.done   }  
  • 20. Channel tips • coreos/etcd implements a shutdown feature with using close(channel) type  Server  struct  {     name        string     channel  chan  struct{}     done        chan  struct{}     stop        chan  struct{}   }   func  main()  {     done  :=  make(chan  struct{})     stop  :=  make(chan  struct{})     s  :=  &Server{done:  done,  stop:  stop,   hoge:  hoge}     go  s.run()     s.channel  <-­‐  struct{}{}     osutil.RegisterInterrputHandler(s.Stop)     <-­‐s.done   } func  (s  *Server)  run()  {     defer  func()  {  close(s.done)  }()     for  {       select  {       case  <-­‐s.channel:         fmt.Println("do  something")       case  <-­‐s.stop:         return       }     }   }   func  (s  *S)  Stop()  {     select  {     case  s.stop  <-­‐  struct{}{}:     case  <-­‐s.done:       return     }     <-­‐s.done   }  
  • 21. Channel tips • coreos/etcd implements a shutdown feature with using close(channel) type  Server  struct  {     name        string     channel  chan  struct{}     done        chan  struct{}     stop        chan  struct{}   }   func  main()  {     done  :=  make(chan  struct{})     stop  :=  make(chan  struct{})     s  :=  &Server{done:  done,  stop:  stop,   hoge:  hoge}     go  s.run()     s.channel  <-­‐  struct{}{}     osutil.RegisterInterrputHandler(s.Stop)     <-­‐s.done   } func  (s  *Server)  run()  {     defer  func()  {  close(s.done)  }()     for  {       select  {       case  <-­‐s.channel:         fmt.Println("do  something")       case  <-­‐s.stop:         return       }     }   }   func  (s  *S)  Stop()  {     select  {     case  s.stop  <-­‐  struct{}{}:     case  <-­‐s.done:       return     }     <-­‐s.done   }  
  • 22. Test goroutine easily "s.done" channel makes testing goroutine easily //  https://github.com/coreos/etcd/blob/master/etcdserver/ server_test.go#L1031   //  TestPublishRetry  tests  that  publish  will  keep  retry  until  success.   func  TestPublishRetry(t  *testing.T)  {     n  :=  &nodeRecorder{}     srv  :=  &EtcdServer{       cfg:            &ServerConfig{TickMs:  1},       r:                raftNode{Node:  n},       w:                &waitRecorder{},       done:          make(chan  struct{}),       reqIDGen:  idutil.NewGenerator(0,  time.Time{}),     }     time.AfterFunc(500*time.Microsecond,  func()  {  close(srv.done)  })     srv.publish(10  *  time.Nanosecond)  
  • 23. Run go as Docker container • Go single binary with "SCRATCH" • You can run a go stuff inside extremely simple container! FROM  scratch   EXPOSE  8080   COPY  your-­‐golang-­‐app  /app/your-­‐golang-­‐app   ENV  PATH=/app:$PATH   ENTRYPOINT  ["/app/your-­‐golang-­‐app"]   CMD  ["-­‐some-­‐option=haha"]
  • 24. Round up • Learned a lot of stuffs from well-knowned products (coreos/etcd) • project structure, test, golang-way
  • 25. See you next kyobashi.*! • 9/7: kyobashi.dex • 9/16: potatotips • ???: kyobashi.???