Introduction to Kalabox

46

Transcript of Introduction to Kalabox

Page 1: Introduction to Kalabox
Page 2: Introduction to Kalabox

Gerald Z. VillorenteDrupal | Linux | DevOps | Consultant | Open-Source Advocate

VielSoft Ltd. | MossWood Creative

Intro to Kalabox

Page 3: Introduction to Kalabox

Our greatest weakness lies in giving up. The most certain way to succeed is always to

try just one more time.

- T.A Edison

Page 4: Introduction to Kalabox

Infuse your life with action. Don't wait for it to happen. Make it happen. Make your own future. Make your own hope. Make your own love. And whatever your beliefs, honor your creator, not by passively waiting for grace to come down from upon high, but by doing what you can to make grace happen... yourself, right now, right down here on

Earth.

- Bradley Whitford

Page 5: Introduction to Kalabox

About Me

Farmer Tricycle Driver Disc Jockey Systems Administrator Web Developer Drupalista DevOps Practitioner OpenStack Kid Startup Father

Page 6: Introduction to Kalabox

The Cause of Chaos

Page 7: Introduction to Kalabox
Page 8: Introduction to Kalabox

Common Reasons● Inconsistent environment● Limited/lack of knowledge on the

importance of consistency● It works on my machine

Page 9: Introduction to Kalabox

DIY Disadvantages● Inconsistent environment● Out of sync with the standards● Long ramp-up/training for newbie● It works on my machine!● Inability to test Ops scripts

Page 10: Introduction to Kalabox

The Results● Buggy● Unreliable testing● Ability to break the production

Page 11: Introduction to Kalabox

Introducing Kalabox

Page 12: Introduction to Kalabox

What is Kalabox?

Page 13: Introduction to Kalabox

What is Kalabox?A framework to build reusable, super fast, highly customizable, extensible and local integrated workflow solutions for all kinds of apps.

Page 14: Introduction to Kalabox

Importants● Alpha (v0.10.5-alpha5)● Works only on Pantheon (for now)

Page 15: Introduction to Kalabox

With Kalabox you can:● Easily mimic your production environment on local● Setup, develop, pull and deploy your sites super fast● Standardize your teams dev environments and tools on

OSX, Windows and Linux● Easily customize or extend tooling, deployment options

and basically any other functionality● Free yourself from the tyranny of inferior local

development products

Page 16: Introduction to Kalabox

Behind Kalabox● Docker● Nodejs● Boot2docker● Virtualbox

Page 17: Introduction to Kalabox

Kalabox Stuf● Pantheon ● Git● Drush● Solr● SSL● Terminus● Redis

Page 18: Introduction to Kalabox

Why Kalabox?● Isolation● Mirror production● Test Ops scripts ● Developers and QA can setup their environment easily● Faster onboarding

Page 19: Introduction to Kalabox

Kalabox Installation● Download the Kalabox binary for your platform from

here.● For Windows just install the binary.● For Unix and Mac just place the binary to /usr/local/bin/. Rename it to kbox.

● In your terminal you can access it by typing kbox.

Page 20: Introduction to Kalabox

Kalabox Filesystem

code – Contains project code (Drupal).

Page 21: Introduction to Kalabox

Kalabox Filesystem

config – Contains configurations for the environment like Drush, Solr, PHP, Terminus, MySQL, NginX, and Tomcat.

Page 22: Introduction to Kalabox

Kalabox Filesystem

dockerfiles – Contains Docker files for Kalabox images like Appserver, Mariadb, Redis, Solr, and Terminus

Page 23: Introduction to Kalabox

Kalabox Filesystem

node_modules – Contains nodejs modules.

Page 24: Introduction to Kalabox

Kalabox Filesystem

plugins – Contains custom extensions needed by the environment.

Page 25: Introduction to Kalabox

Kalabox Filesystem

scripts – Contains scripts needed by Kalabox to provision stuff or to handle depedency.

Page 26: Introduction to Kalabox

Kalabox Filesystem

kalabox.json – Main configuration file of Kalabox.

Page 27: Introduction to Kalabox

Kalabox Filesystem

package.json – Configuration file for packages.

Page 28: Introduction to Kalabox

Kalabox Examples

Page 29: Introduction to Kalabox

Creating a Project

gerald@von-viel:~/Desktop/test$ kbox create pantheon

? Pantheon dashboard email: [email protected]

? Pantheon dashboard password: ************

? Which site? berkeley-test

? Which environment? dev

? What will you call this monster you have created: berkeley-test

Building your app...

###############################################################

Welcome to Kalabox 2!

We see this is your first time running a Kalabox command that

requires the use of the Kalabox engine. Before we can do this

We need to install some special things to make sure you are

good to go. Please agree to the prompt below to install all

the magic. (takes about 5 minutes with average download speed)

###############################################################

Page 30: Introduction to Kalabox

Starting Kalabox$ kbox up

info: BOOT2DOCKER => Starting up. maxRetries=3, max=3

info: BOOT2DOCKER => Initializing boot2docker [1].

info: BOOT2DOCKER => Sharing folders [1].

info: BOOT2DOCKER => Bringing boot2docker up [1].

info: BOOT2DOCKER => Boot2docker is up.

Kalabox engine has been activated.

Page 31: Introduction to Kalabox

Shutting Kalabox

$ kbox down

info: BOOT2DOCKER => Shutting down [1].

info: BOOT2DOCKER => Shutting down [2].

info: BOOT2DOCKER => Shut down successful.

Kalabox engine has been deactivated.

Page 32: Introduction to Kalabox

Running Kalabox Containers

$ kbox berkeley-test start

info: BOOT2DOCKER => Starting up. maxRetries=3, max=3

info: BOOT2DOCKER => Initializing boot2docker [1].

info: BOOT2DOCKER => Sharing folders [1].

info: BOOT2DOCKER => Bringing boot2docker up [1].

info: BOOT2DOCKER => Boot2docker is up.

Kalabox engine has been activated.

info: DOCKER => Creating ad hoc container "kalabox/debian:stable". name=kalabox_temp-8c014d39-1b61-4620-9ce3-a3ba30bf4eaa, Cmd=[bash], Tty=true, Image=kalabox/debian:stable, Env=[APPDOMAIN=berkeley-test.kbox, KBOX_CODEDIR=code, KALABOX=true, APPNAME=berkeley-test, SSH_KEY=pantheon.kalabox.id_rsa, GITUSER=Gerald Villorente, [email protected], [email protected]], VolumesFrom=[kb_berkeley-test_data]

info: DOCKER => Ad hoc container created. 1b0fcbe5f01f0f9336e9761f254264113f6008efc97ed674a5c6bbad0d099182

info: DOCKER => Starting ad hoc container "1b0fcbe5f01f0f9336e9761f254264113f6008efc97ed674a5c6bbad0d099182". Binds=[/Users/gerald/Desktop/test/berkeley-test:/src:rw]

. . . .

Page 33: Introduction to Kalabox

Stopping Kalabox Containers

$ kbox stop

info: DOCKER => Stopping container. 83e5ea89343a57a33cc8834c68474bdc4ea984b06f42c2a6173381b5448ae649

info: DOCKER => Container stopped. 83e5ea89343a57a33cc8834c68474bdc4ea984b06f42c2a6173381b5448ae649

info: DOCKER => Stopping container. 0d370cb158d7986a07ca750ca22f1cef53b0dd551b62b11ee8b7bad48f2b5e1f

info: DOCKER => Container stopped. 0d370cb158d7986a07ca750ca22f1cef53b0dd551b62b11ee8b7bad48f2b5e1f

info: DOCKER => Stopping container. 7c65caea63cd92cdb0e6508a99643b04b7d2baab14d57427603b6a3fdd7fb6ca

info: DOCKER => Container stopped. 7c65caea63cd92cdb0e6508a99643b04b7d2baab14d57427603b6a3fdd7fb6ca

info: DOCKER => Stopping container. 113fba72fc69ba59b5f514d043083544c34145a86b5124638ff1468db6f48772

info: DOCKER => Container stopped. 113fba72fc69ba59b5f514d043083544c34145a86b5124638ff1468db6f48772

info: BOOT2DOCKER => Shutting down [1].

info: BOOT2DOCKER => Shut down successful.

Kalabox engine has been deactivated.

Page 34: Introduction to Kalabox

SSH'ng to Kalabox

$ boot2docker --vm="Kalabox2" ssh

## .

## ## ## ==

## ## ## ## ## ===

/"""""""""""""""""\___/ ===

~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~

\______ o __/

\ \ __/

\____\_______/

_ _ ____ _ _

| |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __

| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|

| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ |

|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|

Boot2Docker version 1.8.1, build master : 075b6aa - Tue Aug 25 07:53:54 UTC 2015

Docker version 1.8.1, build d12ea79

Page 35: Introduction to Kalabox

Listing Docker containers$ docker ps --all

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

a8f3a6abdb75 kalabox/syncthing:v0.10.0 "/bin/bash /start.sh" 3 hours ago Up 3 hours 0.0.0.0:22000->22000/tcp, 0.0.0.0:21025-21026->21025-21026/udp, 0.0.0.0:60008->60008/tcp kalabox_syncthing

83e5ea89343a kalabox/pantheon-appserver:v0.10.0 "/root/start.sh" 12 hours ago Up 3 hours 0.0.0.0:32769->80/tcp, 0.0.0.0:32768->443/tcp kb_berkeley-test_appserver

113fba72fc69 kalabox/pantheon-mariadb:v0.10.0 "/start.sh" 12 hours ago Up 3 hours 0.0.0.0:32775->3306/tcp kb_berkeley-test_db

7c65caea63cd kalabox/pantheon-solr:v0.10.0 "/bin/bash /start.sh" 12 hours ago Up 3 hours 0.0.0.0:32774->449/tcp kb_berkeley-test_solr

0d370cb158d7 kalabox/pantheon-redis:v0.10.0 "/usr/bin/redis-serve" 12 hours ago Up 3 hours 0.0.0.0:32773->80/tcp, 0.0.0.0:32772->443/tcp, 0.0.0.0:32771->8160/tcp, 0.0.0.0:32770->8161/tcp kb_berkeley-test_redis

fa4dcc00208a kalabox/data:v0.10.0 "/bin/true" 12 hours ago Created kb_berkeley-test_data

58dfb5aa9a28 kalabox/skydock:v0.10.0 "/skydock -ttl 214748" 12 hours ago Up 3 hours kalabox_skydock

1461f090bed5 kalabox/hipache:v0.10.0 "supervisord -n" 12 hours ago Up 3 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8160->8160/tcp kalabox_hipache

d5f4167da6e5 kalabox/dnsmasq:v0.10.0 "/root/start.sh" 12 hours ago Up 3 hours 10.13.37.42:53->53/udp, 53/tcp kalabox_dnsmasq

b3b391f5cd80 kalabox/data:v0.10.0 "/bin/true" 12 hours ago Exited (0) 3 hours ago kalabox_data

8df876a5b56c kalabox/skydns:v0.10.0 "/skydns -http 0.0.0." 12 hours ago Up 3 hours 172.17.42.1:53->53/udp, 8080/tcp kalabox_skydns

Page 36: Introduction to Kalabox

Listing Application Containers$ kbox containers

{

"id": "0d370cb158d7986a07ca750ca22f1cef53b0dd551b62b11ee8b7bad48f2b5e1f",

"name": "kb_berkeley-test_redis",

"app": "berkeley-test",

"ports": [

"443/tcp=>32772",

"80/tcp=>32773",

"8160/tcp=>32771",

"8161/tcp=>32770"

],

"running": true

}

{

"id": "83e5ea89343a57a33cc8834c68474bdc4ea984b06f42c2a6173381b5448ae649",

"name": "kb_berkeley-test_appserver",

"app": "berkeley-test",

"ports": [

"443/tcp=>32768",

"80/tcp=>32769"

],

"running": true

}

{

"id": "113fba72fc69ba59b5f514d043083544c34145a86b5124638ff1468db6f48772",

"name": "kb_berkeley-test_db",

"app": "berkeley-test",

"ports": [

"3306/tcp=>32775"

],

"running": true

}

{

"id": "7c65caea63cd92cdb0e6508a99643b04b7d2baab14d57427603b6a3fdd7fb6ca",

"name": "kb_berkeley-test_solr",

"app": "berkeley-test",

"ports": [

"449/tcp=>32774"

],

"running": true

}

Page 37: Introduction to Kalabox

SSH'ng to Docker containers inside Boot2docker machine

$ docker exec -it a8f3a6abdb75 bash

root@a8f3a6abdb75:/#

Page 38: Introduction to Kalabox

Stopping Docker containers inside Boot2docker machine

$ docker stop 83e5ea89343a

83e5ea89343a

Page 39: Introduction to Kalabox

Demo

Page 40: Introduction to Kalabox

Where to start?● Vagrant● Virtualbox● Docker

Page 41: Introduction to Kalabox

In case you need more help● Google it● Stackoverflow● https://github.com/kalabox/kalabox

Page 42: Introduction to Kalabox

Question?

Page 43: Introduction to Kalabox

Good luck young man!

Page 44: Introduction to Kalabox

Contact

● Skype : gerald.villorente● E-Mail | Hangout : [email protected]● Github: https://github.com/geraldvillorente● Mobile: 09167332641

Page 45: Introduction to Kalabox

Credits● Mike Pirog of Kalamuna, Kalabox project lead.● Drupal User Group Cebu headed by Luc Bezier and PrometSource.● AsiaWorld Advertising for sponsoring my accomodation and food.● MossWood Creative● VielSoft Ltd.

Page 46: Introduction to Kalabox

Disclaimer

All images used in this presentation are not mine. Therefore, all rights reserved to the

original owner.