Stand/server provisioning (DevOps specific)
When I thought about code/script organization it was important to make provision solution which could afford:
- Use the same provision scripts for testing/development/production.
- Make stand provisioning on-fly without additional artifact preparations
- Use versioning (use specific versions on production stand, and development (sometimes SNAPSHOT) versions on development/stand environments)
Main tools
- gradle - main build tool
- docker-compose - for docker group deployment automation
- docker - lightweight container for linux
- puppet - provisioning tool
About deployment submodule structure
- “docker_template” - Docker templates
- “puppet_config” - puppet’s config files to change in container and docker images
- “modules” - custom puppet modules for provisioning (infrastructure component, os-specific settings and so on)
- “production” - production-specific script, Puppet’s Hiera databse and puppet’s
sites.pp
- “test” - test-specific script, Puppet’s Hiera databse and puppet’s
sites.pp
- “development” - development-specific script, Puppet’s Hiera databse and puppet’s
sites.pp
- “teststand” - test-specific script, Puppet’s Hiera databse and puppet’s
sites.pp
- provision_development.sh - provision-batch file
- provision_production.sh - provision-batch file
- provision_test.sh - provision_production.sh
- provision_teststand.sh - provision_production.sh
Versioning
All versions should be specified in puppet’s config (on stand or production environment) in yaml %{environment}/hieradata/version.yaml
, so you should edit necessary configs
About stands
General note
- there are several kinds of stands:
- development - stand for development where all componenets should be run manually
- test - stand for testing purposes
- production - main production stand
- stand initialization is done with help of gradle tasks (from store_line2_build repo “build_scripts/build-tasks.gradle”)
- !!!names of containers should be the same as names of projects/submodules
- all services are running under control and monitoring monit - it gives nice UI to see service status (see at Monitoring Links)
About “test”/”development”
- stand preparation is done with help of
gradle prepareStand
(creates necessary files but doesn’t run anything) - real run is done with help of docker/docker-compose, so it must be done under
root
account
Sreparation steps:
- Stand type detected (development by default) but could be changed with help of additional parameter,
gradle -Pstand_type=test
) - Configuration file
story_line2_build/docker-%{environment}.properties
is read - Directory for data, logs and stand dir is created
- Docker templates from “docker_templates” are copied with substitution from
story_line2_build/docker-%{environment}.properties
- if version of component used “presented” completed artifact is copied to dir
{docker_cont}/artifacts
Running steps (under root)
- in stand dir docker-compose (
docker-compose.yml
), is ran (docker ‘ENTRYPOINT’) - a lot of different bash scripts could be used for it
Table of content:
- Home
- Prerequisites
- Developement stand provisioning
- Components
- Crawler (Spring Boot, Java)
- Message Broker (Kafka)
- Distributed file storage (Hadoop’s HDFS)
- Data warehouse (Apache Hive)
- Distributed business logic cluster (Akka, Scala)
- Distributed data processing cluster (Spark, Scala)
- Indexing/Search engine (Elasticsearch)
- REST server (Lagom, Scala)
- Service coordination (Zookeeper)
- Time-series database (monitoring data) (InfluxDB)
- Metrics collector (Telegraf)
- Monitoring visualization service (Grafana)
- Reverse proxy/load-balancer (nginx)
- Monitoring Links
- Development