Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2932: Consolidate puppet manifests into 'site.pp' #2936

Merged
merged 59 commits into from
Mar 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
cd376cf
#2932: restructure 'vagrant' puppet environment
jeff1evesque Mar 6, 2017
addb6db
#2932: Vagrantfile, standardize comments
jeff1evesque Mar 6, 2017
3524929
#2932: init.pp, reduce docstring
jeff1evesque Mar 6, 2017
46caac7
#2932: restructure 'docker' puppet environment
jeff1evesque Mar 6, 2017
456c300
#2932: site.pp, add file
jeff1evesque Mar 6, 2017
99350db
#2932: remove unnecessary class nesting
jeff1evesque Mar 7, 2017
d4972ff
#2932: remove unnecessary class nesting
jeff1evesque Mar 7, 2017
b1beb2c
#2932: init.pp, 'require system::webcompiler_directory'
jeff1evesque Mar 7, 2017
4b306b6
#2932: resolve 'duplicate' declaration for 'python-dev'
jeff1evesque Mar 7, 2017
e269c52
#2932: site.pp, enforce order with 'contain'
jeff1evesque Mar 7, 2017
fe1829a
#2932: use 'contain' more, implement 'package::nodejs'
jeff1evesque Mar 7, 2017
04e49fb
#2932: require 'package::pyyaml'
jeff1evesque Mar 7, 2017
10bb10e
#2932: Puppetfile, update to 'v2.3.0'
jeff1evesque Mar 7, 2017
d346765
#2932: further require 'package::nodejs'
jeff1evesque Mar 7, 2017
6fbd7ca
#2932: react_presets.pp, require 'package:nodejs'
jeff1evesque Mar 7, 2017
09eaad6
#2932: move 'package::webcompilers' into 'webcompilers.pp'
jeff1evesque Mar 7, 2017
7746bba
#2932: 'compiler::webcompilers' in start scripts
jeff1evesque Mar 7, 2017
3e4287f
#2932: service defined, and initial compile before service start
jeff1evesque Mar 7, 2017
a8e0062
#2932: notify webserver service when configuration changes
jeff1evesque Mar 7, 2017
3ab9918
#2932: notify webserver service when configuration changes
jeff1evesque Mar 7, 2017
7b28be6
#2932: default.dockerfile, remove 'ls -l [...]/js'
jeff1evesque Mar 7, 2017
2f06afd
#2932: default.dockerfile, remove 'ls -l'
jeff1evesque Mar 7, 2017
50b497b
#2932: .travis.yml, update to current 'docker-ce'
jeff1evesque Mar 8, 2017
5e52b82
#2932: .travis.yml, remove redundant 'docker' service
jeff1evesque Mar 8, 2017
c2d6a1e
#2932: .travis.yml, replace duplicate line with 'edge'
jeff1evesque Mar 8, 2017
0dfcf50
#2932: .travis.yml, re-establish 'docker' service
jeff1evesque Mar 8, 2017
3d1052f
#2932: .travis.yml, use 'sudo' to join docker containers
jeff1evesque Mar 8, 2017
9c55fc0
#2932: redis.dockerfile, exec with shell
jeff1evesque Mar 8, 2017
03268bb
#2932: redis.dockerfile, alternative exec with shell
jeff1evesque Mar 8, 2017
9929864
#2932: fix typo, use alternative exec with shell
jeff1evesque Mar 8, 2017
d39d0e0
#2932: remove '-l' for login shell
jeff1evesque Mar 8, 2017
0b79cf6
#2932: service.pp, require 'compiler::initial_compile'
jeff1evesque Mar 8, 2017
b6d3ba1
#2932: default.dockerfile, update r10k to '2.5.2'
jeff1evesque Mar 8, 2017
a47738b
#2932: start.pp, minor style change
jeff1evesque Mar 8, 2017
f2ba3ec
#2932: relocate 'pyyaml' package
jeff1evesque Mar 8, 2017
c37bd69
#2932: webserver.dockerfile, test 'pyyaml' installation
jeff1evesque Mar 8, 2017
cb1acde
#2932: webserver.dockerfile, test 'pyyaml' installation
jeff1evesque Mar 8, 2017
ef240b8
#2932: webserver.dockerfile, remove 'pyyaml'
jeff1evesque Mar 8, 2017
eab1a2f
#2932: init.pp, 'contain xxx'
jeff1evesque Mar 8, 2017
b9ee71c
#2932: .travis.yml, remove 'sudo'
jeff1evesque Mar 8, 2017
dc00bb1
#2932: Puppetfile, revert 'nodejs' version
jeff1evesque Mar 8, 2017
224d523
#2932: Puppefile, update 'nodejs' to '2.3.0'
jeff1evesque Mar 8, 2017
600e6b3
#2932: hiera.yaml, update syntax to version 5
jeff1evesque Mar 8, 2017
d8f2935
#2932: default.dockerfile, uninstall npm
jeff1evesque Mar 8, 2017
a4b0ec3
#2932: hiera.yaml, add yaml file extension
jeff1evesque Mar 8, 2017
fa386e6
#2932: default.dockerfile, adjust comment
jeff1evesque Mar 8, 2017
bf8dc6d
#2932: default.dockerfile, remove nodejs, node, npm
jeff1evesque Mar 8, 2017
900d93f
#2932: default.dockerfile, remove 'npm uninstall'
jeff1evesque Mar 8, 2017
c352e0f
#2932: default.dockerfile, debug for package versions
jeff1evesque Mar 8, 2017
9c8b4c7
#2932: default.dockerfile, get node version
jeff1evesque Mar 8, 2017
b71b5ed
#2932: Puppetfile, update reference for 'nodejs'
jeff1evesque Mar 8, 2017
577da8c
#2932: default.dockerfile, remove 'node -v'
jeff1evesque Mar 8, 2017
d2afe3d
#2932: Puppetfile, update stdlib version
jeff1evesque Mar 8, 2017
ae3cf11
#2932: default.dockerfile, remove 'nodejs -v'
jeff1evesque Mar 8, 2017
3ce906c
#2932: nodejs.pp, install node 4.x
jeff1evesque Mar 8, 2017
ca291b3
#2932: nodejs.pp, restrict nodejs version
jeff1evesque Mar 8, 2017
2f9a456
#2932: .travis.yml, use 'dist' to install trusty
jeff1evesque Mar 8, 2017
cf665a2
#2932: nodejs.pp, ensure 'latest' nodjs
jeff1evesque Mar 8, 2017
7ad4853
#2932: nodejs.pp, ensure nodejs repo '4.x'
jeff1evesque Mar 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
sudo: required

language: python

## allows 'docker' command
services:
- docker
dist: trusty
sudo: required

## environment variables
env:
global:
- DOCKER_VERSION=1.12.3-0~trusty
- DOCKER_VERSION=17.03.0~ce-0~ubuntu-trusty

## build docker, install puppet (i.e. puppet parser validate)
##
## Note: we install docker per dockers official documentation:
##
## https://docs.docker.com/engine/installation/linux/ubuntu/
##
before_install:
# docker version before update
- docker version

# list docker-engine versions
#- apt-cache madison docker-engine

# upgrade docker-engine to specific version
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}

# docker version after update
- docker version
# install docker to specific version
- sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get install docker-ce=${DOCKER_VERSION}

# install puppet
- wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
Expand Down
130 changes: 16 additions & 114 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
## -*- mode: ruby -*-
## vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
## All Vagrant configuration is done below. The "2" in Vagrant.configure
## configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
## you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
## The most common configuration options are documented and commented below.
## For a complete reference, please see the online documentation at
## https://docs.vagrantup.com.

## Variables (ruby syntax)
atlas_repo = 'jeff1evesque'
Expand Down Expand Up @@ -39,7 +39,7 @@ Vagrant.configure(2) do |config|
end

## Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
## boxes at https://atlas.hashicorp.com/search.
config.vm.box = "#{atlas_repo}/#{atlas_box}"
config.vm.box_download_checksum = 'c26da6ba1c169bdc6e9168125ddb0525'
config.vm.box_url = "https://atlas.hashicorp.com/#{atlas_repo}/boxes/#{atlas_box}/versions/#{box_version}/providers/virtualbox.box"
Expand All @@ -49,8 +49,8 @@ Vagrant.configure(2) do |config|
config.puppet_install.puppet_version = '4.9.3'

## Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
## within the machine from a port on the host machine. In the example below,
## accessing "localhost:8080" will access port 80 on the guest machine.
config.vm.network 'forwarded_port', guest: 5000, host: 8080
config.vm.network 'forwarded_port', guest: 443, host: 8585

Expand All @@ -64,8 +64,9 @@ Vagrant.configure(2) do |config|
config.r10k.puppetfile_path = "puppet/environment/#{environment}/Puppetfile"

## Custom Manifest: install needed packages
#
# Note: future parser allow array iteration in the puppet manifest
##
## Note: future parser allow array iteration in the puppet manifest
##
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
Expand All @@ -74,110 +75,11 @@ Vagrant.configure(2) do |config|
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'install_packages.pp'
puppet.manifest_file = 'site.pp'
puppet.hiera_config_path = 'hiera.yaml'
end

## Custom Manifest: build scikit-learn
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
puppet.manifests_path = "puppet/environment/#{environment}/manifests"
puppet.module_path = [
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'install_sklearn.pp'
puppet.hiera_config_path = 'hiera.yaml'
end

## Custom Manifest: ensure vagrant-mounted event
#
# Note: future parser allow heredoc syntax in the puppet manifest (since puppet 3.5)
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
puppet.manifests_path = "puppet/environment/#{environment}/manifests"
puppet.module_path = [
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'vagrant_mounted.pp'
puppet.hiera_config_path = 'hiera.yaml'
end

## Custom Manifest: install redis client / server
#
# Note: future parser allow heredoc syntax in the puppet manifest (since puppet 3.5)
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
puppet.manifests_path = "puppet/environment/#{environment}/manifests"
puppet.module_path = [
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'configure_redis.pp'
puppet.hiera_config_path = 'hiera.yaml'
end

## Custom Manifest: configure system (i.e. system timezone)
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
puppet.manifests_path = "puppet/environment/#{environment}/manifests"
puppet.module_path = [
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'configure_system.pp'
end

## Custom Manifest: define webcompilers
#
# Note: future parser allow heredoc sytnax (since puppet 3.5), and allows
# array iteration in the puppet manifest.
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
puppet.manifests_path = "puppet/environment/#{environment}/manifests"
puppet.module_path = [
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'compile_asset.pp'
puppet.hiera_config_path = 'hiera.yaml'
end

## Custom Manifest: install, and configure SQL database
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
puppet.manifests_path = "puppet/environment/#{environment}/manifests"
puppet.module_path = [
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'setup_database.pp'
puppet.hiera_config_path = 'hiera.yaml'
end

## Custom Manifest: start webserver
#
# Note: future parser allow heredoc syntax in the puppet manifest (since puppet 3.5)
config.vm.provision 'puppet' do |puppet|
puppet.environment_path = 'puppet/environment'
puppet.environment = environment
puppet.manifests_path = "puppet/environment/#{environment}/manifests"
puppet.module_path = [
"puppet/environment/#{environment}/modules_contrib",
"puppet/environment/#{environment}/modules",
]
puppet.manifest_file = 'start_webserver.pp'
puppet.hiera_config_path = 'hiera.yaml'
end

# clean up files on the host after 'vagrant destroy'
## clean up files on the host after 'vagrant destroy'
config.trigger.after :destroy do
run 'rm -Rf log/database'
run 'rm -Rf log/application'
Expand Down
4 changes: 2 additions & 2 deletions database.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV ENVIRONMENT docker
ENV ENVIRONMENT_DIR $ROOT_PROJECT/puppet/environment/$ENVIRONMENT

## provision with puppet
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/manifests/setup_database.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/modules/database/manifests/init.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test

## executed everytime container starts
CMD ["mysqld"]
CMD ["/bin/sh", "-c", "mysqld"]
20 changes: 8 additions & 12 deletions default.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ RUN mkdir /var/machine-learning
COPY . /var/machine-learning

## install git, wget, pip
#
# Note: r10k requires 'git' installed
##
## Note: r10k requires 'git' installed
##
RUN apt-get -y update
RUN apt-get -y install git=1:1.9.1-1ubuntu0.3
RUN apt-get -y install wget=1.15-1ubuntu1.14.04.2
Expand All @@ -25,7 +26,7 @@ RUN apt-get -y install puppet-agent

## install r10k
RUN apt-get -y install rubygems-integration=1.5
RUN gem install r10k -v 2.2.0
RUN gem install r10k -v 2.5.2

## install pytest-cov
RUN pip install pytest-cov==2.4.0
Expand All @@ -35,12 +36,7 @@ RUN mkdir -p $ENVIRONMENT_DIR/modules_contrib/
RUN PUPPETFILE=$ENVIRONMENT_DIR/Puppetfile PUPPETFILE_DIR=$ENVIRONMENT_DIR/modules_contrib/ r10k puppetfile install

## provision with puppet
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/manifests/install_packages.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/manifests/install_sklearn.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/manifests/configure_system.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/manifests/compile_asset.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test --debug

## show directory
RUN ls -l $ROOT_PROJECT/interface/static/js
RUN ls -l $ROOT_PROJECT/interface/static/css
RUN ls -l $ROOT_PROJECT/interface/static/img
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/modules/package/manifests/init.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/modules/sklearn/manifests/init.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/modules/system/manifests/init.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test
RUN /opt/puppetlabs/bin/puppet apply $ENVIRONMENT_DIR/modules/compiler/manifests/init.pp --modulepath=$ENVIRONMENT_DIR/modules_contrib:$ENVIRONMENT_DIR/modules --confdir=$ROOT_PROJECT/hiera/test --debug
16 changes: 9 additions & 7 deletions hiera/test/hiera.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
:backends:
- yaml
version: 5
defaults:
datadir: /var/machine-learning/hiera
data_hash: yaml_data

:yaml:
:datadir: /var/machine-learning/hiera
hierarchy:
- name: 'General build packages'
path: packages.yaml

:hierarchy:
- packages
- test/hiera/settings
- name: 'General application settings'
path: test/hiera/settings.yaml
6 changes: 3 additions & 3 deletions puppet/environment/docker/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Install Module: stdlib (apt dependency)
mod 'stdlib',
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
:ref => '4.11.0'
:ref => '4.15.0'

## Install Module: apt (from master)
mod 'apt',
Expand All @@ -14,8 +14,8 @@ mod 'apt',

## Install Module: nodejs
mod 'nodejs',
:git => 'https://github.com/puppet-community/puppet-nodejs.git',
:ref => 'v1.3.0'
:git => 'https://github.com/voxpupuli/puppet-nodejs.git',
:ref => 'v2.3.0'

## Install Module: git
mod 'git',
Expand Down
47 changes: 0 additions & 47 deletions puppet/environment/docker/manifests/compile_asset.pp

This file was deleted.

9 changes: 0 additions & 9 deletions puppet/environment/docker/manifests/configure_redis.pp

This file was deleted.

9 changes: 0 additions & 9 deletions puppet/environment/docker/manifests/configure_system.pp

This file was deleted.

Loading