Top Banner
Cloud Computing with APL Morten Kromberg, CXO, Dyalog
103

Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

May 20, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

Cloud Computingwith APL

Morten Kromberg, CXO, Dyalog

Page 2: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

Cloud Computing Dockerwith APL

Morten Kromberg, CXO, Dyalog

Page 3: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

2

Cloud Computing with APL

Cloud Computing: Definitions

Page 4: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

3

Cloud Computing with APL

Cloud Computing: DefinitionsCloud Computing = "Using someone elses computer"

Page 5: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

4

Cloud Computing with APL

Cloud Computing: DefinitionsCloud Computing = "Using someone elses computer"

• SAAS (Software As A Service): You use "Software" like gmail, dropbox, etc - with no idea of where it is running, or where your data is stored

Page 6: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

5

Cloud Computing with APL

Cloud Computing: DefinitionsCloud Computing = "Using someone elses computer"

• SAAS (Software As A Service): You use "Software" like gmail, dropbox, etc - with no idea of where it is running, or where your data is stored

• PAAS: Someone hosts your application on a "Platform" which runs specific development tools (php, mysql, ASP.NET, Wordpress...)

Page 7: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

6

Cloud Computing with APL

Cloud Computing: DefinitionsCloud Computing = "Using someone elses computer"

• SAAS (Software As A Service): You use "Software" like gmail, dropbox, etc - with no idea of where it is running, or where your data is stored

• PAAS: Someone hosts your application on a "Platform" which runs specific development tools (php, mysql, ASP.NET, Wordpress...)

• IAAS : Someone hosts your Virtual Machine on their "Infrastructure". You can install anything you like.

Page 8: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

7

Cloud Computing with APL

Cloud Computing: DefinitionsCloud Computing = "Using someone elses computer"

• SAAS (Software As A Service): You use "Software" like gmail, dropbox, etc - with no idea of where it is running, or where your data is stored

• PAAS: Someone hosts your application on a "Platform" which runs specific development tools (php, mysql, ASP.NET, Wordpress...)

• IAAS : Someone hosts your Virtual Machine on their "Infrastructure". You can install anything you like.

This talk is about installing and running Dyalog APL on IAAS.

Page 9: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

8

Cloud Computing with APL

Using IAAS

Page 10: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

9

Cloud Computing with APL

Using IAAS• Pick an IAAS provider

Page 11: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

10

Cloud Computing with APL

Using IAAS• Pick an IAAS provider• Upload or Create a Virtual Machine

Page 12: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

11

Cloud Computing with APL

Using IAAS• Pick an IAAS provider• Upload or Create a Virtual Machine

• You save the hassle ofo Buying [a] big enough computer[s]o Maintaining / replacing the hardwareo Paying for a fast internet connection

Page 13: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

12

Cloud Computing with APL

Using IAAS – the Hard Part

Page 14: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

13

Cloud Computing with APL

Using IAAS – the Hard Part• Picking a provider:

o Amazon, Microsoft, Google, DigitalOcean, Oracle, RackSpace, Netrepid, IBM/Redhat, GreenCloud, Alibaba, Openstack, ...

o Can't help you with that

Page 15: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

14

Cloud Computing with APL

Using IAAS – the Hard Part• Picking a provider:

o Amazon, Microsoft, Google, DigitalOcean, Oracle, RackSpace, Netrepid, IBM/Redhat, GreenCloud, Alibaba, Openstack, ...

o Can't help you with that

• Installing the software that you want to run on the Virtual Machine:o APL Interpreter, Web Server or Service Framework,

Database System, other tools ...o This is where Containers are "Pure Magic"

Page 16: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

15

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Page 17: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

16

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Page 18: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

17

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Files to Add

Page 19: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

18

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Files to Add

Run during Build

Page 20: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

19

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Files to Add

Run during Build

Environment Vars

Page 21: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

20

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Files to Add

Run during Build

Environment Vars

Run at Startup

Page 22: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

21

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Files to Add

Run during Build

Environment Vars

Run at Startup

This "Dockerfile" completely describes a machine which will run "myapp".

Page 23: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

22

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myapp

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSS

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Files to Add

Run during Build

Environment Vars

Run at Startup

This "Dockerfile" completely describes a machine which will run "myapp".

Your Code

Page 24: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

23

Cloud Computing with APL

FROM ubuntu:18.04

ADD ./dyalog-unicode_17.0.34604_amd64.deb /

RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSSRUN git clone https://github.com/myco/myapp /myapp

ENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myapp

CMD dyalog /JSS/JSONServer.dws

Containers Solve the Distribution Problem

Base Image

Files to Add

Run during Build

Environment Vars

Run at Startup

Uses GitHub to load the source code for "myapp".

Your Code

Page 25: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

24

Cloud Computing with APL

Page 26: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

25

Cloud Computing with APL

FROM ubuntu:18.04ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myappRUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSSENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

Building and Running the Docker ImageDockerfile

Page 27: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

26

Cloud Computing with APL

FROM ubuntu:18.04ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myappRUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSSENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

Building and Running the Docker Image

Build

Dockerfile

docker build –t myco/myapp-test .

Page 28: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

27

Cloud Computing with APL

FROM ubuntu:18.04ADD ./dyalog-unicode_17.0.34604_amd64.deb /ADD /myapp/v7/test /myappRUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSSENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

Building and Running the Docker Image

Build

Run

Dockerfile

docker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker build –t myco/myapp-test .

Page 29: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

28

Cloud Computing with APL

docker run syntax & common switches

Switch Description-p hhhh:cccc Map TCP port cccc in container to hhhh on host-e name=value Set environment variable inside the container-v /hfolder:/cfolder Mount /hfolder in container as /cfolder-t Allocate a pseudo-TTY-i Keep stdin open even if not attached--rm Discard changes when container terminates

docker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Page 30: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

29

Cloud Computing with APL

Distributing the Image: DockerHubBuild

Rundocker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker build –t myco/myapp-test .

Page 31: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

30

Cloud Computing with APL

Distributing the Image: DockerHubBuild

Rundocker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker build –t myco/myapp-test .

We can "push" the image to DockerHub:

Page 32: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

31

Cloud Computing with APL

Distributing the Image: DockerHubBuild

Rundocker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker build –t myco/myapp-test .

Pushdocker login

docker push myco/myapp-test

We can "push" the image to DockerHub:

Page 33: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

32

Cloud Computing with APL

Distributing the Image: DockerHubBuild

Rundocker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker build –t myco/myapp-test .

Pushdocker login

docker push myco/myapp-test

We can "push" the image to DockerHub:

Now, the following will work on ANY computer that has Docker installed(assuming myco/myapp-test is a PUBLIC container)

Page 34: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

33

Cloud Computing with APL

Distributing the Image: DockerHubBuild

Rundocker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker build –t myco/myapp-test .

Pushdocker login

docker push myco/myapp-test

We can "push" the image to DockerHub:

Now, the following will work on ANY computer that has Docker installed(assuming myco/myapp-test is a PUBLIC container)

Page 35: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

34

Cloud Computing with APL

GitHub for source code distribution.Code can be loaded at Image Build time,OR when a Container is started.

DockerHub for container distribution.

+

= Simple distribution of applications and toolsto ANY machine – including IAAS VMs.

Page 36: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

35

Cloud Computing with APL

Page 37: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

36

Cloud Computing with APL

Page 38: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

37

Cloud Computing with APL

Containers are STUNNING technology!

Page 39: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

38

Cloud Computing with APL

Containers are STUNNING technology!In addition to making distribution very simple:

Page 40: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

39

Cloud Computing with APL

Containers are STUNNING technology!In addition to making distribution very simple:• Containers allow several applications to share

the same host but remain isolated from each other

Page 41: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

40

Cloud Computing with APL

Containers are STUNNING technology!In addition to making distribution very simple:• Containers allow several applications to share

the same host but remain isolated from each other

• The effect is similar to Virtual Machines but the Operating System kernel is shared

Page 42: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

41

Cloud Computing with APL

Containers are STUNNING technology!In addition to making distribution very simple:• Containers allow several applications to share

the same host but remain isolated from each other

• The effect is similar to Virtual Machines but the Operating System kernel is shared

• Containers start and stop Containers in secondso (the Operating System does not need to "Boot Up")

Page 43: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

42

Cloud Computing with APL

Containers are STUNNING technology!In addition to making distribution very simple:• Containers allow several applications to share

the same host but remain isolated from each other

• The effect is similar to Virtual Machines but the Operating System kernel is shared

• Containers start and stop Containers in secondso (the Operating System does not need to "Boot Up")

• Containers consume MUCH less resources than VMs

Page 44: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

43

Cloud Computing with APL

Containers are STUNNING technology!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/

Page 45: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

44

Cloud Computing with APL

Containers & Docker

From:http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/

Page 46: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

45

Cloud Computing with APL

Containers & Docker

From:http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/

Page 47: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

46

Cloud Computing with APL

Linux

Page 48: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

47

Cloud Computing with APL

Linux• Container technology works best with

Linux, due to the size of the kernel

Page 49: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

48

Cloud Computing with APL

Linux• Container technology works best with

Linux, due to the size of the kernel• Windows kernels are getting smaller

but are still 10-20x as large as Linux (~0.5-1Gb vs 50Mb).

Page 50: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

49

Cloud Computing with APL

Linux• Container technology works best with

Linux, due to the size of the kernel• Windows kernels are getting smaller

but are still 10-20x as large as Linux (~0.5-1Gb vs 50Mb).

• Good News: Your Dyalog APL code will run unchanged under Linux.o So long as it doesn't call Windows APIs

Page 51: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

50

Cloud Computing with APL

Docker for Windows• Docker for Windows uses Microsoft

Hyper-V to run either Linux or Windows virtual machines.

• It provides the same command line interface as Docker under Linuxdocker build –t myco/myapp-test .

docker run -p 8081:8080 -v /somefolder:/data –e DEBUG=1 myco/myapp-test

docker push myco/myapp-test

Page 52: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

51

Cloud Computing with APL

Page 53: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

52

Cloud Computing with APL

Page 54: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

53

Cloud Computing with APL

Page 55: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

54

Cloud Computing with APL

Page 56: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

55

Cloud Computing with APL

Public Dyalog ContainersThese currently for experimentation only and are based on UNSUPPORTED NON-COMMERCIAL Dyalog 17.1.All run full development interpreters in interactive terminal mode.

dyalog/dyalog:17.1-dbg• Linux + Dyalog APL Interpreterdyalog/jsonserver:dbg• dyalog:17.1-dbg + JSONServerdyalog/miserver:dbg• dyalog:17.1-dbg + MiServerdyalog/jupyter• dyalog:17.1-dbg + Python, Anaconda & Jupyter Notebook

Page 57: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

56

Cloud Computing with APL

FROM ubuntu:18.04ADD ./dyalog-unicode_17.0.34604_amd64.deb /RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSSADD /myapp/v7/test /myappENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

Benefits of Public ContainersWithout Public Containers

Page 58: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

57

Cloud Computing with APL

FROM ubuntu:18.04ADD ./dyalog-unicode_17.0.34604_amd64.deb /RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSSADD /myapp/v7/test /myappENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

Benefits of Public ContainersWithout Public Containers

FROM dyalog/jsonserver:dbgADD /myapp/v7/test /myappENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

With Public Containers

Page 59: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

58

Cloud Computing with APL

FROM ubuntu:18.04ADD ./dyalog-unicode_17.0.34604_amd64.deb /RUN dpkg -i /dyalog*.debRUN git clone https://github.com/dyalog/JSONServer /JSSADD /myapp/v7/test /myappENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

Benefits of Public ContainersWithout Public Containers

FROM dyalog/jsonserver:dbgADD /myapp/v7/test /myappENV RIDE_INIT="SERVE:*:4502"ENV CodeLocation=/myappCMD dyalog /JSS/JSONServer.dws

With Public Containers

docker run –p 8080:8080 –p 4502:4502 –v /myapp/v7/test:/myapp –e RIDE_INIT="SERVE:*:4502" –e CodeLocation=/myapp dyalog/jsonserver

Or even without a Dockerfile

Page 60: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

59

Cloud Computing with APL

FROM dyalog/jsonserver:dbg

ENV MAXWS=256MENV CodeLocation=/appENV Port=8080

ENV Secure=1ENV SSLValidation=64 ENV RootCertDir=/certs/ca ENV ServerCertFile=/certs/server/myserver-cert.pem ENV ServerKeyFile=/certs/server/myserver-key.pem

ADD test-certs /certs

ADD backend /app

CMD dyalog /JSONServer/Distribution/JSONServer.dws

Demo: Secure JSONServer

Runs ZodiacService backend as a secure service

Page 61: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

60

Cloud Computing with APL

FROM dyalog/jsonserver:dbg

ENV MAXWS=256MENV CodeLocation=/appENV Port=8080

ENV Secure=1ENV SSLValidation=64 ENV RootCertDir=/certs/ca ENV ServerCertFile=/certs/server/myserver-cert.pem ENV ServerKeyFile=/certs/server/myserver-key.pem

ADD test-certs /certs

ADD backend /app

CMD dyalog /JSONServer/Distribution/JSONServer.dws

Demo: Secure JSONServerAPL+JSONServer included

Runs ZodiacService backend as a secure service

Page 62: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

61

Cloud Computing with APL

FROM dyalog/jsonserver:dbg

ENV MAXWS=256MENV CodeLocation=/appENV Port=8080

ENV Secure=1ENV SSLValidation=64 ENV RootCertDir=/certs/ca ENV ServerCertFile=/certs/server/myserver-cert.pem ENV ServerKeyFile=/certs/server/myserver-key.pem

ADD test-certs /certs

ADD backend /app

CMD dyalog /JSONServer/Distribution/JSONServer.dws

Demo: Secure JSONServerAPL+JSONServer included

Basic JSONServerSettings

Runs ZodiacService backend as a secure service

Page 63: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

62

Cloud Computing with APL

FROM dyalog/jsonserver:dbg

ENV MAXWS=256MENV CodeLocation=/appENV Port=8080

ENV Secure=1ENV SSLValidation=64 ENV RootCertDir=/certs/ca ENV ServerCertFile=/certs/server/myserver-cert.pem ENV ServerKeyFile=/certs/server/myserver-key.pem

ADD test-certs /certs

ADD backend /app

CMD dyalog /JSONServer/Distribution/JSONServer.dws

Demo: Secure JSONServerAPL+JSONServer included

Basic JSONServerSettings

Secure Options

Runs ZodiacService backend as a secure service

Page 64: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

63

Cloud Computing with APL

FROM dyalog/jsonserver:dbg

ENV MAXWS=256MENV CodeLocation=/appENV Port=8080

ENV Secure=1ENV SSLValidation=64 ENV RootCertDir=/certs/ca ENV ServerCertFile=/certs/server/myserver-cert.pem ENV ServerKeyFile=/certs/server/myserver-key.pem

ADD test-certs /certs

ADD backend /app

CMD dyalog /JSONServer/Distribution/JSONServer.dws

Demo: Secure JSONServerAPL+JSONServer included

Basic JSONServerSettings

Secure Options

Runs ZodiacService backend as a secure service

Add Certificates

Page 65: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

64

Cloud Computing with APL

FROM dyalog/jsonserver:dbg

ENV MAXWS=256MENV CodeLocation=/appENV Port=8080

ENV Secure=1ENV SSLValidation=64 ENV RootCertDir=/certs/ca ENV ServerCertFile=/certs/server/myserver-cert.pem ENV ServerKeyFile=/certs/server/myserver-key.pem

ADD test-certs /certs

ADD backend /app

CMD dyalog /JSONServer/Distribution/JSONServer.dws

Demo: Secure JSONServerAPL+JSONServer included

Basic JSONServerSettings

Secure Options

Application Code

Runs ZodiacService backend as a secure service

Add Certificates

Page 66: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

65

Cloud Computing with APL

FROM dyalog/jsonserver:dbg

ENV MAXWS=256MENV CodeLocation=/appENV Port=8080

ENV Secure=1ENV SSLValidation=64 ENV RootCertDir=/certs/ca ENV ServerCertFile=/certs/server/myserver-cert.pem ENV ServerKeyFile=/certs/server/myserver-key.pem

ADD test-certs /certs

ADD backend /app

CMD dyalog /JSONServer/Distribution/JSONServer.dws

Demo: Secure JSONServerAPL+JSONServer included

Basic JSONServerSettings

Secure Options

Application Code

Start JSONServer

Runs ZodiacService backend as a secure service

Add Certificates

Page 67: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

66

Cloud Computing with APL

Page 68: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

67

Cloud Computing with APL

Page 69: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

68

Cloud Computing with APL

Demo Time

Page 70: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

69

Cloud Computing with APL

Demo TimeOn each machine, we have already:

Page 71: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

70

Cloud Computing with APL

Demo TimeOn each machine, we have already:• Installed git

Page 72: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

71

Cloud Computing with APL

Demo TimeOn each machine, we have already:• Installed git yum install git

Page 73: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

72

Cloud Computing with APL

Demo TimeOn each machine, we have already:• Installed git• Installed docker

yum install git

Page 74: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

73

Cloud Computing with APL

Demo TimeOn each machine, we have already:• Installed git• Installed docker yum install -y docker

usermod -a -G docker mary

yum install git

Page 75: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

74

Cloud Computing with APL

Demo TimeOn each machine, we have already:• Installed git• Installed docker• Installed the

Docker Util Scripts

yum install -y dockerusermod -a -G docker mary

yum install git

Page 76: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

75

Cloud Computing with APL

Demo TimeOn each machine, we have already:• Installed git• Installed docker• Installed the

Docker Util Scripts

• (and put them on the PATH)

yum install -y dockerusermod -a -G docker mary

yum install git

Page 77: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

76

Cloud Computing with APL

Demo TimeOn each machine, we have already:• Installed git• Installed docker• Installed the

Docker Util Scripts

• (and put them on the PATH)

yum install -y dockerusermod -a -G docker mary

yum install git

git clone https://github.com/mkromberg/docker-utils

Page 78: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

77

Cloud Computing with APL

Demo Time• Build the "secure" service• Push it to DockerHub• Login to an AWS EC2 instance • Start the service• Test it from a Web Browser

Page 79: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

78

Cloud Computing with APL

Page 80: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

79

Cloud Computing with APL

Page 81: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

80

Cloud Computing with APL

Page 82: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

81

Cloud Computing with APL

Page 83: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

82

Cloud Computing with APL

Page 84: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

83

Cloud Computing with APL

Dyalog Public Scripts

Page 85: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

84

Cloud Computing with APL

Dyalog Public Scriptsgit clone https://github.com/mkromberg/dyalog-docker

Page 86: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

85

Cloud Computing with APL

Dyalog Public Scriptsgit clone https://github.com/mkromberg/dyalog-docker

In parallel folders bashscripts and winscripts:

Page 87: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

86

Cloud Computing with APL

Dyalog Public Scriptsgit clone https://github.com/mkromberg/dyalog-docker

In parallel folders bashscripts and winscripts:dyalog-c folder [rideport]• Starts container dyalog/dyalog:17.1-dbg

folder is always mounted as /app in the container

rideport is the optional port that RIDE can be attached to

Page 88: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

87

Cloud Computing with APL

Dyalog Public Scriptsgit clone https://github.com/mkromberg/dyalog-docker

In parallel folders bashscripts and winscripts:dyalog-c folder [rideport]• Starts container dyalog/dyalog:17.1-dbg

jsonserver-c folder [[httpport] [rideport]]• Starts container dyalog/jsonserver-dbg

folder is always mounted as /app in the containerhttpport is the application port that is always exposed by json- & mi-serversrideport is the optional port that RIDE can be attached to

Page 89: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

88

Cloud Computing with APL

Dyalog Public Scriptsgit clone https://github.com/mkromberg/dyalog-docker

In parallel folders bashscripts and winscripts:dyalog-c folder [rideport]• Starts container dyalog/dyalog:17.1-dbg

jsonserver-c folder [[httpport] [rideport]]• Starts container dyalog/jsonserver-dbg

miserver-c folder [[httpport] [rideport]]• Starts container dyalog/miserver-dbg

folder is always mounted as /app in the containerhttpport is the application port that is always exposed by json- & mi-serversrideport is the optional port that RIDE can be attached to

Page 90: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

89

Cloud Computing with APL

Dyalog Public Scriptsgit clone https://github.com/mkromberg/dyalog-docker

In parallel folders bashscripts and winscripts:dyalog-c folder [rideport]• Starts container dyalog/dyalog:17.1-dbg

jsonserver-c folder [[httpport] [rideport]]• Starts container dyalog/jsonserver-dbg

miserver-c folder [[httpport] [rideport]]• Starts container dyalog/miserver-dbg

jupyter-c [folder[/notebook]] [httpport]• Starts container dyalog/jupyter (Jupyter notebook server)

folder is always mounted as /app in the containerhttpport is the application port that is always exposed by json- & mi-serversrideport is the optional port that RIDE can be attached to

Page 91: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

90

Cloud Computing with APL

Demo Time

Page 92: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

91

Cloud Computing with APL

Demo Time

Let's build

Page 93: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

92

Cloud Computing with APL

Demo Time

Let's build an APL Based

Page 94: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

93

Cloud Computing with APL

Demo Time

Let's build an APL BasedWeb Site

Page 95: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

94

Cloud Computing with APL

Demo Time

Let's build an APL BasedWeb Site From Zero

Page 96: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

95

Cloud Computing with APL

Demo Time

Let's build an APL BasedWeb Site From Zero

In ABOUT 2 minutes...

Page 97: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

96

Cloud Computing with APL

docker-compose (multiple services)

Page 98: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

97

Cloud Computing with APL

docker-compose (multiple services)

Page 99: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

98

Cloud Computing with APL

scaling (replicated services)

Page 100: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

99

Cloud Computing with APL

scaling (replicated services)

Page 101: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

100

Cloud Computing with APL

scaling (replicated services)

Page 102: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

101

Cloud Computing with APL

Ideas for Future ContainersRuntime and Development/Debug versions of all containers.

dyalog/tamstat• Runs HTML/JS version of Tamstat "anywhere"• Looks for data in mapped folder /data

dyalog/isolate• Runs an isolate server• If /workspace.dws is found,

each isolate will be intialised from it• /isolate.config will set security rules and other options

Page 103: Cloud Computing with APL - Dyalog Ltd.6 Cloud Computing with APL Cloud Computing: Definitions Cloud Computing = "Using someone elses computer" • SAAS (Software As A Service): You

102

Cloud Computing with APL

Conclusion• It is already easy to deploy APL applications

to the cloud (and debug them there)

• Many more public containers and tools to come.o Also "Premium Images" that you can run on cloud

systems and pay for Dyalog APL "indirectly" throuhg the service provider.

• Follow the Dyalog Webinar series for more news and examples