-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
787 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
puppet/environment/development/manifests/configure_redis.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
puppet/environment/development/manifests/configure_webserver.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
39
puppet/environment/development/manifests/install_packages.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
21
puppet/environment/development/manifests/install_sklearn.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
19
puppet/environment/development/manifests/setup_database.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
17
puppet/environment/development/manifests/vagrant_mounted.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
34 changes: 34 additions & 0 deletions
34
puppet/environment/development/modules/compiler/manifests/initial_compile.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
puppet/environment/development/modules/compiler/manifests/start_browserify.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
puppet/environment/development/modules/compiler/manifests/start_imagemin.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
puppet/environment/development/modules/compiler/manifests/start_sass.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
puppet/environment/development/modules/compiler/manifests/start_uglifyjs.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
puppet/environment/development/modules/compiler/manifests/webcompilers.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
puppet/environment/development/modules/database/manifests/bindings.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} | ||
} |
Oops, something went wrong.