Microservices in Dyalog APL Morten Kromberg – 11th January 2018

Slides:



Advertisements
Similar presentations
1 NETE4631 Cloud deployment models and migration Lecture Notes #4.
Advertisements

Docker Martin Meyer Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms –Hello World Images and Containers.
Docker Martin Meyer Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms Hello World Terminology: Image and.
Amazon EC2 Quick Start adapted from EC2_GetStarted.html.
Creating a Web Presence Introduction to WordPress Week 1.
Eucalyptus Virtual Machines Running Maven, Tomcat, and Mysql.
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
Chromium OS is an open-source project that aims to build an operating system that provides a fast, simple, and more secure computing experience for people.
© 2005,2006 NeoAccel Inc. Partners Presentation SSL VPN-Plus 2.0 Quick Start Guide.
Customized cloud platform for computing on your terms !
Windows Azure Conference 2014 Running Docker on Windows Azure.
Cloud Computing. What is Cloud Computing? Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable.
K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by.
Presented by: Sanketh Beerabbi University of Central Florida COP Cloud Computing.
The Open Source Virtual Lab: a Case Study Authors: E. Damiani, F. Frati, D. Rebeccani, M. Anisetti, V. Bellandi and U. Raimondi University of Milan Department.
| nectar.org.au NECTAR TRAINING Module 10 Beyond the Dashboard.
1 Applied CyberInfrastructure Concepts ISTA 420/520 Fall Nirav Merchant Bio Computing & iPlant Collaborative Eric Lyons.
Breaking Barriers Exploding with Possibility Breaking Barriers Exploding with Possibility The Cloud Era Unveiled.
Dyalog’08. Conga, SSL and WebServices Morten Kromberg Dyalog’08 - Elsinore.
Docker and Container Technology
#msitconf. Damien Caro Technical Evangelist Manager, Что будет, если приложение поместить в контейнер? What happens if the application.
Repository Manager 1.3 Product Overview Name Title Date.
© 2015 MetricStream, Inc. All Rights Reserved. AWS server provisioning © 2015 MetricStream, Inc. All Rights Reserved. By, Srikanth K & Rohit.
Installing git In Linux: sudo apt-get install git In Windows: download it from run the setuphttp://git-scm.com/download/win.
Prof. Jong-Moon Chung’s Lecture Notes at Yonsei University
Version Control Systems
Holland Computing Center STAT802 Create and access Anvil Windows 10 SAS instance 01/23/2017.
Unit 3 Virtualization.
Getting & Running EdgeX Docker Containers
Introduction to Linux and R
Building ARM IaaS Application Environment
INTRO TO Presenter: PhuongNQK.
Fundamentals Sunny Sharma Microsoft
Road Map - The User Experience
Docker and Azure Container Service
Cloud computing-The Future Technologies
IST256 : Applications Programming for Information Systems
Docker Birthday #3.
Version Control overview
In-Depth Introduction to Docker
Docker – kontejnerizacija na serveru Vedran Vučetić, SPAN
Azure CLI Deep Dive Neil Peterson Content Developer Microsoft.
Containers and Virtualisation
Web Services CO5027.
Andrew Pruski SQL Server & Containers
Version Control Systems
Lab 1 introduction, debrief
Windows Server & Hyper-V Containers Vaggelis Kappas
Coding in the Cloud This slide deck includes recorded video demonstrations of content from the live presentation. Joon-Yee.
Introduction to Docker
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
slides borrowed and adapted from Alex Mariakis and CSE 390a
Using docker containers
Azure Container Instances
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Webinar # April 2017 Isolates in the Cloud
Cloud Computing BY: Udit Jain.
Intro about Contanier and Docker Technology
Microsoft Virtual Academy
Microsoft Virtual Academy
Docker, Drupal and Persistence
Lecture 16B: Instructions on how to use Hadoop on Amazon Web Services
Different types of Linux installation
Docker Some slides from Martin Meyer Vagrant Box:
Introduction to Docker
OpenStack Summit Berlin – November 14, 2018
Azure Container Service
Download the PPT and code from github as below
Deploying machine learning models at scale
DIBBs Brown Dog Tutorial Setup
Presentation transcript:

Microservices in Dyalog APL Morten Kromberg – 11th January 2018 #7

Microservices Definition (Wikipedia) Microservices is a variant of the service-oriented architecture (SOA) architectural style that structures an application as a collection of  loosely coupled services. (The techniques shown here will work fine for your large monolithic heritage application too.)

Microservices in Dyalog APL Goal for today: Demonstrate how APL functions can easily be made available to be called from "anywhere" Any development tool on the same machine ... or on another machine nearby ... or from anywhere on the internet (deployed on the cloud)

Agenda Inspect the Application ∇ sign←GetSign date;dates;signs [1] ⍝ Compute sign of the Zodiac from integer vector containing [Month,Day] [2] [3] signs←13⍴'Capricorn' 'Aquarius' 'Pisces' 'Aries' 'Taurus' 'Gemini' 'Cancer' 'Leo' 'Virgo' 'Libra' 'Scorpio' 'Sagittarius' [4] dates←119 218 320 419 520 620 722 822 922 1022 1121 1221 [5] sign←signs⊃⍨1+dates⍸100⊥2↑date ∇ GetSign 10 31 Scorpio

Agenda Inspect the Application APL Inspect the Application Serve it via JSONServer under Microsoft Windows JSONServer is a CONGA-based server that makes it easy to call APL functions, passing data as JSON Call it from APL and curl curl is a command line tool for transferring data using various protocols, including HTTP+JSON curl JSONServer ∇GetSign

Agenda Inspect the Application Serve it via JSONServer & call it APL curl Inspect the Application Serve it via JSONServer & call it Create a Docker Container under Linux Containers are like virtual machines but very, very, VERY much easier to build, deploy, and manage Docker Container JSONServer ∇GetSign

Agenda Serve application via JSONServer hub.docker.com APL curl Serve application via JSONServer Call it from APL, Python & curl Create a Docker Container Store the Image in DockerHub DockerHub is an online repository for Docker Container Images Docker Container JSONServer ∇GetSign

Agenda Serve application via JSONServer hub.docker.com APL curl Serve application via JSONServer Create & Store Docker Container Create a Linux Virtual Machine containing only Docker on the Amazon Elastic Compute Cloud Pull the Image from DockerHub Start it and call it from Python Amazon EC2 Docker Container Python JSONServer ∇GetSign

Hold On To Your Hats! We will do all of this in 60 minutes The slides and other materials are intended to contain everything you need to repeat this at home Here we go...

Step 1 Inspect the Application APL Inspect the Application Serve it via JSONServer under Microsoft Windows JSONServer is a CONGA-based server that makes it easy to call APL functions, passing data as JSON Call it from APL and curl curl is a command line tool for transferring data using various protocols, including HTTP+JSON curl JSONServer ∇GetSign

JSONServer A TCP Server based on Conga POST /GetSign HTTP 1.1 [10,31] A TCP Server based on Conga Uses ⎕JSON to convert incoming data to APL arrays Calls Function Converts results back to JSON and returns HTTP r←GetSign 10 31 HTTP/1.1 200 OK "Scorpio"

JSONServer Demo APL git pull https://github.com/Dyalog/JSONServer /devt/JSONServer ]demo demos/server.demo ]demo demos/client.demo Linux curl --header "content-type: application/json" --data "[2,23]" http://10.0.60.162:8080/GetSign

JSONServer Features - Recap Can Serve Up Functions in a namespace (including #) The AllowedFns property can be used to control which functions to expose A folder full of .dyalog files Nested folders / namespaces URLs a la localhost:8080/ns/foo Uses ⎕JSON to convert incoming data & results to or from APL arrays Can be started from the command line Get it from https://github.com/Dyalog/JSONServer

Step 2 Inspect the Application Serve it via JSONServer & call it APL curl Inspect the Application Serve it via JSONServer & call it Create a Docker Container under Linux Containers are like virtual machines but very, very, VERY much easier to build, deploy, and manage Docker Container JSONServer ∇GetSign

Containers & Docker Docker Containers allow several applications to share the same host but remain isolated from each other Effect is similar to Virtual Machines but the Operating System kernel is shared Did I remember to say they are very, VERY easy to define, build, deploy and run? ZDNET: Docker is hotter than hot because it makes it possible to get far more apps running on the same old servers and it also makes it very easy to package and ship programs. http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/

Containers & Docker Source: http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/

Example Docker Image Base Image Files to Add Run during Build #!/bin/bash dyalog -ride Dockerfile FROM ubuntu:16.04 ADD ./dyalog-unicode_16.0.31748_amd64.deb / ADD ./run / RUN dpkg -i /dyalog*.deb EXPOSE 4502/tcp CMD /run Base Image Files to Add Run during Build Firewall Setup Image Startup Builds Linux machine which will start Dyalog APL

The JSONServer Docker Image The repository contains files that can be used to create suitable images https://github.com/Dyalog/JSONServer/tree/master/Docker Or, if you checked it out locally: /devt/JSONServer/Docker

Docker Image for JSONServer The repository contains files that can be used to create suitable images

Download APL installer from my.dyalog.com ... If not downloading APL from my.dyalog.com FROM ubuntu:16.04 ADD ./dyalog-unicode_16.0.31748_amd64.deb / RUN dpkg -i /dyalog*.deb RUN git clone https://github.com/Dyalog/JSONServer /JSONServer ADD /myapp / # If not using /JSONServer/Sample ADD entry.sh /scripts/ EXPOSE 8080 # JSONServer EXPOSE 4502 # RIDE CMD /scripts/entry.sh Download APL installer from my.dyalog.com

Update application on startup

Prompt and pass on my.dyalog.com credentials

name of image -p map container ports to host ports --rm discard file system changes on termination -it interactive terminal

Demo: Under Debian Linux Check out, build and run the Image: git clone https://github.com/Dyalog/JSONServer JSONServer cd JSONServer/Docker ./build ./run (run 2nd copy?) (rerun APL Windows Client using debian8:8080)

Docker Recap Docker makes it easy to Specify software that makes up a "machine" [Re]build machines in seconds Deploy images to other machines in seconds Scale by launching multiple copies of the same machine – in seconds Documentation, Installation Instructions https://www.docker.com/community-edition

Step 3 Serve application via JSONServer hub.docker.com APL curl Serve application via JSONServer Call it from APL, Python & curl Create a Docker Container Store the Image in DockerHub DockerHub is an online repository for Docker Container Images Docker Container JSONServer ∇GetSign

Demo Push the image to dockerhub docker tag jsonserver mkromberg/jsonserver-sample docker login docker push mkromberg/jsonserver-sample

Step 4 Serve application via JSONServer hub.docker.com APL curl Serve application via JSONServer Create & Store Docker Container Create a Linux Virtual Machine containing only Docker on the Amazon Elastic Compute Cloud Amazon EC2 Docker Container JSONServer ∇GetSign

Amazon EC2 EC2 (Elastic Compute Cloud) is one of many products on the market for hosting Virtual Machines "on demand". Microsoft, IBM, Google and many other vendors exist. aplcloud.com offer VM's with Dyalog APL preinstalled & supported You pick an operating system (Linux, Windows, ...) A machine size (#processors, RAM, GPU, storage, ...) Pre-installed software (e.g. MySQL – or Docker!) Install your own software Start one or more "instances" You can also just launch a Docker Image ...

Introducing PuTTY & PuTTYGen PuTTY – terminal emulator PuTTYGen – key conversion

PuTTYGen Convert the private key .pem file previously downloaded ... ... into a .ppk file that PuTTY can use

PuTTY Widely used terminal emulator Supports secure connections via SSH using key pairs

Final Steps... Serve application via JSONServer hub.docker.com APL curl Serve application via JSONServer Create & Store Docker Container Create a Linux Virtual Machine containing only Docker on the Amazon Elastic Compute Cloud Pull the Image from DockerHub Start it and call it from Python Amazon EC2 Docker Container Python JSONServer ∇GetSign

Demo Pull the image to EC2 docker login docker pull mkromberg/jsonserver-sample docker run -it --rm -p 8080:8080 -p 4502:4502 mkromberg/jsonserver-sample (+start a 2nd one)? Run the Python example http://localhost:8888/tree RIDE to the interpreter

Cast of Technologies & Tools Name Description Dyalog APL The definitive APL system for Microsoft Windows, Linux (incl Raspi), macOS, AIX, ... Zodiac An application written in APL JSONServer A very lightweight framework for calling functions written in Dyalog APL Docker A platform for building, shipping and running "containers" Amazon EC2 Elastic Compute Cloud: A service which allows you to rent virtual machines on demand DockerHub Cloud-based registry service for containers GitHub Cloud-based Git version control repository hosting service. Name Description RIDE Dyalog's Remote Development Environment PuTTY Telnet/VT100 terminal emulator PUTTYGen A key generator / converter SourceTree A frontend for Git[Hub]

Issues Not Discussed Today Licencing Dyalog providing pre-build containers macOS: (it all works the same on a Mac) Security Multi-User Sessions Big Data Volumes Windows Services

Many Thanks to... Jason Rivers Brian Becker v16.0 Primitives: ⍸ ⊆ @ ⌺ Many Thanks to... Jason Rivers internal training course on Docker examples of using Docker Brian Becker JSONServer Implementation Zodiac Calculations Countless other people at Dyalog, Optima Systems, Technology Partner, Pythonistas, etc...

Next Webinar Probably: 15 February: User Command Pre-Release (New Source Code Management Tools) Web Casts (not –inars) Secure JSONServer Multi-User JSONServer Scalable JSONServer Please provide feedback to webinar@dyalog.com!