USING DOCKER FOR MXCUBE DEVELOPMENT AT MAX IV

Similar documents
ovirt and Docker Integration

Fixing the "It works on my machine!" Problem with Docker

Think Small to Scale Big

[Docker] Containerization

SQL Server inside a docker container. Christophe LAPORTE SQL Server MVP/MCM SQL Saturday 735 Helsinki 2018

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

LSST software stack and deployment on other architectures. William O Mullane for Andy Connolly with material from Owen Boberg

There Should be One Obvious Way to Bring Python into Production. Sebastian Neubauer

Important DevOps Technologies (3+2+3days) for Deployment

Docker und IBM Digital Experience in Docker Container

DEPLOYMENT MADE EASY!

Who is Docker and how he can help us? Heino Talvik

Engineering Robust Server Software

Remote Workflow Enactment using Docker and the Generic Execution Framework in EUDAT

Getting Started With Containers

" Qué me estás container?" Docker for dummies

Git Command Line Tool Is Not Installed

TangeloHub Documentation

Docker 101 Workshop. Eric Smalling - Solution Architect, Docker

Created by: Nicolas Melillo 4/2/2017 Elastic Beanstalk Free Tier Deployment Instructions 2017

Container-based virtualization: Docker

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Welcome to Docker Birthday # Docker Birthday events (list available at Docker.Party) RSVPs 600 mentors Big thanks to our global partners:

An introduction to Docker

Investigating Containers for Future Services and User Application Support

Red Hat Atomic Details Dockah, Dockah, Dockah! Containerization as a shift of paradigm for the GNU/Linux OS

Midterm Presentation Schedule

Running Splunk Enterprise within Docker

Con$nuous Deployment with Docker Andrew Aslinger. Oct

INDIGO PAAS TUTORIAL. ! Marica Antonacci RIA INFN-Bari

Running MarkLogic in Containers (Both Docker and Kubernetes)

Docker and Security. September 28, 2017 VASCAN Michael Irwin

Docker & why we should use it

Using DC/OS for Continuous Delivery

Infoblox Kubernetes1.0.0 IPAM Plugin

DEVOPS TRAINING COURSE CONTENT

INFRASTRUCTURE AS CODE

RDO container registry Documentation

Microservices. Chaos Kontrolle mit Kubernetes. Robert Kubis - Developer Advocate,

Containers. Pablo F. Ordóñez. October 18, 2018

Introduction to Docker. Antonis Kalipetis Docker Athens Meetup

Orchestrating Docker containers at scale

Docker at Lyft Speeding up development Matthew #dockercon

The age of orchestration

Portable, lightweight, & interoperable Docker containers across Red Hat solutions

Follow me!

DevOps Workflow. From 0 to kube in 60 min. Christian Kniep, v Technical Account Manager, Docker Inc.

Docker and Oracle Everything You Wanted To Know

Introduction to containers

Creating pipelines that build, test and deploy containerized artifacts Slides: Tom Adams

Red Hat Containers Cheat Sheet

Dockerfile & docker CLI Cheat Sheet

Opportunities for container environments on Cray XC30 with GPU devices

Docker Cheat Sheet. Introduction

Docker II - Judgement Day

CLOUD-NATIVE APPLICATION DEVELOPMENT/ARCHITECTURE

Oh.. You got this? Attack the modern web

Asterisk & the Docker revolution Some lessons from the trenches

Quick Prototyping+CI with LXC and Puppet

Docker A FRAMEWORK FOR DATA INTENSIVE COMPUTING

I hate money. Release 1.0

CONTAINERIZED APP DEVELOPMENT

Travis Cardwell Technical Meeting

Lab 4: Configuring node.js apps with ATP

DOCKER 101 FOR JS AFFICIONADOS. Christian Ulbrich, Zalari UG

docker & HEP: containerization of applications for development, distribution and preservation

swiftenv Documentation

4 Effective Tools for Docker Monitoring. By Ranvijay Jamwal

Neale Ferguson

Docker All The Things

Deployment Patterns using Docker and Chef

Orchestrate JBoss Middleware with Ansible Tower Red Hat Summit San Francisco

In-cluster Open Source Testing Framework

OpenShift 3 Technical Architecture. Clayton Coleman, Dan McPherson Lead Engineers

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Linux System Management with Puppet, Gitlab, and R10k. Scott Nolin, SSEC Technical Computing 22 June 2017

A DEVOPS STATE OF MIND WITH DOCKER AND KUBERNETES. Chris Van Tuin Chief Technologist, West

Continuous Delivery for Python Developers PyCon 8, 2017

Knative: Building serverless platforms on top of Kubernetes

DevOps Technologies. for Deployment

Arup Nanda VP, Data Services Priceline.com

Getting Started With Amazon EC2 Container Service

Merging Enterprise Applications with Docker* Container Technology

Download the current release* of VirtualBox for the OS on which you will install VirtualBox. In these notes, that's Windows 7.

Presented By: Gregory M. Kurtzer HPC Systems Architect Lawrence Berkeley National Laboratory CONTAINERS IN HPC WITH SINGULARITY

AZURE CONTAINER INSTANCES

Sunil Shah SECURE, FLEXIBLE CONTINUOUS DELIVERY PIPELINES WITH GITLAB AND DC/OS Mesosphere, Inc. All Rights Reserved.

Infrastructure at your Service. Oracle over Docker. Oracle over Docker

Index. Bessel function, 51 Big data, 1. Cloud-based version-control system, 226 Containerization, 30 application, 32 virtualize processes, 30 31

RED HAT'S CONTAINER STRATEGY. Lars Herrmann General Manager, RHEL, RHEV and Containers June 24, 2015

Hue Application for Big Data Ingestion

Go Faster: Containers, Platforms and the Path to Better Software Development (Including Live Demo)

Archan. Release 2.0.1

Game Server Manager Documentation

Docker CaaS. Sandor Klein VP EMEA

Singularity: Containers for High-Performance Computing. Grigory Shamov Nov 21, 2017

Logging, Monitoring, and Alerting

Dockerfile Best Practices

Kuber-what?! Learn about Kubernetes

Red Hat OpenShift Roadmap Q4 CY16 and H1 CY17 Releases. Lutz Lange Solution

Transcription:

USING DOCKER FOR MXCUBE DEVELOPMENT AT MAX IV Fredrik Bolmsten, Antonio Milán Otero K.I.T.S. Group at Max IV - 2017 1

OVERVIEW What is Docker? How does it work? How we use it for MxCUBE How to create a container Services Other tools 2

WHAT IS DOCKER? Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: Code Runtime System tools System libraries This guarantees that the software will always run the same, regardless of its environment. 3

WHAT DOCKER IS NOT IT'S NOT A VIRTUAL MACHINE Virtual Machines include: Application, binaries, libraries and the entire guest OS. Containers include the application and its dependencies. Run in an isolated process in user space on the host operating system. 4

MAYBE NOW YOU FEEL LIKE... 5

Imagine you have an app and its dependencies to deploy. 6. 1

You put it all together on the container. 6. 2

Ship it together. 6. 3

More details on: http://www.docker.com/what-docker https://docs.docker.com/engine/understanding-docker/ 6. 4

HOW DOES IT WORKS? 3 main components: Images Containers Registries 7. 1

ARCHITECTURE 7. 2

HOW WE USED IT FOR MXCUBE... BUT FIRST LET'S PUT YOU ON CONTEXT... In our previous meeting in Hamburg, we ran a workshop to show & help with the MxCUBE 3 installation process. We wanted to let the people experiment with our application, but at the end we discovered that they were having plenty of problems to install it and run it. 8. 1

USE CASE 1: DISTRIBUTING A MOCKUP VERSION FOR NEWCOMERS So, we decided to distribute a VM to make easier for newcomers to test the app. But why to use a VM when we can use a docker container and simplify the process and reduce the weight? 8. 2

USE CASE 2: DEVELOPMENT ENVIRONMENT Docker it's so nice that after playing with it, we started to consider its usage as a development environment. 8. 3

USE CASE 3: DEPLOYMENT ENVIRONMENT Also, it will not be so complex to use it for deployment. But we are not there yet. 8. 4

MXCUBE 3 OVERVIEW As you know, MxCUBE 3 is composed by 3 main services: Redis NPM MxCUBE Good Practice: Split your monolithic application into several microservices. 9

FIRST THING FIRST: HOW TO BUILD A DOCKER IMAGE. DOCKERFILE Here we define everything needed in our container to run the app, and also the configuration that has to be done. ############################################################################## # Dockerfile to run MXCuBE web server ############################################################################## FROM centos:7 MAINTAINER Antonio Milan Otero <antonio.milan_otero.maxiv.lu.se> 10. 1

Then you install whatever is needed in your container. # Install #### RUN yum install -y curl RUN curl --silent --location https://rpm.nodesource.com/setup_4.x bash - RUN yum install -y gcc-c++ make # or: yum groupinstall 'Development Tools' # Install nodejs from epel repository #### RUN yum install -y nodejs npm # Install more dependencies #### RUN yum install -y \ python-devel \ openldap-devel \ lapack-devel \ zlib-devel \ libjpeg-turbo-devel \ libxml2-devel \ libxslt-devel \ openssl-devel \ libgfortran \ cyrus-sasl-devel 10. 2

Then we get the latest version of the app. In the future it will be pointing official releases. # Install git #### RUN yum install -y git # Get MxCUBE code #### RUN mkdir /mxcube WORKDIR /mxcube RUN git clone https://github.com/mxcube/mxcube3.git --recursive WORKDIR mxcube3 10. 3

After that, more dependencies are installed # Install EPEL repository #### RUN yum install -y epel-release RUN yum makecache # && yum update -y # Install python pip #### RUN yum install -y python-pip RUN yum install -y redis # Install requirements #### RUN pip install -r requirements.txt # Install supervisor RUN pip install supervisor # Install npm #### RUN npm install RUN npm install fabric RUN npm install --dev 10. 4

Some configuration now. RUN cp backend_server.js.example backend_server.js COPY supervisord.conf /etc/supervisor/supervisord.conf COPY run_mxcube /usr/local/bin/ EXPOSE 8090 CMD ["/usr/bin/supervisord"] 10. 5

We use supervisor in order to run and monitor all the processes. More details here: http://supervisord.org/ Supervisor configuration example: [supervisord] nodaemon=true [program:redis] command=redis-server [program:mxcube] command=python mxcube3-server -r test/hardwareobjectsmockup.xml --log-file mxcube.log [program:npm] command=npm start 10. 6

AND RUN IT docker build -t mxcube_web. docker run -i -p 8090:8090 -t mxcube_web 10. 7

USE CASE 1: DISTRIBUTING A MOCKUP Actually you don't need to build anything, it's already available in docker hub. So, execute: docker run -i -p 8090:8090 -t amilan/mxcube_web And enjoy it. 11

12

USE CASE 2: DEVELOPMENT ENVIRONMENT You can use it also as a part of your development environment as a test bench. One way of doing that is: 1. Get the latest image. 2. Clone the mxcube3 repository in your host. 3. Run the container mounting your host folder. 4. Disable Supervisor in your container. 5. Run the services manually. Looks more difficult than what it is. 13. 1

1- GET THE LATEST IMAGE docker pull amilan/mxcube_web 13. 2

2- CLONE THE MXCUBE3 REPOSITORY git clone https://github.com/mxcube/mxcube3.git 13. 3

3- RUN THE CONTAINER MOUNTING YOUR HOST FOLDER docker run -i -p 8090:8090 -v /Path/to/your/repo/mxcube3:/mxcube/mxcube3 --name mxcube3 -t amilan/mxcube_web See details about installing npm in the documentation. 13. 4

4- DISABLE SUPERVISOR Edit the file: /etc/supervisor/supervisord.conf and let only this: [supervisord] nodaemon=true [program:redis] command=redis-server # [program:mxcube] # command=python mxcube3-server -r test/hardwareobjectsmockup.xml --log-file mxcube.log # [program:npm] # command=npm start And then, restart the container: docker restart mxcube3 13. 5

5- RUN THE SERVICES MANUALLY docker exec -it mxcube3 redis-server docker exec -it mxcube3 python mxcube3-server -r test/hardwareobjectsmockup.xml --log-file mxcube.log docker exec -it mxcube3 npm start 13. 6

More detailed info here: https://github.com/amilan/mxcube_web 13. 7

USE CASE 3: DEPLOYMENT ENVIRONMENT Not used yet... maybe one day... 14

EXTRA TIME FOR SOME MORE DOCKER STUFF? If not, jump to slide 21. 15

DOCKER COMPOSE A nice tool to orchestrate several docker containers and manage your microservices. Configurable with a.yml file. version: '2' services: mxcube: build:. expose: - "8081" ports: - "8081:8081" links: - redis command: python mxcube3-server -r test/hardwareobjectsmockup.xml --log-file /tmp/mxcube.log volumes: -./tmp:/tmp redis: image: redis expose: - "6379" ports: - "6379:6379" volumes: -./data:/data 16. 1

And then: docker-compose build docker-compose up And the magic happens. 16. 2

Example available in: https://github.com/amilan/mxcube_web Under the branch: use_composer But wait! It's still under development. Use it at your own risk! 16. 3

DOCKER REGISTRY Basically it's like a repository of images. Docker hub is the official one, but you can have your own one. It provides: Storage for your containers. Push and pull commands (for maintenance). Notification system (webhooks) Able to connect to a Continuous Integration / Delivery system. 17

ANSIBLE INTEGRATION? Why not? It will provide: Flexibility: Portable playbooks Reproducible environments (using docker, vagrant, etc) Auditability: Simple to review and update content in a container. Ubiquity: You can manage container environments and also host environments. 18

DOCKER SWARM It provides features to orchestrate a cluster of Docker Engines. Main features: Cluster management Decentralized design Declarative service model Scaling Desired state reconciliation Multi-host networking Service discovery Load balancing Secure by default Rolling updates 19

ANY QUESTIONS? 20

THANKS FOR YOUR ATTENTION! https://hub.docker.com/r/amilan/mxcube_web/ https://github.com/amilan/mxcube_web 21