SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Things in Flow | Helping teams and individuals to get things done in flow
Things in Flow
How to autodeploy your R solution
to DigitalOcean using
Docker, GitHub and CircleCI
CopenhagenR - useR Group Meetup

IT University of Copenhagen, Oct. 11 2016

Presenter: Niels Ole Dam, Things in Flow
Things in Flow | Helping teams and individuals to get things done in
Things in Flow
Things in Flow
About me
• Physics and Communications at Roskilde University
• Previously:
• Project Manager at Experimentarium science center
• Science Journalist at Illustrated Science magazine
• Digital Business Developer at Bonnier Publications
• Project Manager and Drupal Teamlead at Peytz & Co
• Games Producer at Cape Cph
• Since 2014:
• Independent consultant at Things in Flow
• I collect tools and help people get their stuff done digitally and with the
right amount of efficient processes so that the work still feels right
2
Things in Flow
Coursera courses to recommend
• Data Science Specialisation by Johns Hopkins University
• I did 8 of them a couple of years ago – they where great.
• Process Mining by Eindhoven University of Technology
• I did this one too – and I’m actually an official Disco partner.
• By The Way:
• I’m currently looking for a good Process Mining case.
• Please contact me if you have that kind of log file data and
business itch that needs scratching.
3
Tip: All underlined links are clickable in
the pdf-version of this slideshow –
click to get more info on the subjects.
Things in Flow
Why I chose R
• Feel the raw data under my fingertips (again)
• Visualie raw data
• Deliver prototypes to colleagues/clients
• Deliver widely available solutions to clients
• Bonus: Test new tools without polluting my computer
4
Things in Flow
Why I chose Docker
• Production ready for teams and small companies
• Makes it possible to follow the Continuous Integration (CI)
paradigme in my own production
• Open Source – dedication and low cost
• Docker with R is Awesome! :-)
5
Hang on!
A lot of steps and things to grasp
but easy to execute in practice
;-)
Things in Flow
Ingredients to shop for
• GitHub account:
• Free if Open Source – otherwise starting at $7/mo
• Docker Hub account (optional):
• Free if Open Source and only 1 private account, otherwise starting at $7/mo
• CircleCI:
• Free if Linux and only 1 container – otherwise starting at $39-50/mo
• R + RStudio locally:
• Free
• Cloud Server:
• Variable, typically starting at $5/mo
• Total:
• Starting with Free (Open Source) or $7/m (1 private project) + Cloud server
7
GitHub
+
RStudio
Things in Flow
GitHub: How it works
• Clone code from GitHub
• Commit your own changes
• Git keeps track on additions and removals automatically
• Push your code back to GitHub
9
Source: betterexplained.com
Things in Flow
Using Git with RStudio
• Create a repo at GitHub
• Clone the repo to a local RStudio project
• Commit to GitHub regularly using RStudio
Use branching for trying out alternative solutions:
• Open a terminal via the RStudio-link and run:
git checkout -b [branchname]
• …do your stuff with local commits…
• Switch to Master, open a terminal via the RStudio-link and run:
git merge --no-ff [branchname]
• …the branch is now merged back into master with all it’s Git history…
10
Things in Flow
Demo 1: GitHub + RStudio
• Connect RStudio project with GitHub
• Make a RStudio Shiny App project
• Make some code changes
• Push changes to GitHub repo
• Optional: Make a local branch
11
Things in Flow
New GitHub repo
12
Copy and use for RStudio
Things in Flow
Create new
RStudio project
13
Things in Flow
RStudio is now connected with GitHub
14
Docker
Things in Flow
Docker: How it works
16
Traditional Virtual Machines:
Full OS for each VM
Docker:
OS code is partly shared
Things in Flow
The ideal Docker workflow
17
Source: docker.com
Things in Flow
Another take on the same
18
Source: terranillius.com
Things in Flow
Using Docker
• Install and start Docker for Mac (or Windows)
• Verify that Docker is running
• Search for Docker images on Docker Hub
• … either via http://dockerhub.com
• …or via Kitematic (installed as part of Docker for Mac)
• Start your first Docker container i.e. hello-world-nginx
• You are now running Docker locally
19
Things in Flow
Demo 2: Deploy Shiny App on local VM
• Start Docker for Mac (or Windows)
• Verify that Docker is now running
• Add Dockerfile to project
• Add docker-compose.yml file to project
• Open terminal via RStudio-link
• Run: docker-compose up -d
• Shiny App is now running on local Docker VM
• …and can be accessed via http://localhost
20
Things in Flow
Docker cheatsheet
docker run <container> <command>
docker run -v LOCAL_DIR:CONTAINER_DIR <container> <command>
docker exec -it <container_id> <command>
docker images
docker logs <container_id>
docker-compose up -d --build
docker-compose start
docker rmi [imageID]
docker ps [-a]
docker run ubuntu /bin/echo 'Hello world'
21
Things in Flow
Manage data in containers
• If you have some persistent data that you want to share
between containers, or want to use from non-persistent
containers, it’s best to create a named Data Volume Container,
and then to mount the data from it.



(from docker.com)
22
Things in Flow
Using Compose is basically a three-step process
1. Define your app’s environment with a Dockerfile so it can be
reproduced anywhere.
2. Define the services that make up your app in docker-
compose.yml so they can be run together in an isolated
environment.
3. Lastly, run docker-compose up and Compose will start and run
your entire app.



(from docker.com)
23
Things in Flow
Compose can mange the whole lifecycle
• Start, stop and rebuild services (start, stop, up, down)
• View the status of running services
• Stream the log output of running service (logs)
• Run a one-off command on a service (run)



(from docker.com)
24
Things in Flow
Volume data preserved when containers are created
• Compose preserves all volumes used by your services. When
docker-compose up runs, if it finds any containers from previous
runs, it copies the volumes from the old container to the new
container. This process ensures that any data you’ve created in
volumes isn’t lost.



(from docker.com)
25
Things in Flow
Moving Compose files between environments
• Compose supports variables in the Compose file. You can use
these variables to customize your composition for different
environments, or different users. See Variable substitution for
more details.
• You can extend a Compose file using the extends field or by
creating multiple Compose files. See extends for more details.



(from docker.com)
26
From Local to Cloud
Things in Flow
Cloud Deploy: How it works
28
Source: circleci.com
Things in Flow
The Workflow
29
bit.ly/R-Docker-workflow
R-Docker Workflow for teams and small companies
LocalLocalVM(Docker)Cloud(CircleCI/DigitalOcean)
v1, Niels Ole Dam, 5/10-2016
Start
Client
GitHub, Docker Hub and Cloud Server (i.e. DigitalOcean, Amazon, Azure etc.)
http://thingsinflow.dk/
Show/Hide
Messages
Develop
R solution +
test locally
Test
passed?
No
Test/fix on
local VM
Test
passed?
No
Setup initial
deploy to
Cloud
Deploy to
local VM
Test/iterate
with client
Test
passed?
No
Initial
solution
deployed
Build on
local VM
docker-composeup
Build on
Cloud
server
Develop,
test, verify
and deploy
docker-composeup
1. 2. 3.
Setup auto
deploy on
CircleCI
Solution
updated
4.
Switch prod
server
5.
6.
7.
GitHub Docker CircleCIRstudio
Project
Git
branch
bit.ly/R-Docker-workflow = clickabel version of this document
Docker Cheat Sheet:
- docker run <container> <command>
- docker run -v
LOCAL_DIR:CONTAINER_DIR<container>
<command>
- docker exec-it <container_id> <command>
- docker images
- docker logs<container_id>
- docker-composeup -d
- docker-composestart
- docker rmi [imageID]
- docker ps[-a]
- docker run ubuntu /bin/echo 'Hello world'
Request
solution
Request
change
Try out new
frameworks
on local VM
8.
Test
php/
Spark?
Click on the blue numbers or
doc icons for more info on that
step/subject.
CircleCI
(or Jenkins or TravisCI etc.)
Things in Flow
CircleCI: How it works
• Connects to GitHub
• Listens for any changes on a specific GitHub repo
• Looks for a circle.yml script in the root of the GitHub repo
• Runs the circle.yml script every time the repo changes
• Can be used for automatical running of:
• …code tests
• …docker image builds for Docker Hub
• …deployment(s) to Cloud server(s)
31
Things in Flow
Demo 3-4: Setup CircleCI for auto deploy
• CircleCI connects to GitHub and Cloud via environment
variables (=secure because credentials are not shown in code)
• Environment variables could be:
• $DOCKER_USER
• $DOCKER_PASS
• $DEPLOY_TOKEN
• $DOCKER_EMAIL
• Test that the circle.yml script is working as planned
• Now everything is set up for auto deploy on push to GitHub!
32
Things in Flow
Known issues with CircleCI
• Docker 1.12 is currently NOT supported by CircleCI
• Docker 1.10 is currently NOT installed out-of-the-box by
CircleCI! (=compose must be installed explicitly)
• But should not be a too big issue
• …if it is, then use TravisCI (or own Jenkins etc.) instead
33
Things in Flow
Demo 5-6: Auto deploy to DigitalOcean server
• Make a code change to the RStudio project
• Commit and push to Master (GitHub)
• Wait 10 min – you’ll also get a mail
• A new version of the cloud server has now been build on
DigitalOcean with a random IP
34
Things in Flow
Demo 7: Switch prod server and setup A record
• New cloud server has now been build
• Log into DigitalOcean controlpanel
• Switch the floating IP address from old to new server
• Requires: A subdomain (i.e. http://meetup.thingsinflow.dk) has
been setup on your website (A Record)
35
Things in Flow
Docker Swarm Mode: How it works
• 30 sec demo:
• www.johnzaccone.io/3-node-cluster-in-30-seconds/
• Using docker-compose with docker swarm
• https://docs.docker.com/compose/swarm/
• Swarm mode overview:
• https://docs.docker.com/engine/swarm/
36
Bonus:
Docker for local try outs
Things in Flow
Try out new frameworks safely
• Test out new frameworks in a local VM without:
• …risking the health of your main computer
• …messing with the initial configuration
• …thinking too much about documenting your steps
• Quickly test out new integrations
38
Things in Flow
Demo 8: Try out some images
• hello-world-nginx
• Jenkins
• php
• Java
• MySQL
• Spark
• Hadoop
• …
39
Summing Things Up
Things in Flow
Summing up: Steps needed
• Connect RStudio to GitHub – see this link at Preferences -> Git/SVN
• Make your Shiny App
• Add docker-compose.yml and/or Dockerfile
• Test Docker setup locally
• Connect GitHub to Docker Hub
• Connect Docker Hub to CircleCI (or other CI service)
• Connect CircelCI to a cloud server (i.e. Amazon, DigitalOcean)
• Push to GitHub and watch the magic unfold
Tips:
• Dockerfile and circle.yml: Use one-liners or shell script
• Beware of absolute vs. relative paths in all scripts
41
Things in Flow
Stuff not touched today
• Partly update of individual containers on cloud server via GitHub
and CircleCI (i.e. only on container at a time)
• Sharing of volumes between Docker container and local
machine
• How to add a nice html frontend page (index.html) ;-)
42
Things in Flow
Key Take Aways
• Docker is production ready for teams and small companies
• Docker makes it possible to use the Continuous Integration (CI)
paradigme for your R projects
• Docker with R is Awesome! :-)
43
Things in Flow
Links
• Getting started with Docker:
• http://www.docker.com/products/overview
• https://docs.docker.com/engine/getstarted/
• Manage Data in containers:
• https://docs.docker.com/engine/tutorials/dockervolumes/#/creating-
and-mounting-a-data-volume-container
• Docker Compose:
• https://docs.docker.com/compose/overview/
• Automated Docker Deployments with CircleCI:
• http://www.mikeheijmans.com/docker/2015/09/07/automated-docker-
deployment-with-circle/
• Continuous Integration and Delivery with Docker-CircleCI:
• https://circleci.com/docs/docker/
44
Things in Flow
Questions?
Things in Flow
Niels Ole Dam – nd@thingsinflow.dk
thingsinflow.dk – Mob. +45 2712 9314
Thanks! :-)
CopenhagenR - useR Group, Meetup at ITU, Oct. 11 2016
This presentation can be found at thingsinflow.dk/R-Docker-workflow

Más contenido relacionado

La actualidad más candente

Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realistsKarthik Gaekwad
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Patrick Chanezon
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersRyan Hodgin
 
Solving Real World Production Problems with Docker
Solving Real World Production Problems with DockerSolving Real World Production Problems with Docker
Solving Real World Production Problems with DockerMarc Campbell
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifeidotCloud
 
Are VM Passé?
Are VM Passé? Are VM Passé?
Are VM Passé? dotCloud
 
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17Mario-Leander Reimer
 
CI/CD with Kubernetes
CI/CD with KubernetesCI/CD with Kubernetes
CI/CD with KubernetesHart Hoover
 
Crash Course in Open Source Cloud Computing
Crash Course in Open Source Cloud Computing Crash Course in Open Source Cloud Computing
Crash Course in Open Source Cloud Computing Mark Hinkle
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwiliodotCloud
 
Rails Applications with Docker
Rails Applications with DockerRails Applications with Docker
Rails Applications with DockerLaura Frank Tacho
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQdotCloud
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOpsandersjanmyr
 
2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users Group2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users GroupTodd Fritz
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpdotCloud
 
Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015Jonas Rosland
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerJérôme Petazzoni
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)Eric D. Schabell
 

La actualidad más candente (20)

Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realists
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Solving Real World Production Problems with Docker
Solving Real World Production Problems with DockerSolving Real World Production Problems with Docker
Solving Real World Production Problems with Docker
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifei
 
Are VM Passé?
Are VM Passé? Are VM Passé?
Are VM Passé?
 
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
CI/CD with Kubernetes
CI/CD with KubernetesCI/CD with Kubernetes
CI/CD with Kubernetes
 
Crash Course in Open Source Cloud Computing
Crash Course in Open Source Cloud Computing Crash Course in Open Source Cloud Computing
Crash Course in Open Source Cloud Computing
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
 
Rails Applications with Docker
Rails Applications with DockerRails Applications with Docker
Rails Applications with Docker
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQ
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users Group2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users Group
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from Yelp
 
Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 

Destacado

World Views from Every Classroom
World Views from Every ClassroomWorld Views from Every Classroom
World Views from Every ClassroomLemanmanhattan
 
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la Presentación
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la PresentaciónCONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la Presentación
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la PresentaciónThe Anti-Corruption Digest
 
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Presentación en Cusco...
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025?  Presentación en Cusco...CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025?  Presentación en Cusco...
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Presentación en Cusco...The Anti-Corruption Digest
 
Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...
Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...
Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...FAO
 
Estructura economica de nueba españa
Estructura economica de nueba españaEstructura economica de nueba españa
Estructura economica de nueba españaIvan Colin
 
CONFUCIO Sabiduria por los Siglos de los Siglos
CONFUCIO  Sabiduria por los Siglos de los SiglosCONFUCIO  Sabiduria por los Siglos de los Siglos
CONFUCIO Sabiduria por los Siglos de los SiglosThe Anti-Corruption Digest
 
Resultados generales reunión nº 7 15 11-16
Resultados generales reunión nº 7  15 11-16Resultados generales reunión nº 7  15 11-16
Resultados generales reunión nº 7 15 11-16UTTA OSPAT
 
Individual Life & Bancassurance Journey (2012 - 2016)
Individual Life & Bancassurance Journey (2012 - 2016)Individual Life & Bancassurance Journey (2012 - 2016)
Individual Life & Bancassurance Journey (2012 - 2016)Gurvir Singh
 
Fitxes esmorzar saludable
Fitxes esmorzar saludableFitxes esmorzar saludable
Fitxes esmorzar saludableacapdev9
 
Agenda del lobbista
Agenda del lobbista Agenda del lobbista
Agenda del lobbista Reti
 
Libro innovacion estrategia_pymes_valencianas
Libro innovacion estrategia_pymes_valencianasLibro innovacion estrategia_pymes_valencianas
Libro innovacion estrategia_pymes_valencianasImproven
 

Destacado (20)

World Views from Every Classroom
World Views from Every ClassroomWorld Views from Every Classroom
World Views from Every Classroom
 
Ruierfa
RuierfaRuierfa
Ruierfa
 
Ruierfa
RuierfaRuierfa
Ruierfa
 
fall_2016_innovators
fall_2016_innovatorsfall_2016_innovators
fall_2016_innovators
 
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la Presentación
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la PresentaciónCONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la Presentación
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Texto de la Presentación
 
Internet
InternetInternet
Internet
 
What is opera v2
What is opera v2What is opera v2
What is opera v2
 
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Presentación en Cusco...
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025?  Presentación en Cusco...CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025?  Presentación en Cusco...
CONTROL INTERNO Y ÉTICA: ESTARÍAN PERTINENTES EN 2025? Presentación en Cusco...
 
Internet
InternetInternet
Internet
 
Internet
InternetInternet
Internet
 
Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...
Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...
Informations surprenantes sur les légumineuses que vous ne connaissiez peut ê...
 
Estructura economica de nueba españa
Estructura economica de nueba españaEstructura economica de nueba españa
Estructura economica de nueba españa
 
CONFUCIO Sabiduria por los Siglos de los Siglos
CONFUCIO  Sabiduria por los Siglos de los SiglosCONFUCIO  Sabiduria por los Siglos de los Siglos
CONFUCIO Sabiduria por los Siglos de los Siglos
 
Resultados generales reunión nº 7 15 11-16
Resultados generales reunión nº 7  15 11-16Resultados generales reunión nº 7  15 11-16
Resultados generales reunión nº 7 15 11-16
 
Alexander cajas
Alexander cajasAlexander cajas
Alexander cajas
 
Individual Life & Bancassurance Journey (2012 - 2016)
Individual Life & Bancassurance Journey (2012 - 2016)Individual Life & Bancassurance Journey (2012 - 2016)
Individual Life & Bancassurance Journey (2012 - 2016)
 
Fitxes esmorzar saludable
Fitxes esmorzar saludableFitxes esmorzar saludable
Fitxes esmorzar saludable
 
Towards Knowledge-Enabled Society
Towards Knowledge-Enabled SocietyTowards Knowledge-Enabled Society
Towards Knowledge-Enabled Society
 
Agenda del lobbista
Agenda del lobbista Agenda del lobbista
Agenda del lobbista
 
Libro innovacion estrategia_pymes_valencianas
Libro innovacion estrategia_pymes_valencianasLibro innovacion estrategia_pymes_valencianas
Libro innovacion estrategia_pymes_valencianas
 

Similar a R meetup 20161011v2

Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for RealistsOracle Developers
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realistsKarthik Gaekwad
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
Docker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOpsDocker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOpsZohar Elkayam
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSRoss Kukulinski
 
Containers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkContainers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkRed Hat Developers
 
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on OpenstackScaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on OpenstackBobby DeVeaux, DevOps Consultant
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessDocker-Hanoi
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT CampusAjeet Singh Raina
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An IntroductionPOSSCON
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyAjeet Singh Raina
 
You, and Me, and Docker Makes Three
You, and Me, and Docker Makes ThreeYou, and Me, and Docker Makes Three
You, and Me, and Docker Makes ThreeChristopher Grayson
 
Docker for developers
Docker for developersDocker for developers
Docker for developersAnvay Patil
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014Rafe Colton
 

Similar a R meetup 20161011v2 (20)

Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Docker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOpsDocker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOps
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOS
 
Containers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkContainers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech Talk
 
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on OpenstackScaling Your App With Docker Swarm using Terraform, Packer on Openstack
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack
 
Docker basic
Docker basicDocker basic
Docker basic
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT Campus
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of Technology
 
You, and Me, and Docker Makes Three
You, and Me, and Docker Makes ThreeYou, and Me, and Docker Makes Three
You, and Me, and Docker Makes Three
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
 
Dockerize All The Things
Dockerize All The ThingsDockerize All The Things
Dockerize All The Things
 

Último

Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max PrincetonTimothy Spann
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一F sss
 
Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Seán Kennedy
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...
毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...
毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...ttt fff
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一F La
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...ssuserf63bd7
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfBoston Institute of Analytics
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Thomas Poetter
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
Business Analytics using Microsoft Excel
Business Analytics using Microsoft ExcelBusiness Analytics using Microsoft Excel
Business Analytics using Microsoft Excelysmaelreyes
 

Último (20)

Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max Princeton
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
 
Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...
毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...
毕业文凭制作#回国入职#diploma#degree美国加州州立大学北岭分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#de...
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
办理(UWIC毕业证书)英国卡迪夫城市大学毕业证成绩单原版一比一
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
Business Analytics using Microsoft Excel
Business Analytics using Microsoft ExcelBusiness Analytics using Microsoft Excel
Business Analytics using Microsoft Excel
 

R meetup 20161011v2

  • 1. Things in Flow | Helping teams and individuals to get things done in flow Things in Flow How to autodeploy your R solution to DigitalOcean using Docker, GitHub and CircleCI CopenhagenR - useR Group Meetup
 IT University of Copenhagen, Oct. 11 2016
 Presenter: Niels Ole Dam, Things in Flow Things in Flow | Helping teams and individuals to get things done in Things in Flow
  • 2. Things in Flow About me • Physics and Communications at Roskilde University • Previously: • Project Manager at Experimentarium science center • Science Journalist at Illustrated Science magazine • Digital Business Developer at Bonnier Publications • Project Manager and Drupal Teamlead at Peytz & Co • Games Producer at Cape Cph • Since 2014: • Independent consultant at Things in Flow • I collect tools and help people get their stuff done digitally and with the right amount of efficient processes so that the work still feels right 2
  • 3. Things in Flow Coursera courses to recommend • Data Science Specialisation by Johns Hopkins University • I did 8 of them a couple of years ago – they where great. • Process Mining by Eindhoven University of Technology • I did this one too – and I’m actually an official Disco partner. • By The Way: • I’m currently looking for a good Process Mining case. • Please contact me if you have that kind of log file data and business itch that needs scratching. 3 Tip: All underlined links are clickable in the pdf-version of this slideshow – click to get more info on the subjects.
  • 4. Things in Flow Why I chose R • Feel the raw data under my fingertips (again) • Visualie raw data • Deliver prototypes to colleagues/clients • Deliver widely available solutions to clients • Bonus: Test new tools without polluting my computer 4
  • 5. Things in Flow Why I chose Docker • Production ready for teams and small companies • Makes it possible to follow the Continuous Integration (CI) paradigme in my own production • Open Source – dedication and low cost • Docker with R is Awesome! :-) 5
  • 6. Hang on! A lot of steps and things to grasp but easy to execute in practice ;-)
  • 7. Things in Flow Ingredients to shop for • GitHub account: • Free if Open Source – otherwise starting at $7/mo • Docker Hub account (optional): • Free if Open Source and only 1 private account, otherwise starting at $7/mo • CircleCI: • Free if Linux and only 1 container – otherwise starting at $39-50/mo • R + RStudio locally: • Free • Cloud Server: • Variable, typically starting at $5/mo • Total: • Starting with Free (Open Source) or $7/m (1 private project) + Cloud server 7
  • 9. Things in Flow GitHub: How it works • Clone code from GitHub • Commit your own changes • Git keeps track on additions and removals automatically • Push your code back to GitHub 9 Source: betterexplained.com
  • 10. Things in Flow Using Git with RStudio • Create a repo at GitHub • Clone the repo to a local RStudio project • Commit to GitHub regularly using RStudio Use branching for trying out alternative solutions: • Open a terminal via the RStudio-link and run: git checkout -b [branchname] • …do your stuff with local commits… • Switch to Master, open a terminal via the RStudio-link and run: git merge --no-ff [branchname] • …the branch is now merged back into master with all it’s Git history… 10
  • 11. Things in Flow Demo 1: GitHub + RStudio • Connect RStudio project with GitHub • Make a RStudio Shiny App project • Make some code changes • Push changes to GitHub repo • Optional: Make a local branch 11
  • 12. Things in Flow New GitHub repo 12 Copy and use for RStudio
  • 13. Things in Flow Create new RStudio project 13
  • 14. Things in Flow RStudio is now connected with GitHub 14
  • 16. Things in Flow Docker: How it works 16 Traditional Virtual Machines: Full OS for each VM Docker: OS code is partly shared
  • 17. Things in Flow The ideal Docker workflow 17 Source: docker.com
  • 18. Things in Flow Another take on the same 18 Source: terranillius.com
  • 19. Things in Flow Using Docker • Install and start Docker for Mac (or Windows) • Verify that Docker is running • Search for Docker images on Docker Hub • … either via http://dockerhub.com • …or via Kitematic (installed as part of Docker for Mac) • Start your first Docker container i.e. hello-world-nginx • You are now running Docker locally 19
  • 20. Things in Flow Demo 2: Deploy Shiny App on local VM • Start Docker for Mac (or Windows) • Verify that Docker is now running • Add Dockerfile to project • Add docker-compose.yml file to project • Open terminal via RStudio-link • Run: docker-compose up -d • Shiny App is now running on local Docker VM • …and can be accessed via http://localhost 20
  • 21. Things in Flow Docker cheatsheet docker run <container> <command> docker run -v LOCAL_DIR:CONTAINER_DIR <container> <command> docker exec -it <container_id> <command> docker images docker logs <container_id> docker-compose up -d --build docker-compose start docker rmi [imageID] docker ps [-a] docker run ubuntu /bin/echo 'Hello world' 21
  • 22. Things in Flow Manage data in containers • If you have some persistent data that you want to share between containers, or want to use from non-persistent containers, it’s best to create a named Data Volume Container, and then to mount the data from it.
 
 (from docker.com) 22
  • 23. Things in Flow Using Compose is basically a three-step process 1. Define your app’s environment with a Dockerfile so it can be reproduced anywhere. 2. Define the services that make up your app in docker- compose.yml so they can be run together in an isolated environment. 3. Lastly, run docker-compose up and Compose will start and run your entire app.
 
 (from docker.com) 23
  • 24. Things in Flow Compose can mange the whole lifecycle • Start, stop and rebuild services (start, stop, up, down) • View the status of running services • Stream the log output of running service (logs) • Run a one-off command on a service (run)
 
 (from docker.com) 24
  • 25. Things in Flow Volume data preserved when containers are created • Compose preserves all volumes used by your services. When docker-compose up runs, if it finds any containers from previous runs, it copies the volumes from the old container to the new container. This process ensures that any data you’ve created in volumes isn’t lost.
 
 (from docker.com) 25
  • 26. Things in Flow Moving Compose files between environments • Compose supports variables in the Compose file. You can use these variables to customize your composition for different environments, or different users. See Variable substitution for more details. • You can extend a Compose file using the extends field or by creating multiple Compose files. See extends for more details.
 
 (from docker.com) 26
  • 27. From Local to Cloud
  • 28. Things in Flow Cloud Deploy: How it works 28 Source: circleci.com
  • 29. Things in Flow The Workflow 29 bit.ly/R-Docker-workflow R-Docker Workflow for teams and small companies LocalLocalVM(Docker)Cloud(CircleCI/DigitalOcean) v1, Niels Ole Dam, 5/10-2016 Start Client GitHub, Docker Hub and Cloud Server (i.e. DigitalOcean, Amazon, Azure etc.) http://thingsinflow.dk/ Show/Hide Messages Develop R solution + test locally Test passed? No Test/fix on local VM Test passed? No Setup initial deploy to Cloud Deploy to local VM Test/iterate with client Test passed? No Initial solution deployed Build on local VM docker-composeup Build on Cloud server Develop, test, verify and deploy docker-composeup 1. 2. 3. Setup auto deploy on CircleCI Solution updated 4. Switch prod server 5. 6. 7. GitHub Docker CircleCIRstudio Project Git branch bit.ly/R-Docker-workflow = clickabel version of this document Docker Cheat Sheet: - docker run <container> <command> - docker run -v LOCAL_DIR:CONTAINER_DIR<container> <command> - docker exec-it <container_id> <command> - docker images - docker logs<container_id> - docker-composeup -d - docker-composestart - docker rmi [imageID] - docker ps[-a] - docker run ubuntu /bin/echo 'Hello world' Request solution Request change Try out new frameworks on local VM 8. Test php/ Spark? Click on the blue numbers or doc icons for more info on that step/subject.
  • 30. CircleCI (or Jenkins or TravisCI etc.)
  • 31. Things in Flow CircleCI: How it works • Connects to GitHub • Listens for any changes on a specific GitHub repo • Looks for a circle.yml script in the root of the GitHub repo • Runs the circle.yml script every time the repo changes • Can be used for automatical running of: • …code tests • …docker image builds for Docker Hub • …deployment(s) to Cloud server(s) 31
  • 32. Things in Flow Demo 3-4: Setup CircleCI for auto deploy • CircleCI connects to GitHub and Cloud via environment variables (=secure because credentials are not shown in code) • Environment variables could be: • $DOCKER_USER • $DOCKER_PASS • $DEPLOY_TOKEN • $DOCKER_EMAIL • Test that the circle.yml script is working as planned • Now everything is set up for auto deploy on push to GitHub! 32
  • 33. Things in Flow Known issues with CircleCI • Docker 1.12 is currently NOT supported by CircleCI • Docker 1.10 is currently NOT installed out-of-the-box by CircleCI! (=compose must be installed explicitly) • But should not be a too big issue • …if it is, then use TravisCI (or own Jenkins etc.) instead 33
  • 34. Things in Flow Demo 5-6: Auto deploy to DigitalOcean server • Make a code change to the RStudio project • Commit and push to Master (GitHub) • Wait 10 min – you’ll also get a mail • A new version of the cloud server has now been build on DigitalOcean with a random IP 34
  • 35. Things in Flow Demo 7: Switch prod server and setup A record • New cloud server has now been build • Log into DigitalOcean controlpanel • Switch the floating IP address from old to new server • Requires: A subdomain (i.e. http://meetup.thingsinflow.dk) has been setup on your website (A Record) 35
  • 36. Things in Flow Docker Swarm Mode: How it works • 30 sec demo: • www.johnzaccone.io/3-node-cluster-in-30-seconds/ • Using docker-compose with docker swarm • https://docs.docker.com/compose/swarm/ • Swarm mode overview: • https://docs.docker.com/engine/swarm/ 36
  • 38. Things in Flow Try out new frameworks safely • Test out new frameworks in a local VM without: • …risking the health of your main computer • …messing with the initial configuration • …thinking too much about documenting your steps • Quickly test out new integrations 38
  • 39. Things in Flow Demo 8: Try out some images • hello-world-nginx • Jenkins • php • Java • MySQL • Spark • Hadoop • … 39
  • 41. Things in Flow Summing up: Steps needed • Connect RStudio to GitHub – see this link at Preferences -> Git/SVN • Make your Shiny App • Add docker-compose.yml and/or Dockerfile • Test Docker setup locally • Connect GitHub to Docker Hub • Connect Docker Hub to CircleCI (or other CI service) • Connect CircelCI to a cloud server (i.e. Amazon, DigitalOcean) • Push to GitHub and watch the magic unfold Tips: • Dockerfile and circle.yml: Use one-liners or shell script • Beware of absolute vs. relative paths in all scripts 41
  • 42. Things in Flow Stuff not touched today • Partly update of individual containers on cloud server via GitHub and CircleCI (i.e. only on container at a time) • Sharing of volumes between Docker container and local machine • How to add a nice html frontend page (index.html) ;-) 42
  • 43. Things in Flow Key Take Aways • Docker is production ready for teams and small companies • Docker makes it possible to use the Continuous Integration (CI) paradigme for your R projects • Docker with R is Awesome! :-) 43
  • 44. Things in Flow Links • Getting started with Docker: • http://www.docker.com/products/overview • https://docs.docker.com/engine/getstarted/ • Manage Data in containers: • https://docs.docker.com/engine/tutorials/dockervolumes/#/creating- and-mounting-a-data-volume-container • Docker Compose: • https://docs.docker.com/compose/overview/ • Automated Docker Deployments with CircleCI: • http://www.mikeheijmans.com/docker/2015/09/07/automated-docker- deployment-with-circle/ • Continuous Integration and Delivery with Docker-CircleCI: • https://circleci.com/docs/docker/ 44
  • 46. Things in Flow Niels Ole Dam – nd@thingsinflow.dk thingsinflow.dk – Mob. +45 2712 9314 Thanks! :-) CopenhagenR - useR Group, Meetup at ITU, Oct. 11 2016 This presentation can be found at thingsinflow.dk/R-Docker-workflow