Introduction to Kalabox
-
Upload
gerald-villorente -
Category
Technology
-
view
744 -
download
1
Transcript of Introduction to Kalabox
Gerald Z. VillorenteDrupal | Linux | DevOps | Consultant | Open-Source Advocate
VielSoft Ltd. | MossWood Creative
Intro 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
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
About Me
Farmer Tricycle Driver Disc Jockey Systems Administrator Web Developer Drupalista DevOps Practitioner OpenStack Kid Startup Father
The Cause of Chaos
Common Reasons● Inconsistent environment● Limited/lack of knowledge on the
importance of consistency● It works on my machine
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
The Results● Buggy● Unreliable testing● Ability to break the production
Introducing Kalabox
What is Kalabox?
What is Kalabox?A framework to build reusable, super fast, highly customizable, extensible and local integrated workflow solutions for all kinds of apps.
Importants● Alpha (v0.10.5-alpha5)● Works only on Pantheon (for now)
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
Behind Kalabox● Docker● Nodejs● Boot2docker● Virtualbox
Kalabox Stuf● Pantheon ● Git● Drush● Solr● SSL● Terminus● Redis
Why Kalabox?● Isolation● Mirror production● Test Ops scripts ● Developers and QA can setup their environment easily● Faster onboarding
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.
Kalabox Filesystem
code – Contains project code (Drupal).
Kalabox Filesystem
config – Contains configurations for the environment like Drush, Solr, PHP, Terminus, MySQL, NginX, and Tomcat.
Kalabox Filesystem
dockerfiles – Contains Docker files for Kalabox images like Appserver, Mariadb, Redis, Solr, and Terminus
Kalabox Filesystem
node_modules – Contains nodejs modules.
Kalabox Filesystem
plugins – Contains custom extensions needed by the environment.
Kalabox Filesystem
scripts – Contains scripts needed by Kalabox to provision stuff or to handle depedency.
Kalabox Filesystem
kalabox.json – Main configuration file of Kalabox.
Kalabox Filesystem
package.json – Configuration file for packages.
Kalabox Examples
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)
###############################################################
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.
Shutting Kalabox
$ kbox down
info: BOOT2DOCKER => Shutting down [1].
info: BOOT2DOCKER => Shutting down [2].
info: BOOT2DOCKER => Shut down successful.
Kalabox engine has been deactivated.
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]
. . . .
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.
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
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
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
}
SSH'ng to Docker containers inside Boot2docker machine
$ docker exec -it a8f3a6abdb75 bash
root@a8f3a6abdb75:/#
Stopping Docker containers inside Boot2docker machine
$ docker stop 83e5ea89343a
83e5ea89343a
Demo
Where to start?● Vagrant● Virtualbox● Docker
In case you need more help● Google it● Stackoverflow● https://github.com/kalabox/kalabox
Question?
Good luck young man!
Contact
● Skype : gerald.villorente● E-Mail | Hangout : [email protected]● Github: https://github.com/geraldvillorente● Mobile: 09167332641
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.
Disclaimer
All images used in this presentation are not mine. Therefore, all rights reserved to the
original owner.