diff --git a/src/baker.js b/src/baker.js index 82d95676..2b097ca7 100755 --- a/src/baker.js +++ b/src/baker.js @@ -4,7 +4,7 @@ const camelCase = require('camelcase'); const requireDir = require('require-dir'); const fs = Promise.promisifyAll(require('fs-extra')); const mustache = require('mustache'); -const child_process = require('child_process'); +const child_process = Promise.promisifyAll(require('child_process')); const vagrant = Promise.promisifyAll(require('node-vagrant')); const scp2 = require('scp2'); const ssh2 = require('ssh2'); @@ -17,6 +17,7 @@ const slash = require('slash'); const git = require('simple-git'); const ora = require('ora'); const hasbin = require('hasbin'); +const drivelist = Promise.promisifyAll(require('drivelist')); require('console.table'); const boxes = path.join(require('os').homedir(), '.baker'); @@ -54,7 +55,8 @@ let dep = { ansible, configPath, bakerletsPath, - remotesPath + remotesPath, + drivelist }; // Internal dependencies diff --git a/src/config/BaseVM.mustache b/src/config/BaseVM.mustache index f5e454df..5bb501d9 100644 --- a/src/config/BaseVM.mustache +++ b/src/config/BaseVM.mustache @@ -15,6 +15,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "{{{vagrant.box}}}" + config.ssh.insert_key = false + config.ssh.private_key_path = ["~/.baker/ansible-srv/keys/baker_rsa", "~/.vagrant.d/insecure_private_key"] + # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs # `vagrant box outdated`. This is not recommended. @@ -88,9 +91,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "shell", inline: "test -e /usr/bin/python || (sudo apt -y update && sudo apt install -y python-minimal)" - # - # View the documentation for the provider you are using for more - # information on available options. - + config.vm.provision "file", source: "~/.baker/ansible-srv/keys/baker_rsa.pub", destination: "~/.ssh/authorized_keys" end diff --git a/src/config/baker_rsa b/src/config/baker_rsa new file mode 100644 index 00000000..7860aa73 --- /dev/null +++ b/src/config/baker_rsa @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +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 +-----END RSA PRIVATE KEY----- diff --git a/src/config/baker_rsa.pub b/src/config/baker_rsa.pub new file mode 100644 index 00000000..e0e2ee99 --- /dev/null +++ b/src/config/baker_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCo+YRhI2Gjno+5ND+N/pBvvw7Bvji6OEtZgUKvJf8P9rPcUCR8w7DpDPTpLSM4spBqIwoEM1CQRnH8x/Ufvhr51tU/74A4J2MgBEjClI8M5Z8iqYhDWfoRywo/2uB1rrPHICIM716LRFGIDoqnt+leHU4wcfHmHNa8/KqC5tNxd9/VBxeveh0CIu7/Ba3/UVtn6CTY2sGMo0mJk0IjzIsK42TgRL7ZOTQfbo1Td3DpOCdt02xft5xXCk9KuRwwrjdtyZbP8n8xc7/YcRk0pswFViNfEaU5Eb42+DTr0OhCgadGD9ufxJbSh4ty2VmRycQBfj00VqQO2zPNL2u76EfkMEI/TspVansMCheRtt3C5QJQCv0gXntDSunzgIOvbgShc644eIrmV/kh0oLYkW+Fi80zqx/dIdKMc7OpXK/umJb18ao2IBtBoTiNr5cla1XerDwZXJEp6sPJlSja9xNb0yw0PAfxMiKsR/fjymZ5E7dPaYjS3b+LIyxjxL+GSr8ZRL+3aH7lYsdAaQwekesxaMZUSfKDwRWk5UvE81gpCWWkgcTcqxCGuiBCdviBU88yXfDuFodidgYTJ39JM9v3gKuvlJAtRaBbXSJ6YTjanfozlmpaNYImHUPeooY20vlolmXzs2llZI+gM68GZpnml3en80LJYnin26kigWM9WQ== samim@Samims-MacBook-Pro.local diff --git a/src/installers/linux/deb-template/baker/DEBIAN/control b/src/installers/linux/deb-template/baker/DEBIAN/control index 700f82af..848e6b6c 100644 --- a/src/installers/linux/deb-template/baker/DEBIAN/control +++ b/src/installers/linux/deb-template/baker/DEBIAN/control @@ -1,5 +1,5 @@ Package: Baker -Version: 0.2.0 +Version: 0.3.0 Section: base Priority: optional Architecture: amd64 diff --git a/src/installers/macos/package.sh b/src/installers/macos/package.sh index 1c590a5b..ab5740e8 100755 --- a/src/installers/macos/package.sh +++ b/src/installers/macos/package.sh @@ -14,7 +14,7 @@ PACKAGEREL="installers/macos" IDENTIFIER="io.ottomatica.$NAME" # Package version number. -VERSION="0.0.1" +VERSION="0.3.0" # The location to copy the contents of files. INSTALL_LOCATION="/opt/baker/bin" diff --git a/src/installers/win/scripts/baker.iss b/src/installers/win/scripts/baker.iss index 4c3fdf22..e9687501 100644 --- a/src/installers/win/scripts/baker.iss +++ b/src/installers/win/scripts/baker.iss @@ -7,8 +7,8 @@ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{FF82CC8F-9CAD-4210-97AA-2C5F955DB742} AppName=Baker -AppVersion=0.0.1 -;AppVerName=Baker 0.0.1 +AppVersion=0.3.0 +;AppVerName=Baker 0.3.0 AppPublisher=Ottomatica LLC AppPublisherURL=https://getbaker.io/ AppSupportURL=https://getbaker.io/ diff --git a/src/lib/bakerlets/env/env.js b/src/lib/bakerlets/env/env.js new file mode 100644 index 00000000..f15cdc77 --- /dev/null +++ b/src/lib/bakerlets/env/env.js @@ -0,0 +1,48 @@ +const { commands, modules } = require('../../../baker'); +const baker = modules['baker']; +const ssh = modules['ssh']; + +const Bakerlet = require('../bakerlet'); +const path = require('path'); +const mustache = require('mustache'); +const fs = require('fs-extra'); + +class Env extends Bakerlet { + constructor(name, ansibleSSHConfig, version) { + super(ansibleSSHConfig); + + this.name = name; + this.version = version; + } + + async load(obj, variables) { + this.variables = variables; + this.envVars = {env: []}; + + obj.env.forEach( e => { + this.envVars.env.push({KEY: Object.keys(e)[0], VALUE: Object.values(e)[0]}) + }) + + let playbookTemplate = path.resolve( + this.remotesPath, + `bakerlets-source/env/env.yml.mustache` + ); + let playbookRendered = mustache.render(await fs.readFileAsync(playbookTemplate, 'utf8'), this.envVars); + + let cmd = `echo "${playbookRendered.replace(/"/g, '\\"')}" > /home/vagrant/baker/${this.name}/env.yml`; + await this.exec(cmd); + } + + async install() { + var cmd = `env.yml`; + await baker.runAnsiblePlaybook( + { name: this.name }, + cmd, + this.ansibleSSHConfig, + this.verbose, + this.variables + ); + } +} + +module.exports = Env; diff --git a/src/lib/bakerlets/lang/nodejs.js b/src/lib/bakerlets/lang/nodejs.js index 79a14cb6..1581e095 100644 --- a/src/lib/bakerlets/lang/nodejs.js +++ b/src/lib/bakerlets/lang/nodejs.js @@ -3,6 +3,7 @@ const baker = modules['baker']; const Bakerlet = require('../bakerlet'); const path = require('path'); +const fs = require('fs'); class Nodejs extends Bakerlet { @@ -29,7 +30,20 @@ class Nodejs extends Bakerlet { await baker.runAnsiblePlaybook( {name: this.name}, cmd, this.ansibleSSHConfig, this.verbose, this.variables ); - //console.log(`installed java ${this.version}`); + + var localPackageJsonPath = path.resolve(this.bakePath, "package.json"); + if( fs.existsSync(localPackageJsonPath) ) + { + // There could be some funkyness depending on if there is a package-lock.json, etc: + // and node_modules is manually deleted: + // https://github.com/ansible/ansible/pull/29131 + var vmPackagePath = `/${path.basename(this.bakePath)}`; + if( this.verbose ) console.log(`Attempting to run npm install in vm at ${vmPackagePath}`); + await baker.runAnsibleNpmInstall( + {name: this.name}, vmPackagePath, this.ansibleSSHConfig, this.verbose + ); + } + } diff --git a/src/lib/bakerlets/lang/python.js b/src/lib/bakerlets/lang/python.js index b38fb64d..f0f76fda 100644 --- a/src/lib/bakerlets/lang/python.js +++ b/src/lib/bakerlets/lang/python.js @@ -3,6 +3,7 @@ const baker = modules['baker']; const Bakerlet = require('../bakerlet'); const path = require('path'); +const fs = require('fs'); class Python extends Bakerlet { @@ -10,8 +11,8 @@ class Python extends Bakerlet { super(ansibleSSHConfig); this.name = name; - this.version = version; - + // Default to python2 + this.version = version || 2; } async load(obj, variables) @@ -27,6 +28,18 @@ class Python extends Bakerlet { await baker.runAnsiblePlaybook( {name: this.name}, cmd, this.ansibleSSHConfig, this.verbose, this.variables ); + + // Check for a requirements.txt and then run pip install -r requirements.txt + // TODO: Possible to allow a requirements: parameter in the python object. + // Otherwise, we might just want it in the packages: pip: requirements: path + var localRequirementsPath = path.resolve(this.bakePath, "requirements.txt"); + if( fs.existsSync(localRequirementsPath) ) + { + var vmRequirementsPath = `/${path.basename(this.bakePath)}/requirements.txt`; + await baker.runAnsiblePipInstall( + {name: this.name}, vmRequirementsPath, this.ansibleSSHConfig, this.verbose + ); + } } diff --git a/src/lib/bakerlets/resolve.js b/src/lib/bakerlets/resolve.js index 142bf584..dc6ea38d 100644 --- a/src/lib/bakerlets/resolve.js +++ b/src/lib/bakerlets/resolve.js @@ -69,6 +69,12 @@ module.exports.resolveBakerlet = async function(bakerletsPath,remotesPath,doc,ba } } + if( doc.env ) + { + doc.env = [{env: doc.env}]; // fixing the format // TODO: it works ok, but probably too hacky + await resolve(doc.name, bakerScriptPath, remotesPath, path.join(bakerletsPath,"env"), doc.env[0], extra_vars, verbose); + } + if( doc.start ) { let dir = path.join(boxes, doc.name); @@ -115,16 +121,25 @@ async function resolve(vmName, bakerScriptPath, remotesPath, dir, bakerlet, extr } else { - let regex = /([a-zA-Z-]+)([0-9]*\.?[0-9]*)/; + // This will correctly match neo4j3.3, java8, python etc. + let regex = /([a-zA-Z-0-9]*)([0-9]+\.?[0-9]*$)|([a-zA-Z-0-9]*)/; mod = dir + "/" + bakerlet; let match = bakerlet.match(regex); - version = null; - if( match.length == 3) + if( match.length == 4) { - mod = dir + "/" + match[1]; - version = match[2]; + if( match[1] === undefined && match[2] === undefined ) + { + // We did not capture anything in the first part of regex. So, we have no version, just the mod. + // This is captured in third group. + mod = dir + "/" + match[3]; + } + else + { + mod = dir + "/" + match[1]; + version = match[2]; + } } - if( verbose ) console.log("Found", mod, version); + if( verbose ) console.log("Found", mod, version, extra_vars); } let classFoo = require(mod) diff --git a/src/lib/bakerlets/services/neo4j.js b/src/lib/bakerlets/services/neo4j.js new file mode 100644 index 00000000..7613bb3d --- /dev/null +++ b/src/lib/bakerlets/services/neo4j.js @@ -0,0 +1,36 @@ +const { commands, modules } = require('../../../baker'); +const baker = modules['baker']; +const ssh = modules['ssh']; + + +const Bakerlet = require('../bakerlet'); +const path = require('path'); + +class Neo4j extends Bakerlet { + + constructor(name,ansibleSSHConfig, version) { + super(ansibleSSHConfig); + + this.name = name; + this.version = version; + + } + + async load(obj, variables) + { + this.variables = variables; + + let playbook = path.resolve(this.remotesPath, `bakerlets-source/services/neo4j/neo4j${this.version}.yml`); + await this.copy(playbook,`/home/vagrant/baker/${this.name}/neo4j${this.version}.yml`); + } + + async install() + { + var cmd = `neo4j${this.version}.yml`; + await baker.runAnsiblePlaybook( + {name: this.name}, cmd, this.ansibleSSHConfig, this.verbose, this.variables + ); + } +} + +module.exports = Neo4j; \ No newline at end of file diff --git a/src/lib/commands/bake.js b/src/lib/commands/bake.js index 365c62e0..ea4d723b 100644 --- a/src/lib/commands/bake.js +++ b/src/lib/commands/bake.js @@ -18,48 +18,64 @@ module.exports = function(dep) { describe: `give a git repository URL which has a baker.yml in it's root directory`, demand: false, type: 'string' + }, + box: { + alias: 'b', + describe: `give local path to where your baker.yml file is located`, + demand: false, + type: 'string' + }, + verbose: { + alias: 'v', + describe: `Provide extra output from baking process`, + demand: false, + type: 'boolean' } }; cmd.handler = async function(argv) { - const { local, repo } = argv; + const { local, repo, box, verbose } = argv; const { path, baker, cloneRepo, validator, print, spinner, spinnerDot } = dep; - try{ - let ansibleVM; - let bakePath; + try{ + let ansibleVM; + let bakePath; - if (local) { - bakePath = path.resolve(local); - } else if (repo) { - bakePath = path.resolve(await cloneRepo.cloneRepo(repo)); - } else { - print.error( - `User --local to give local path or --repo to give git repository with baker.yml` - ); - process.exit(1); - } + if( box ){ + bakePath = path.resolve(box); + } + else if (local) { + bakePath = path.resolve(local); + } else if (repo) { + bakePath = path.resolve(await cloneRepo.cloneRepo(repo)); + } else { + print.error( + `User --local to give local path or --repo to give git repository with baker.yml` + ); + process.exit(1); + } - let validation = await spinner.spinPromise(validator.validateBakerScript(bakePath), 'Validating baker.yml', spinnerDot); + //let validation = await spinner.spinPromise(validator.validateBakerScript(bakePath), 'Validating baker.yml', spinnerDot); - try - { - ansibleVM = await spinner.spinPromise(baker.prepareAnsibleServer(bakePath), 'Preparing Baker control machine', spinnerDot); - } - catch(ex) - { - await spinner.spinPromise(baker.upVM('baker'), `Restarting Baker control machine: `, spinnerDot); - ansibleVM = await spinner.spinPromise(baker.prepareAnsibleServer(bakePath), 'Preparing Baker control machine', spinnerDot); - } + try + { + ansibleVM = await spinner.spinPromise(baker.prepareAnsibleServer(bakePath), 'Preparing Baker control machine', spinnerDot); + } + catch(ex) + { + await spinner.spinPromise(baker.upVM('baker'), `Restarting Baker control machine`, spinnerDot); + ansibleVM = await spinner.spinPromise(baker.prepareAnsibleServer(bakePath), 'Preparing Baker control machine', spinnerDot); + } - let sshConfig = await baker.getSSHConfig(ansibleVM); + let sshConfig = await baker.getSSHConfig(ansibleVM); - let baking = baker.bake(sshConfig, ansibleVM, bakePath); - await spinner.spinPromise(baking, 'Baking VM', spinnerDot); + if(box) + await baker.bakeBox(sshConfig, ansibleVM, bakePath, verbose); + else + await baker.bake2(sshConfig, ansibleVM, bakePath, verbose); - // print.info('Baking VM finished.'); - } catch (err) { - print.error(err); - } + } catch (err) { + print.error(err); + } }; return cmd; diff --git a/src/lib/commands/boxes.js b/src/lib/commands/boxes.js new file mode 100644 index 00000000..95fd4de6 --- /dev/null +++ b/src/lib/commands/boxes.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = function(dep) { + let cmd = {}; + cmd.builder = { }; + cmd.command = 'boxes'; + cmd.desc = `list existing Baker boxes`; + cmd.handler = async function(argv) { + const { baker, print, spinner, spinnerDot } = dep; + const { verbose } = argv; + + try { + await spinner.spinPromise(baker.bakerBoxes(), `Getting list of Baker boxes`, spinnerDot); + } catch (err) { + print.error(err); + } + }; + + return cmd; +}; + + diff --git a/src/lib/commands/bake2.js b/src/lib/commands/custom.js similarity index 79% rename from src/lib/commands/bake2.js rename to src/lib/commands/custom.js index aba3465f..2cb7575c 100644 --- a/src/lib/commands/bake2.js +++ b/src/lib/commands/custom.js @@ -3,7 +3,7 @@ module.exports = function(dep) { let cmd = {}; - cmd.command = 'bake2'; + cmd.command = 'custom'; cmd.desc = 'Bake your VM given local path or repository URL containing the baker.yml'; cmd.builder = { @@ -18,16 +18,10 @@ module.exports = function(dep) { describe: `give a git repository URL which has a baker.yml in it's root directory`, demand: false, type: 'string' - }, - verbose: { - alias: 'v', - describe: `Provide extra output from baking process`, - demand: false, - type: 'boolean' } }; cmd.handler = async function(argv) { - const { local, repo, verbose } = argv; + const { local, repo } = argv; const { path, baker, cloneRepo, validator, print, spinner, spinnerDot } = dep; try{ @@ -45,7 +39,7 @@ module.exports = function(dep) { process.exit(1); } - //let validation = await spinner.spinPromise(validator.validateBakerScript(bakePath), 'Validating baker.yml', spinnerDot); + let validation = await spinner.spinPromise(validator.validateBakerScript(bakePath), 'Validating baker.yml', spinnerDot); try { @@ -59,8 +53,10 @@ module.exports = function(dep) { let sshConfig = await baker.getSSHConfig(ansibleVM); - await baker.bake2(sshConfig, ansibleVM, bakePath, verbose); + let baking = baker.bake(sshConfig, ansibleVM, bakePath); + await spinner.spinPromise(baking, 'Baking VM', spinnerDot); + // print.info('Baking VM finished.'); } catch (err) { print.error(err); } diff --git a/src/lib/commands/import.js b/src/lib/commands/import.js new file mode 100644 index 00000000..f94dcdf5 --- /dev/null +++ b/src/lib/commands/import.js @@ -0,0 +1,35 @@ +'use strict'; + +module.exports = function(dep) { + let cmd = {}; + cmd.builder = { + name: { + alias: 'n', + describe: `Provide name for the imported box`, + demand: false, + type: 'string' + }, + verbose: { + alias: 'v', + describe: `Provide extra output from baking process`, + demand: false, + type: 'boolean' + } + }; + cmd.command = 'import '; + cmd.desc = `import packaged Baker environment`; + cmd.handler = async function(argv) { + const { baker, print, spinner, spinnerDot } = dep; + const { boxPath, name, verbose } = argv; + + try { + await spinner.spinPromise(baker.import(boxPath, verbose), `Importing box: ${boxPath}`, spinnerDot); + } catch (err) { + print.error(err); + } + }; + + return cmd; +}; + + diff --git a/src/lib/commands/package.js b/src/lib/commands/package.js new file mode 100644 index 00000000..c30de403 --- /dev/null +++ b/src/lib/commands/package.js @@ -0,0 +1,29 @@ +'use strict'; + +module.exports = function(dep) { + let cmd = {}; + cmd.builder = { + verbose: { + alias: 'v', + describe: `Provide extra output from baking process`, + demand: false, + type: 'boolean' + } + }; + cmd.command = 'package '; + cmd.desc = `package a Baker environment`; + cmd.handler = async function(argv) { + const { baker, print, spinner, spinnerDot } = dep; + const { VMName, verbose } = argv; + + try { + await spinner.spinPromise(baker.package(VMName, verbose), `Packaging box: ${VMName}`, spinnerDot); + } catch (err) { + print.error(err); + } + }; + + return cmd; +}; + + diff --git a/src/lib/commands/setup.js b/src/lib/commands/setup.js index 98ea6b8b..2f13b854 100644 --- a/src/lib/commands/setup.js +++ b/src/lib/commands/setup.js @@ -15,7 +15,7 @@ module.exports = function (dep) { } cmd.handler = async function (argv) { const { force } = argv - const { baker, print, spinner, spinnerDot, validator } = dep + const { baker, print, spinner, spinnerDot, validator, fs, path, configPath, ansible } = dep try { await spinner.spinPromise(validator.validateDependencies(), 'Checking dependencies', spinnerDot); @@ -29,6 +29,26 @@ module.exports = function (dep) { await spinner.spinPromise(baker.reinstallAnsibleServer(), 'Re-installing Baker control machine', spinnerDot); else await spinner.spinPromise(baker.installAnsibleServer(), 'Installing Baker control machine', spinnerDot); + + await spinner.spinPromise( + fs.copy( + path.resolve(configPath, './baker_rsa.pub'), + path.resolve(ansible, 'keys','baker_rsa.pub') + ), + 'Copying private ssh key', + spinnerDot + ); + + await spinner.spinPromise( + fs.copy( + path.resolve(configPath, './baker_rsa'), + path.resolve(ansible, 'keys','baker_rsa') + ) + , + 'Copying public ssh key', + spinnerDot + ); + } catch (err) { print.error(err); } diff --git a/src/lib/modules/baker.js b/src/lib/modules/baker.js index 84030d1d..cd38a15e 100644 --- a/src/lib/modules/baker.js +++ b/src/lib/modules/baker.js @@ -359,7 +359,7 @@ module.exports = function(dep) { } let extravars = JSON.stringify(flatVars); //let extravars = yaml.dump(variables); - + if( verbose ) console.log( extravars ); return ssh.sshExec(`export ANSIBLE_HOST_KEY_CHECKING=false && cd /home/vagrant/baker/${doc.name} && echo '${extravars}' > playbook.args.json && ansible-playbook -e @playbook.args.json -i baker_inventory ${cmd} --private-key id_rsa -u ${vmSSHConfigUser.user}; rm -f playbook.args.json`, sshConfig, verbose); } @@ -373,6 +373,28 @@ module.exports = function(dep) { return ssh.sshExec(`export ANSIBLE_HOST_KEY_CHECKING=false && cd /home/vagrant/baker/${doc.name} && ansible all -m apt -a "pkg=${cmd} update_cache=yes cache_valid_time=86400" -i baker_inventory --private-key id_rsa -u ${vmSSHConfigUser.user} --become`, sshConfig, verbose); } + result.runAnsiblePipInstall = async function(doc, requirements, sshConfig, verbose) { + const { path, vagrant, baker, ssh, boxes } = dep; + + let dir = path.join(boxes, doc.name); + let vm = vagrant.create({ cwd: dir }); + let vmSSHConfigUser = await baker.getSSHConfig(vm); + + return ssh.sshExec(`export ANSIBLE_HOST_KEY_CHECKING=false && cd /home/vagrant/baker/${doc.name} && ansible all -m pip -a "requirements=${requirements}" -i baker_inventory --private-key id_rsa -u ${vmSSHConfigUser.user} --become`, sshConfig, verbose); + } + + result.runAnsibleNpmInstall = async function(doc, packagejson, sshConfig, verbose) { + const { path, vagrant, baker, ssh, boxes } = dep; + + let dir = path.join(boxes, doc.name); + let vm = vagrant.create({ cwd: dir }); + let vmSSHConfigUser = await baker.getSSHConfig(vm); + + return ssh.sshExec(`export ANSIBLE_HOST_KEY_CHECKING=false && cd /home/vagrant/baker/${doc.name} && ansible all -m npm -a "path=${packagejson}" -i baker_inventory --private-key id_rsa -u ${vmSSHConfigUser.user}`, sshConfig, verbose); + } + + + result.mkTemplatesDir = async function(doc, sshConfig) { const { path, vagrant, baker, ssh, boxes } = dep; @@ -452,7 +474,7 @@ module.exports = function(dep) { } result.initVagrantFile = async function(vagrantFilePath, doc, template, scriptPath) { - const { mustache, fs, path, slash } = dep; + const { mustache, fs, path, slash, baker } = dep; if (doc.vm ) { doc.vagrant = doc.vm; @@ -462,7 +484,17 @@ module.exports = function(dep) { await traverse(vagrant); // Defaults - vagrant.box = vagrant.box || "ubuntu/xenial64" + // vagrant.box = vagrant.box || "ubuntu/xenial64" + // TODO: Cleanup this mess + if (vagrant.box && (await baker.boxes()).map(e=>e.name).includes(`${vagrant.box}.baker`)){ + vagrant.box = vagrant.box + '.baker'; + } + else if(vagrant.box && (await baker.boxes()).map(e=>e.name).includes(`${vagrant.box}`)){ + vagrant.box = vagrant.box; + } + else{ + vagrant.box = "ubuntu/xenial64"; + } vagrant.memory = vagrant.memory || "1024" // Adaptor pattern: Support baker2 and baker format @@ -484,7 +516,7 @@ module.exports = function(dep) { } } vagrant.network = network; - + let syncFolders = doc.vagrant.synced_folders || []; @@ -628,5 +660,94 @@ module.exports = function(dep) { } } + result.package = async function(VMName, verbose) { + var { path, boxes, child_process } = dep; + + let dir = path.join(boxes, VMName); + + await child_process.execAsync(`cd ${dir} && vagrant package --output ${path.join(process.cwd(), VMName + '.box')}`, {stdio: ['inherit', 'inherit', 'ignore']}); + } + + result.import = async function(box, name, verbose) { + var { path, boxes, child_process, vagrant } = dep; + + let boxName = name ? name : path.basename(box).split('.')[0]; + + await vagrant.boxAddAsync(path.join(process.cwd(), box), ['--name', boxName + '.baker']) + // await child_process.execAsync(`vagrant box add ${boxName}.baker ${path.join(process.cwd(), box)}`, {stdio: ['inherit', 'inherit', 'ignore']}); + } + + result.boxes = async function() { + const { vagrant, print } = dep; + try { + let boxes = await vagrant.boxListAsync([]); + delete boxes.version; + return boxes; + } catch (err) { + throw err + } + } + + result.bakerBoxes = async function(verbose=true) { + const { vagrant, print, baker } = dep; + + try { + let boxes = await baker.boxes(); + let bakerBoxes = boxes.filter(box => box.name.match(/.baker$/)); + // Hide .baker from the end before printing + bakerBoxes.forEach(box => { + box.name = box.name.split('.')[0]; + }) + + if(verbose){ + if(bakerBoxes == []) + print.info(`\nYou currently don't have any boxes.`) + else + console.table('\nBaker boxes: ', bakerBoxes); + } + return bakerBoxes; + } catch (err) { + throw err + } + } + + result.bakeBox = async function(ansibleSSHConfig, ansibleVM, scriptPath, verbose) { + const { vagrant, boxes, path, fs, spinner, spinnerDot, configPath, baker, yaml} = dep; + + try { + let doc = yaml.safeLoad(await fs.readFile(path.join(scriptPath, 'baker.yml'), 'utf8')); + + let dir = path.join(boxes, doc.name); + try { + await fs.ensureDir(dir); + } catch (err) { + throw `Creating directory failed: ${dir}`; + } + + + let template = await fs.readFile(path.join(configPath, './BaseVM.mustache'), 'utf8'); + + // if box is specified in baker.yml and this box exists, then use it => otherwise bake it + if(doc.vagrant.box && (await baker.bakerBoxes(false)).map(e=>e.name).includes(`${doc.vagrant.box}`)){ + + await baker.initVagrantFile(path.join(dir, 'Vagrantfile'), doc, template, scriptPath); + + let machine = vagrant.create({ cwd: dir }); + machine.on('up-progress', function(data) { + if( verbose ) print.info(data); + }); + await spinner.spinPromise(machine.upAsync(), `Starting VM`, spinnerDot); + } + else { + await baker.bakeBox(sshConfig, ansibleVM, bakePath, verbose); + } + + } catch (err) { + throw err; + } + + return; + } + return result; }; diff --git a/src/lib/modules/validator.js b/src/lib/modules/validator.js index 16a74c4e..1db172c5 100644 --- a/src/lib/modules/validator.js +++ b/src/lib/modules/validator.js @@ -4,39 +4,50 @@ module.exports = function(dep) { let result = {}; result.validateDependencies = async function(){ - const { hasbin, Promise, fs, path } = dep; + const { hasbin, Promise, fs, path, drivelist, print } = dep; let platform = process.platform; + let dependencyNotFound = 'Dependencies not found. Make sure you have installed VirtualBox and Vagrant.'; - return new Promise((resolve, reject)=>{ - hasbin('vagrant', (hasVagrant)=>{ - let hasVirtualBox = false; - if(platform === 'darwin' || platform === 'linux'){ - hasbin('virtualbox', (hasVB)=>{ - hasVirtualBox = hasVB; - }) - } - else if(platform === 'win32'){ - try { - fs.accessSync(path.resolve(`C:/Program Files/Oracle/VirtualBox`)); - hasVirtualBox = true; - } catch (err) { - try { - fs.accessSync(path.resolve(`C:/Program Files (x86)/Oracle/VirtualBox`)); - hasVirtualBox = true; - } - catch(err){ - } - } + if (platform == 'darwin' || platform === 'linux') { + hasbin.all( ['vagrant', 'virtualbox'], hasDependencies => { + if(hasDependencies) return true; + else{ + // throw dependencyNotFound; + print.warning(dependencyNotFound, 1) + return true; } - if(hasVirtualBox && hasVagrant) - resolve(true); - else{ - console.log('=> Dependencies not found. Make sure you have installed VirtualBox and Vagrant.\n'); - resolve(true); + }); + } + else { + hasbin('vagrant', async function (hasVagrant) { + if(hasVagrant){ + let drives = (await drivelist.listAsync()).map(d => d.mountpoints[0].path); + drives.forEach(drive => { + fs.access(path.resolve(path.join(drive, `/Program Files/Oracle/VirtualBox`)), err => { + if (err){ + fs.access(path.resolve(path.join(drive, `/Program Files (x86)/Oracle/VirtualBox`)), err => { + if(err) { + fs.access(path.resolve(path.join(process.env.PROGRAMFILES, `/Oracle/VirtualBox`)), err => { + if(err){ + // throw dependencyNotFound; + print.warning(dependencyNotFound, 1) + return true; + } + }); + } + }); + } + return true; + }); + }) + } else { + // throw dependencyNotFound; + print.warning(dependencyNotFound, 1) + return true; } - }) - }) + }); + } } result.validateBakerScript = async function(bakerScriptPath) { diff --git a/src/package.json b/src/package.json index bc481269..0036c459 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "baker", - "version": "0.2.2", + "version": "0.3.0", "description": "baker creates ansible powered virtual machines", "engines": { "node": ">=7.10.0" @@ -35,11 +35,12 @@ "camelcase": "^4.1.0", "chalk": "^1.1.3", "console.table": "^0.9.1", + "drivelist": "^6.0.4", "fs-extra": "^3.0.1", "hasbin": "^1.2.3", "js-yaml": "^3.10.0", "mustache": "^2.3.0", - "node-vagrant": "^1.1.0", + "node-vagrant": "^1.2.2", "ora": "^1.3.0", "prompt": "^1.0.0", "request": "^2.81.0", diff --git a/src/remotes/bakerlets-source/env/env.yml.mustache b/src/remotes/bakerlets-source/env/env.yml.mustache new file mode 100644 index 00000000..a9ce3894 --- /dev/null +++ b/src/remotes/bakerlets-source/env/env.yml.mustache @@ -0,0 +1,14 @@ +--- +- hosts: all + become: yes + + tasks: + {{#env}} + - name: Adding the path in the bashrc files + lineinfile: + dest: /home/{{=<% %>=}}{{ansible_user}}<%={{ }}=%>/.bashrc + line: 'export {{KEY}}={{VALUE}}' + insertafter: 'EOF' + state: present + + {{/env}} diff --git a/src/remotes/bakerlets-source/lang/python/python3.yml b/src/remotes/bakerlets-source/lang/python/python3.yml new file mode 100644 index 00000000..eae4bcdf --- /dev/null +++ b/src/remotes/bakerlets-source/lang/python/python3.yml @@ -0,0 +1,35 @@ +- hosts: all + become: yes + tasks: + + - name: Install basic utils and build envs. + apt: pkg={{ item }} state=present + with_items: + - git + - unzip + - vim + - build-essential + + - name: Install required system packages. + apt: pkg={{ item }} state=present + with_items: + - python3-dev + - python3-pip + - python3-setuptools + + - name: Set python3 as default python using alternatives + alternatives: + name: python + link: /usr/bin/python + path: /usr/bin/python3 + + - name: Set pip3 as default pip using alternatives + alternatives: + name: pip + link: /usr/bin/pip + path: /usr/bin/pip3 + + - name: Upgrade pip + pip: + name: pip + extra_args: --upgrade \ No newline at end of file diff --git a/src/remotes/bakerlets-source/services/mongodb/mongodb3.6.yml b/src/remotes/bakerlets-source/services/mongodb/mongodb3.6.yml index cc9016dc..d1186b48 100644 --- a/src/remotes/bakerlets-source/services/mongodb/mongodb3.6.yml +++ b/src/remotes/bakerlets-source/services/mongodb/mongodb3.6.yml @@ -1,22 +1,42 @@ --- -- hosts: localhost +- hosts: localhost tasks: - name: add an apt key of MongoDB become: yes apt_key: keyserver: keyserver.ubuntu.com - id: 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 + # url: https://www.mongodb.org/static/pgp/server-3.6.asc + id: 91FA4AD5 + state: present + + # - name: create list file for MongoDB + # command: echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list - name: create list file for MongoDB - command: echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list + become: yes + apt_repository: + repo: deb https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse + state: present - name: Install mongodb - apt: pkg=mongodb-org state=latest force=yes update_cache=true cache_valid_time=86400 + become: yes + apt: + pkg: "{{item}}" + state: latest + update_cache: yes with_items: - - mongodb-org - become: yes + - libssl1.0.0 + - mongodb-org-server - name: ensure mongodb is running and starts on boot service: name=mongod state=restarted enabled=true become: yes + + - name: Installing Python-Pip + apt: + pkg: python-pip + state: latest + + - name: Install the latest pymongo package + pip: name=pymongo state=latest use_mirrors=no diff --git a/src/remotes/bakerlets-source/services/neo4j/neo4j.yml b/src/remotes/bakerlets-source/services/neo4j/neo4j.yml new file mode 100644 index 00000000..76c2e213 --- /dev/null +++ b/src/remotes/bakerlets-source/services/neo4j/neo4j.yml @@ -0,0 +1,68 @@ +--- +- hosts: all + + vars: + - neo4j_initial_password: "{{neo4j_password}}" + + handlers: + + - name: Restart Neo4J + become: yes + service: name=neo4j state=restarted enabled=yes + + tasks: + + - name: Check for Neo4J + stat: + path: /usr/bin/neo4j + register: neo4j_check + + - name: Add Neo4J Key + become: yes + apt_key: + url: http://debian.neo4j.org/neotechnology.gpg.key + state: present + + - name: Add Neo4J Repo + become: yes + apt_repository: + repo: deb http://debian.neo4j.org/repo stable/ + state: present + filename: neo4j + + - name: Install Packages + become: yes + apt: name="{{ item.key }}={{ item.value }}" state=present update_cache=yes + with_dict: + neo4j: 3.3.0 + + - name: Ensure Neo4J Listens on All Devices + become: yes + lineinfile: + path: /etc/neo4j/neo4j.conf + regexp: "{{ item.key }}" + line: "{{ item.key }}={{ item.value }}" + with_dict: + dbms.connector.bolt.listen_address: 0.0.0.0:7687 + dbms.connector.http.listen_address: 0.0.0.0:7474 + dbms.connector.https.listen_address: 0.0.0.0:7473 + notify: + - Restart Neo4J + + - name: Set Initial Neo4J Password + become: yes + command: "neo4j-admin set-initial-password '{{ neo4j_initial_password }}'" + when: not neo4j_check.stat.exists + + - name: Properly Set Neo4J Directory Permissions # Executing sudo neo4j-admin overrides them + become: yes + file: + path: /var/lib/neo4j + owner: neo4j + group: adm + recurse: yes + state: directory + + - name: Start Neo4J + become: yes + service: name=neo4j state=started enabled=yes diff --git a/src/remotes/bakerlets-source/tools/jupyter/jupyter.yml b/src/remotes/bakerlets-source/tools/jupyter/jupyter.yml index e0a90c9a..afd90dcc 100644 --- a/src/remotes/bakerlets-source/tools/jupyter/jupyter.yml +++ b/src/remotes/bakerlets-source/tools/jupyter/jupyter.yml @@ -6,6 +6,10 @@ # apt: pkg={{ item }} state=present # with_items: + - name: check python version + command: python --version + register: python_version + - name: Install required system packages. apt: pkg={{ item }} state=present with_items: @@ -13,6 +17,21 @@ - python-scipy - python-matplotlib - python-pandas + when: python_version.stdout.startswith('Python 2') + + - name: Install Jupyter + pip: name=jupyter + when: python_version.stdout.startswith('Python 2') + + - name: Install required system packages. + apt: pkg={{ item }} state=present + with_items: + - python3-numpy + - python3-scipy + - python3-matplotlib + - python3-pandas + when: python_version.stdout.startswith('Python 3') - name: Install Jupyter pip: name=jupyter + when: python_version.stdout.startswith('Python 3') diff --git a/src/test/integration/bake-326-onboard.js b/src/test/integration/bake-326-onboard.js index 2552db88..3d86b0ee 100644 --- a/src/test/integration/bake-326-onboard.js +++ b/src/test/integration/bake-326-onboard.js @@ -15,7 +15,7 @@ describe('baker should create coffeemaker, run it, and destroy it', function() { const tstDir = path.join(os.tmpdir(), 'Onboarding'); fs.remove(tstDir); // echo value for prompt input for password. - var child = child_process.exec('echo 326 | baker bake2 --repo https://github.ncsu.edu/engr-csc326-staff/Onboarding', + var child = child_process.exec('echo 326 | baker bake --repo https://github.ncsu.edu/engr-csc326-staff/Onboarding', {cwd: os.tmpdir() }, function(error, stdout, stderr) { setTimeout( function() { diff --git a/src/test/integration/test-neo4j.js b/src/test/integration/test-neo4j.js new file mode 100644 index 00000000..9820e400 --- /dev/null +++ b/src/test/integration/test-neo4j.js @@ -0,0 +1,29 @@ +const child_process = require('child_process'); +const request = require('request'); +const chai = require('chai'); +const expect = chai.expect; +const os = require('os'); +const path = require('path'); +const fs = require('fs-extra'); + +describe('baker should create neo4j vm', function() { + this.timeout(2000000); + + // https://github.ncsu.edu/engr-csc326-staff/Onboarding + + it('should setup neo4j', function(done) { + const tstDir = path.join(os.tmpdir(), 'neo4j'); + fs.mkdirpSync(tstDir); + fs.copySync('test/resources/baker2/neo4j.yml', path.join(tstDir,'baker.yml')); + // echo value for prompt input for password. + var child = child_process.exec(`echo neo | baker bake -v --local ${tstDir}`, + {cwd: os.tmpdir() }, function(error, stdout, stderr) + { + console.log(stderr || stdout); + done(); + }); + child.stdout.pipe(process.stdout); + }); +}); + + diff --git a/src/test/integration/test-python-nb.js b/src/test/integration/test-python-nb.js index 10b1d269..b67b7d8f 100644 --- a/src/test/integration/test-python-nb.js +++ b/src/test/integration/test-python-nb.js @@ -16,7 +16,7 @@ describe('baker should create python notebook', function() { fs.mkdirpSync(tstDir); fs.copySync('test/resources/baker2/python-notebook.yml', path.join(tstDir,'baker.yml')); // echo value for prompt input for password. - var child = child_process.exec(`baker bake2 --local ${tstDir}`, + var child = child_process.exec(`baker bake --local ${tstDir}`, {cwd: os.tmpdir() }, function(error, stdout, stderr) { console.log(stderr || stdout); diff --git a/src/test/integration/test-r-tidy.js b/src/test/integration/test-r-tidy.js index 64592da2..a43c176a 100644 --- a/src/test/integration/test-r-tidy.js +++ b/src/test/integration/test-r-tidy.js @@ -16,7 +16,7 @@ describe('baker should create r tidy vm', function() { fs.mkdirpSync(tstDir); fs.copySync('test/resources/baker2/r-tidy.yml', path.join(tstDir,'baker.yml')); // echo value for prompt input for password. - var child = child_process.exec(`baker bake2 --local ${tstDir}`, + var child = child_process.exec(`baker bake --local ${tstDir}`, {cwd: os.tmpdir() }, function(error, stdout, stderr) { console.log(stderr || stdout); diff --git a/src/test/resources/baker2/itrust2.yml b/src/test/resources/baker2/itrust2.yml deleted file mode 100644 index 87117a52..00000000 --- a/src/test/resources/baker2/itrust2.yml +++ /dev/null @@ -1,13 +0,0 @@ -vars: - - root_db_password: 326 -tools: - - maven -services: - - mysql5.7 -lang: - - java8 -config: - #- copy: mysql to x. - - template: - src: env/templates/hibernate-template.cfg.xml - dest: /Onboarding/CoffeeMaker/src/main/resources/hibernate.cfg.xml diff --git a/src/test/resources/baker2/neo4j.yml b/src/test/resources/baker2/neo4j.yml new file mode 100644 index 00000000..0fccaa33 --- /dev/null +++ b/src/test/resources/baker2/neo4j.yml @@ -0,0 +1,13 @@ +--- +name: neo4j-test +vm: + ip: 192.168.88.4 + ports: 7687, 7474, 7473 +vars: + - neo4j_password: + prompt: Please type initial neo4j password +lang: + - nodejs9 +services: + - neo4j +