Skip to content

Commit

Permalink
#2414: resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff1evesque committed Mar 17, 2016
2 parents f5a8c45 + 1ec88d6 commit 6f49c38
Show file tree
Hide file tree
Showing 68 changed files with 787 additions and 473 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/interface/static/js/
/interface/static/css/
/interface/static/img/
/puppet/modules/
/puppet/environment/development/modules_contrib/
/test/.cache
/test/programmatic_interface/.cache
/test/programmatic_interface/__pycache__
Expand Down
2 changes: 0 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ Vagrant.configure(2) do |config|
puppet.manifests_path = 'puppet/environment/development/manifests'
puppet.module_path = ['puppet/environment/development/modules_contrib', 'puppet/environment/development/modules']
puppet.manifest_file = 'vagrant_mounted.pp'
end

## Custom Manifest: install redis client / server
#
Expand Down Expand Up @@ -108,7 +107,6 @@ Vagrant.configure(2) do |config|
puppet.manifests_path = 'puppet/environment/development/manifests'
puppet.module_path = ['puppet/environment/development/modules_contrib', 'puppet/environment/development/modules']
puppet.manifest_file = 'configure_system.pp'
end

## Custom Manifest: define webcompilers
#
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod 'apt',
## Install Module: nodejs
mod 'nodejs',
:git => 'git@github.com:puppet-community/puppet-nodejs.git',
:ref => '1.2.0'
:ref => 'v1.3.0'

## Install Module: git
mod 'git',
Expand Down
4 changes: 4 additions & 0 deletions puppet/environment/development/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""@__init__
This file allows the containing directory to be considered a python package,
consisting of python module(s).
"""
48 changes: 48 additions & 0 deletions puppet/environment/development/manifests/compile_asset.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
### compile_asset.pp: install, configure, and run initial compile against
### source files.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## install package dependencies
class dependencies {
contain package::webcompilers
}

## configure webcompilers
class configure {
## set dependency
require dependencies

## configure webcompilers
contain compiler::webcompilers
}

## start webcompilers
class start {
## set dependency
require dependencies
require configure

## start compiler(s)
contain compiler::start_sass
contain compiler::start_uglifyjs
contain compiler::start_browserify
contain compiler::start_imagemin
}

## initial compile
class initiate {
## set dependency
require dependencies
require configure
require start

## initial compile
contain compiler::initial_compile
}

## initiate
include initiate
12 changes: 12 additions & 0 deletions puppet/environment/development/manifests/configure_redis.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### configure_redis.pp: install redis client, and redis server.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## install redis client
include redis::client

## install redis-server
include redis::server
9 changes: 9 additions & 0 deletions puppet/environment/development/manifests/configure_system.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### configure_system.pp: configure system with general requirements.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## define system timezone
include system::set_timezone
12 changes: 12 additions & 0 deletions puppet/environment/development/manifests/configure_webserver.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### configure_webserver.pp: implement webserver, with necessary dependencies.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## create log directory
include system::log_directory

## install webserver
include webserver::service
39 changes: 39 additions & 0 deletions puppet/environment/development/manifests/install_packages.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### install_packages.pp: install general packages.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## nodejs, with npm: this cannot be wrapped into a module, and included, as
# needed. Puppet will only allow one instance of this class, regardless of
# of its implementation.
class install_nodejs {
## set dependency
require apt

## install nodejs, with npm
class { 'nodejs':
repo_url_suffix => '5.x',
}
contain nodejs
}

## general packages
class general_packages {
## set dependency
require apt
require install_nodejs

## install packages
contain package::dos2unix
contain package::inotify_tools
contain package::react_presets
contain package::jsonschema
contain package::xmltodict
contain package::six
contain system::webcompiler_directories
}

## initiate
include general_packages
21 changes: 21 additions & 0 deletions puppet/environment/development/manifests/install_sklearn.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### install_sklearn.pp: install sklearn, with all necessary dependencies.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## create '/vagrant/build/' directory
include system::build_directory

## install sklearn dependencies
include package::sklearn_dependencies

## download scikit-learn
include package::sklearn

## build scikit-learn
include sklearn::build_sklearn

## install scikit-learn
include sklearn::install_sklearn
19 changes: 19 additions & 0 deletions puppet/environment/development/manifests/setup_database.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### setup_database.pp: install client, server, bindings, and initialize
### database with required tables.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## install mariadb
include database::server

## install mariadb client
include database::client

## install mariad bindings
include database::bindings

## create database tables
include database::database
9 changes: 9 additions & 0 deletions puppet/environment/development/manifests/start_webserver.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### start_webserver.pp: start webserver.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## start webservers
include webserver::start
17 changes: 17 additions & 0 deletions puppet/environment/development/manifests/vagrant_mounted.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### vagrant_mounted.pp: ensure 'vagrant-mounted' event fires, when '/vagrant'
### shared directory, is mounted within the guest virtual
### machine.
###
### Note: the prefix 'package::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###

## install dos2unix
include package::dos2unix

## configure service
include vagrant::service

## start service
include vagrant::start
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
### Note: the prefix 'compiler::::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class compiler::initial_compile {
$sources = [
'jsx',
'img',
'scss',
'js'
]

$sources.each |String $source| {
## variables
$check_files = "if [ \"$(ls -A /vagrant/src/${source}/)\" ];"
$touch_files = "then touch /vagrant/src/${source}/*; fi"

## touch source: ensure initial build compiles every source file.
#
# @touch, changes the modification time to the current system time.
#
# Note: the current inotifywait implementation watches close_write, move,
# and create. However, the source files will already exist before
# this 'inotifywait', since the '/vagrant' directory will already
# have been mounted on the initial build.
#
# Note: every 'command' implementation checks if directory is nonempty,
# then touch all files in the directory, respectively.
exec { "touch-${source}-files":
command => "${check_files} ${touch_files}",
provider => shell,
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Note: the prefix 'compiler::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class compiler::start_browserify {
service { 'browserify':
ensure => 'running',
enable => true,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Note: the prefix 'compiler::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class compiler::start_imagemin {
service { 'imagemin':
ensure => 'running',
enable => true,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Note: the prefix 'compiler::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class compiler::start_sass {
service { 'sass':
ensure => 'running',
enable => true,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Note: the prefix 'compiler::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class compiler::start_uglifyjs {
service { 'uglifyjs':
ensure => 'running',
enable => true,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
### Note: the prefix 'compiler::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class compiler::webcompilers {
## variables
$environment = 'development'

$compilers = [
'browserify',
'imagemin',
'sass',
'uglifyjs'
]

$compilers.each |String $compiler| {
## create startup script: for webcompilers, using puppet templating
file { "${compiler}-startup-script":
path => "/etc/init/${compiler}.conf",
ensure => 'present',
content => template("/vagrant/puppet/environment/${environment}/template/webcompilers.erb"),
notify => Exec["dos2unix-upstart-${compiler}"],
}

## dos2unix upstart: convert clrf (windows to linux) in case host machine
# is windows.
#
# @notify, ensure the webserver service is started. This is similar to an
# exec statement, where the 'refreshonly => true' would be implemented
# on the corresponding listening end point. But, the 'service' end
# point does not require the 'refreshonly' attribute.
exec { "dos2unix-upstart-${compiler}":
command => "dos2unix /etc/init/${compiler}.conf",
refreshonly => true,
notify => Exec["dos2unix-bash-${compiler}"],
path => '/usr/bin',
}

## dos2unix bash: convert clrf (windows to linux) in case host machine is
# windows.
#
# @notify, ensure the webserver service is started. This is similar to an
# exec statement, where the 'refreshonly => true' would be implemented
# on the corresponding listening end point. But, the 'service' end
# point does not require the 'refreshonly' attribute.
exec { "dos2unix-bash-${compiler}":
command => "dos2unix /vagrant/puppet/environment/${environment}/scripts/${compiler}",
refreshonly => true,
path => '/usr/bin',
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Note: the prefix 'database::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class database::bindings {
class {'::mysql::bindings':
python_enable => true,
}
}

0 comments on commit 6f49c38

Please sign in to comment.