The Sandbox Theory
How Easily Manage Your Dev Environment and
Not Be Buried in Dependency Configuration
in The Microservice World
Shestakov Illia, Senior Programmer
2www.luxoft.com
What is Sandbox?
A sandbox is a testing environment that isolates untested code changes and outright
experimentation from the production environment or repository.
Sandbox characteristics:
 isolated
 repeatable
 production-like
3www.luxoft.com
No Sandbox
at all
?
Sandbox Evolution
4www.luxoft.com
Case Study
Result App
(NodeJS)
db
(PostgreSQL)
https://github.com/dockersamples/example-voting-app
5www.luxoft.com
Case Study
Result App
(NodeJS)
db
(PostgreSQL)
Worker
(C#)
Voting App
(Python)
PubSub
(Redis)
https://github.com/dockersamples/example-voting-app
6www.luxoft.com
Voting App
(Python)
PubSub
(Redis)
Case Study
Result App
(NodeJS)
db
(PostgreSQL)
Worker
(C#)
https://github.com/dockersamples/example-voting-app
7www.luxoft.com
Case Study
Result App
(NodeJS)
db
(PostgreSQL)
Worker
(C#)
Voting App
(Python)
PubSub
(Redis)
https://github.com/dockersamples/example-voting-app
8www.luxoft.com
No Sandbox (local env)
Pros
 ???
Cons
 Not portable
 Hard to evolve
9www.luxoft.com
Vagrant
Pros
 Portable
 Automated
Cons
 Hard to maintain
 Long start up time
 Not transient
10www.luxoft.com
Docker Compose
Pros
 Applications are packaged as docker
images
 Lightweight
 Fast
Cons
 Requires manual updates
11www.luxoft.com
Carnotzet
12www.luxoft.com
Carnotzet Main Features
 Packaged with Maven
 Uses Maven to manage dependencies.
 Leverages docker-compose.
 Hierarchical configuration management (overrides & merges).
 Java & Maven API
 Easy to extend
13www.luxoft.com
Configuration over Convention
 Simple Maven Artifact with JAR packaging
 Module name should end with -carnotzet
 Each file in src/main/resources/${dependency_name}/files will be mounted to a container
${dependency_name}.
 Files with .merge extension will be merged with corresponding existing dependency resource
in hierarchical way (only for .properties, .json)
14www.luxoft.com
Docker-specific config
src/main/resources/carnotzet.properties
docker.image The docker image to use for this module.
none - for aggregator
docker.entrypoint Override the entrypoint of docker image. JSON array
docker.cmd Override the cmd of docker image. JSON array
start.by.default Start the module on default start. Useful for optional services.
true/false
exposed.ports Expose ports to the host. Useful for Windows environment. Same
format as for docker-compose
15www.luxoft.com
Maven API
16www.luxoft.com
Java API
Creating runtime
Waiting for log entries
17www.luxoft.com
18www.luxoft.com
Carnotzet Extensions
com.github.swissquote.carnotzet.core.config.FileMerger
com.github.swissquote.carnotzet.core.CarnotzetExtension
com.github.swissquote.carnotzet.maven.plugin.spi.CarnotzetExtensionsFactory
https://github.com/ishestakov/carnotzet-jacoco-extension
19www.luxoft.com
85 in TOTAL!
New Challenges
Real life project Sandbox dependency graph
20www.luxoft.com
Q&A?
Q&A?
Thank You!
https://github.com/swissquote/carnotzet
https://swissquote.github.io/carnotzet/
https://github.com/ishestakov/carnotzet-jacoco-extension

Shestakov Illia "The Sandbox Theory"