Introduction
This something i wrote back in 2017 but, it seems, i never hity the publish button.
Motivation
devimpy
The intention is to develop a functional test environment for the devimpy project.peoplevalue
An alternative way for providing the services I write to the folks within People Value.The code I write, I hope, will be more easily available to less technical members of staff, being made available through the BackOffice system we have already and so provide them with a consistent way of accessing the functions they require.
Specifically from a web interface integrated into the backoffice.
Many of the processes I provide can be long running but will be run infrequently.
Previous attempts to allow users to activate process through a web interface have had issues where it would be possible for a process to be started and started again which potentially caused the two versions of these processes to interfere with each other.
Development Environment
My development environment will use virtual machines to emulate the various systems that will be used.I'm using Debian Jessie as the base systems for all the machines with VirtualBox and all machines have vim-nox build-essential, dkms installed.
Guest Additions is ready to be installed but gets run on GUI systems after the desktop has been installed.
all the machines get Guest Additions installed eventually.
Development will be with python3 (at the time of writing, the current Debian stable has v 3.4 installed by default but development may be done with another version, maybe) using the Pyramid framework.
'docker-manager' Server
Install
Taken from the official Docker site:$ sudo apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb https://apt.dockerproject.org/repo/ debian-$(lsb_release -cs) main"
$ sudo apt-get update
$ sudo apt-get -y install docker-engine
$ sudo service docker start
Created and added myself to the docker group so that I can run the docker command as myself, without having to sudo every time.
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
$ docker run hello-world
The last commands installs a test container to check that all is well.
I configured this server with an external NIC (eth1) in addition to the NAT NIC (eth0)
I cloned this server twice, renaming to docker1 and docker2
Swarm
On manager
docker swarm init --advertise-addr 192.168.10.16 (the IP supplied by my DHCP server for the MAC on the manager vm)
I used the the docker swarm join command, as supplied when the docker swarm init was called to add the two 'worker' vms to the swarm.
'dockerDevelopment-vm' Machine
Took cloned the base vm and changed the hostname by
updating /etc/hostname
and
/etc/hosts
then rebooted
Installed task-desktop which installs the task-gnome-desktop by default
Wing IDE pro I have a licensed version for work, so why not?
git-all
Virtual Environments
There are two common ways/places to install virtualenvs. All in one place, oftern in the home dir in a directory such as .venv or .virtualenv or just venv etc the otheris to have the environment placed into each project.
So far I've commonly used the former however, as recomended by The Hitch Hitchers Guide to Python I'll use the per-project way.
First we need pip3 to handle the installation the python3 versions of the virtual environments, rather than Debian's packages for them
so
sudo apt-get install python3-pip
sudo pip3 install virtualenvwrapper
This should install virtualenv as a dependency I expect
mkdir ~/.virtualenvs
added
if [ -d "$HOME/.virtualenvs" ];then
export PIP_REQUIRE_VIRTUALENV=true
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/repos/mastaba
source /usr/local/bin/virtualenvwrapper.sh
fi
so
sudo apt-get install python3-pip
sudo pip3 install virtualenvwrapper
This should install virtualenv as a dependency I expect
mkdir ~/.virtualenvs
added
if [ -d "$HOME/.virtualenvs" ];then
export PIP_REQUIRE_VIRTUALENV=true
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/repos/mastaba
source /usr/local/bin/virtualenvwrapper.sh
fi
to the bottom of ~/.profile