Golang Skills
What we know so far…
Sofiane Imadali, Ayoub Bousselmi
21/02/2018
Agenda
 When, Why and How ?
 Golang Projects
 Play-with-Docker (open source project)
 VNF API (open source project from scratch)
 Wall and Wall API (open source project, api from scratch)
 Clutch (open source project, from scratch)
 Prometheus Integration (exporters development)
 Next steps…
 Kubernetes and CRD
2/21/2019 Golang Skills 2
When, Why and How ?
2/21/2019 Golang Skills 3
When, Why and How ?
2/21/2019 Golang Skills 4
When
 2016
 Go version: 1.7
Why
 Docker
 RANaaS project: beego based Swagger API (OpenAPI)
 integrations with MangoDB
 fake data generator like Joke2k/faker in Python:
When, Why and How ?
2/21/2019 Golang Skills 5
When
 2017
 Go version: 1.7, 1.8, 1.9
Why
 Docker with Play-with-Docker project
 Wall and Wall API
 VNF API to integrate Dockerized OpenAirInterface
 AccessPoint API to integrate with hostapd and dhcpd
When, Why and How ?
2/21/2019 Golang Skills 6
When
 2018
 Go version: 1.8, 1.9, 1.10
Why
 Docker with Play-with-Docker project
 Docker-machine driver for the PlayGround (PWD)
 Clutch: metrics exporter from PCP to Kafka
 All exporters with Prometheus (Web, Postgres),
Alertmanager
 GitTar: git clone from a repo (for CI)
Golang Projects
2/21/2019 Golang Skills 7
Play-with-Docker
2/21/2019 Golang Skills 8
Goal
 Ephemeral environment to play with docker
 Part of the Plug’in sandbox
Implementation
 Gorilla Mux: API routes and handlers
 Docker SDK (official API from github)
 HTML/CSS/JavaScript/WebSockets
connected to golang backend
Main libraries
 gorilla/mux
 docker/docker/api
 prometheus/promhttp
Links
 https://gitlab.forge.orange-labs.fr/lucy/playground
Docker Machine Driver
2/21/2019 Golang Skills 9
Goal
 Use docker-machine to interact with
PlayGround
 Create containers (DINDs) in the PlayGround
Implementation
 Docker-machine SDK
Main libraries
 docker/machine
Links
 https://gitlab.forge.orange-labs.fr/lucy/playground-driver
VNF API
2/21/2019 Golang Skills 10
Goal
 Wrap binaries and make them HTTP
attainable
 Inspired by Ligato project
Implementation
 Gin-gonik for swagger API
 Logrus for logging
 Templating for different configurations
Main libraries
 sirupsen/logrus
 gin-gonic/gin
 savaki/swag
Links
 https://www.sdxcentral.com/products/ligato/
Wall and Wall API
2/21/2019 Golang Skills 11
Goal
 Make something like Gist (Github) for the
Sandbox users
Implementation
 Jekyll + Nginx
 Golang based API + Templating for posts
Main libraries
 gorilla/mux + gorilla/handlers
 urfave/negroni
Links
 https://gitlab.forge.orange-labs.fr/lucy/wall-api
 https://gitlab.forge.orange-labs.fr/lucy/wall
Clutch
2/21/2019 Golang Skills 12
Goal
 Create small probe to extract metrics from
PCP to Kafka
Implementation
 Kafka and PCP integration
 Logrus for logging
 Viper for configuration management
Main libraries
 Shopify/sarama
 sirupsen/logrus
 spf13/viper
Links
 https://gitlab.forge.orange-labs.fr/tqwt7730/clutch
Prometheus Integration
2/21/2019 Golang Skills 13
Goal
 Export metrics from PlayGround to
Prometheus
 Create an observable deployment on
OpenWatt
Implementation
 Using official golang Http client
 Rebuild Docker images from source code
Main libraries
 prometheus/promhttp
Links
 https://gitlab.forge.orange-labs.fr/tqwt7730/prom-bbe
GitTar
2/21/2019 Golang Skills 14
Goal
 Clone a git project from remote repo
 Use BasicAuth credentials
Implementation
 Swagger REST API
 Combine with AtomDocs (Sandbox) for
documentation CI/CD
Main libraries
 gopkg.in/src-d/go-git.v4
 gin-gonic/gin
 savaki/swag
Links
 https://gitlab.forge.orange-labs.fr/tqwt7730/gittar
Beego
2/21/2019 Golang Skills 15
Goal
 Create an API for integration for the Radio
Access Network as a Service (RANaaS) project
Implementation
 Generate basic REST API micro-service
skeleton
Main libraries
 astaxie/beego
Links
 https://beego.me/
Next steps…
2/21/2019 Golang Skills 16
Kubernetes and CRD
2/21/2019 Golang Skills 17
 Play with Kubernetes
 https://github.com/play-with-docker/play-with-docker/tree/k8s
 Deploy K8S using Vagrant
 https://github.com/sofianinho/vagrant-kube
 CRD: we can collaborate !
 Operator Framework:
https://github.com/operator-framework
Thanks
sofiane.imadali@orange.com
ayoub.bousselmi@orange.com

Golang skills pre-session

  • 1.
    Golang Skills What weknow so far… Sofiane Imadali, Ayoub Bousselmi 21/02/2018
  • 2.
    Agenda  When, Whyand How ?  Golang Projects  Play-with-Docker (open source project)  VNF API (open source project from scratch)  Wall and Wall API (open source project, api from scratch)  Clutch (open source project, from scratch)  Prometheus Integration (exporters development)  Next steps…  Kubernetes and CRD 2/21/2019 Golang Skills 2
  • 3.
    When, Why andHow ? 2/21/2019 Golang Skills 3
  • 4.
    When, Why andHow ? 2/21/2019 Golang Skills 4 When  2016  Go version: 1.7 Why  Docker  RANaaS project: beego based Swagger API (OpenAPI)  integrations with MangoDB  fake data generator like Joke2k/faker in Python:
  • 5.
    When, Why andHow ? 2/21/2019 Golang Skills 5 When  2017  Go version: 1.7, 1.8, 1.9 Why  Docker with Play-with-Docker project  Wall and Wall API  VNF API to integrate Dockerized OpenAirInterface  AccessPoint API to integrate with hostapd and dhcpd
  • 6.
    When, Why andHow ? 2/21/2019 Golang Skills 6 When  2018  Go version: 1.8, 1.9, 1.10 Why  Docker with Play-with-Docker project  Docker-machine driver for the PlayGround (PWD)  Clutch: metrics exporter from PCP to Kafka  All exporters with Prometheus (Web, Postgres), Alertmanager  GitTar: git clone from a repo (for CI)
  • 7.
  • 8.
    Play-with-Docker 2/21/2019 Golang Skills8 Goal  Ephemeral environment to play with docker  Part of the Plug’in sandbox Implementation  Gorilla Mux: API routes and handlers  Docker SDK (official API from github)  HTML/CSS/JavaScript/WebSockets connected to golang backend Main libraries  gorilla/mux  docker/docker/api  prometheus/promhttp Links  https://gitlab.forge.orange-labs.fr/lucy/playground
  • 9.
    Docker Machine Driver 2/21/2019Golang Skills 9 Goal  Use docker-machine to interact with PlayGround  Create containers (DINDs) in the PlayGround Implementation  Docker-machine SDK Main libraries  docker/machine Links  https://gitlab.forge.orange-labs.fr/lucy/playground-driver
  • 10.
    VNF API 2/21/2019 GolangSkills 10 Goal  Wrap binaries and make them HTTP attainable  Inspired by Ligato project Implementation  Gin-gonik for swagger API  Logrus for logging  Templating for different configurations Main libraries  sirupsen/logrus  gin-gonic/gin  savaki/swag Links  https://www.sdxcentral.com/products/ligato/
  • 11.
    Wall and WallAPI 2/21/2019 Golang Skills 11 Goal  Make something like Gist (Github) for the Sandbox users Implementation  Jekyll + Nginx  Golang based API + Templating for posts Main libraries  gorilla/mux + gorilla/handlers  urfave/negroni Links  https://gitlab.forge.orange-labs.fr/lucy/wall-api  https://gitlab.forge.orange-labs.fr/lucy/wall
  • 12.
    Clutch 2/21/2019 Golang Skills12 Goal  Create small probe to extract metrics from PCP to Kafka Implementation  Kafka and PCP integration  Logrus for logging  Viper for configuration management Main libraries  Shopify/sarama  sirupsen/logrus  spf13/viper Links  https://gitlab.forge.orange-labs.fr/tqwt7730/clutch
  • 13.
    Prometheus Integration 2/21/2019 GolangSkills 13 Goal  Export metrics from PlayGround to Prometheus  Create an observable deployment on OpenWatt Implementation  Using official golang Http client  Rebuild Docker images from source code Main libraries  prometheus/promhttp Links  https://gitlab.forge.orange-labs.fr/tqwt7730/prom-bbe
  • 14.
    GitTar 2/21/2019 Golang Skills14 Goal  Clone a git project from remote repo  Use BasicAuth credentials Implementation  Swagger REST API  Combine with AtomDocs (Sandbox) for documentation CI/CD Main libraries  gopkg.in/src-d/go-git.v4  gin-gonic/gin  savaki/swag Links  https://gitlab.forge.orange-labs.fr/tqwt7730/gittar
  • 15.
    Beego 2/21/2019 Golang Skills15 Goal  Create an API for integration for the Radio Access Network as a Service (RANaaS) project Implementation  Generate basic REST API micro-service skeleton Main libraries  astaxie/beego Links  https://beego.me/
  • 16.
  • 17.
    Kubernetes and CRD 2/21/2019Golang Skills 17  Play with Kubernetes  https://github.com/play-with-docker/play-with-docker/tree/k8s  Deploy K8S using Vagrant  https://github.com/sofianinho/vagrant-kube  CRD: we can collaborate !  Operator Framework: https://github.com/operator-framework
  • 18.