Commit 9bd6e1a2 by source_reader

updating jupyter setup, added wireguard, common ML python tools, and sudoer…

updating jupyter setup, added wireguard, common ML python tools, and sudoer rights for joule to control jouled
parent 9a73c107
......@@ -4,3 +4,4 @@ mod 'puppetlabs-translate', '1.2.0'
mod 'puppetlabs-concat', '5.2.0'
mod 'puppetlabs-stdlib', '5.1.0'
mod 'puppetlabs-vcsrepo', '3.0.0'
mod 'saz-sudo', '6.0.0'
......@@ -6,13 +6,15 @@ if [[ $# == 0 ]]; then
IMAGE_TYPE='default'
elif [[ $1 = "--nilm" ]]; then
echo "BUILDING NILM IMAGE"
apt remove --purge libreoffice-* -y
IMAGE_TYPE='nilm'
else
echo "Error, unknown type $1"
exit 1
fi
# install the puppet forge modules
mkdir -p forge_modules
r10k puppetfile install --moduledir=./forge_modules
......
......@@ -12,7 +12,9 @@ EOF
#fi
#echo "nameserver 172.31.33.1" > /etc/resolv.conf
sudo add-apt-repository ppa:wireguard/wireguard -y
apt-get update
apt remove --purge libreoffice-* -y > /dev/null
apt-get upgrade -y
wget https://apt.puppetlabs.com/puppet-release-bionic.deb
dpkg -i puppet-release-bionic.deb
......
......@@ -3,10 +3,11 @@
# Packages required by multiple modules
#
class common {
# note: chromium for Ubuntu is a snap and cannot be installed in a container
$pkgs=['build-essential','screen','emacs','openvpn',
'nmap','wget', 'sqlite3', 'gparted', 'net-tools',
'openssh-server','chromium-browser','zlib1g-dev',
'imagemagick']
'openssh-server','zlib1g-dev','chromium-browser',
'imagemagick', 'python3-sklearn', 'python3-pandas']
package { $pkgs:
ensure => present
......
joule ALL=(ALL) NOPASSWD:/usr/sbin/service joule status
joule ALL=(ALL) NOPASSWD:/usr/sbin/service joule restart
joule ALL=(ALL) NOPASSWD:/usr/bin/systemctl status joule
joule ALL=(ALL) NOPASSWD:/usr/bin/systemctl restart joule
joule ALL=(ALL) NOPASSWD:/usr/bin/journalctl -u joule *
......@@ -83,4 +83,10 @@ class joule::config {
address => '::1/128',
auth_method => 'md5',
}
#allow joule user to control the joule service (start|restart|status)
sudo::conf {'joule':
ensure => present,
source => 'puppet:///modules/joule/sudoers'
}
}
......@@ -14,6 +14,6 @@ class joule::install{
ensure => present,
uid => 901,
groups => 'dialout',
system => true
managehome => true
}
}
......@@ -4,13 +4,13 @@ After = syslog.target
[Service]
Type = simple
Environment=JUPYTER_CONFIG_DIR=/etc/jupyter
ExecStart = jupyter notebook --config /etc/jupyter/config.py
Environment=JUPYTER_CONFIG_DIR=/home/joule/.jupyter
ExecStart = jupyter notebook --config /home/joule/.jupyter/config.py
StandardOutput = journal
StandardError = journal
Restart = always
RestartSec = 5
User = jupyter
User = joule
[Install]
WantedBy = multi-user.target
......@@ -7,7 +7,7 @@ import subprocess
from notebook.auth import passwd
@click.command()
@click.option("-c","--config",default="/etc/jupyter/config.py")
@click.option("-c","--config",default="/home/joule/.jupyter/config.py")
@click.password_option()
def main(config, password):
if not os.path.isfile(config):
......
class jupyter::config{
file{'/etc/jupyter':
file{'/home/joule/.jupyter':
ensure => directory,
recurse => true,
source => 'puppet:///modules/jupyter/etc',
source => 'puppet:///modules/jupyter/configs',
owner => root,
group => root,
}
......@@ -19,8 +19,5 @@ class jupyter::config{
group => root,
mode => '0755'
}
exec { 'remove jupyter Desktop':
command => '/usr/bin/rm -rf /home/jupyter/Desktop',
}
}
......@@ -6,10 +6,4 @@ class jupyter::install{
provider => pip3
}
user{'jupyter':
ensure => present,
managehome => true,
uid => 902,
}
}
......@@ -13,11 +13,19 @@ set -e
echo "SET LOCALE"
raspi-config
apt-get update
apt-get upgrade -y
echo "deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi" >> /etc/apt/sources.list
apt get update
apt get upgrade -y
apt install puppet git r10k -y
# install wireguard
apt install raspberrypi-kernel-headers
git clone https://git.zx2c4.com/WireGuard
cd WireGuard/src
make install
cd -
# install postgres and timescale
apt install postgresql libpq-dev postgresql-server-dev-11 libssl-dev clang-format cmake -y
git clone https://github.com/timescale/timescaledb.git
......@@ -28,7 +36,10 @@ echo "installing timescale version 1.4.0"
cd build && make
make install
# install packages for scipy
apt install gfortran libatlas-base-dev python3-pybind11
apt build-dep python3-scipy
# upgraade pip
# upgrade pip
pip3 install --upgrade pip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment