- When creating VM, enable login using Azure Active Directory
- Restrict SSH port to only the jumpbox-ip
- Open ports 80 (http), 443 (https) and 3099 (webhook)
- Set the DNS Name Label on the IP Address attached to the VM
- Create web-hook to
listen on
http://ip-address:3099/
- Set secret for web-hook access (for this step)
-
User Management
- Create user group -
sudo groupadd ibf-users
- Add
ibf-user
to group -sudo usermod -a -G ibf-users ibf-user
- Add users to group -
sudo usermod -a -G ibf-users grahman@rodekruis.nl
- Command to verify group members -
grep ibf-users /etc/group
- Command to verify group members -
- Change access of shared directory -
/home/ibf-user
chgrp -Rf ibf-users /home/ibf-user
sudo chown -R ibf-user:ibf-users /home/ibf-user
sudo chmod -R 775 /home/ibf-user
- Re-login to verify if you have access by running
touch /home/ibf-user
- Add the following lines to
/etc/sudoers
# Allow members of group ibf-users to execute systemctl daemon-reload %ibf-users ALL=NOPASSWD: /bin/systemctl daemon-reload # Allow members of group ibf-users to execute service webhook restart %ibf-users ALL=NOPASSWD: /usr/sbin/service webhook restart
- Create user group -
-
Install Software
- NodeJS
Source
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
- Verification -
node -v
- Docker Source
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
- Allow users to access docker commands
sudo usermod -aG docker grahman@rodekruis.nl
- Verification -
grep docker /etc/group
- Verification -
docker -v
- Docker Compose
Source
sudo curl -L "[https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$](https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$)(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- Verification -
docker-compose -v
- Webhook Related
sudo apt install postgresql-client-common postgresql-client
- NodeJS
Source
-
Setup IBF-system
- Setup GIT
- Setup Environment Variables
- Create
services/IBF-pipeline/pipeline/secrets.py
cp /home/ibf-user/IBF-system/services/IBF-pipeline/pipeline/secrets.py.template /home/ibf-user/IBF-system/services/IBF-pipeline/pipeline/secrets.py
- Set the appropriate values in the
/home/ibf-user/IBF-system/services/IBF-pipeline/pipeline/secrets.py
file
- Create
/home/ibf-user/IBF-system/.env
cp /home/ibf-user/IBF-system/example.env /home/ibf-user/IBF-system/.env
- Set the appropriate values in the
.env
file - Load the
.env
vars bysource /home/ibf-user/IBF-system/.env
- Test if the vars were loaded correctly
echo $NODE_ENV
- Create
- Setup web-hook
sudo cp webhook.service /etc/systemd/system/
- Set
GITHUB_WEBHOOK_SECRET
value in/etc/systemd/system/webhook.service
- Verification -
ls /etc/systemd/system/
- In
/home/ibf-user/IBF-system
-npm install github-webhook-handler
sudo service webhook start
- Verification -
sudo service webhook status
. tools/deploy.sh
-
Load base data for pipeline
- Download these 2 data files
- Unzip the files using
apt install unzip
andunzip data.zip
,geodata.zip
intoservices/IBF-pipeline/geoserver/geodata/
data.zip
intoservices/IBF-pipeline/pipeline/data/
- You can verify that the pipeline runs correctly by going into the
container (
docker-compose exec ibf-pipeline bash
) and runningpython3 runPipeline.py
- The pipeline will run automatically every day through a cron job, which requires no additional set-up.
-
Verify if the geoserver is set up correctly.
- Check if the Geoserver contains necessary layers.
- Delete user from group?
sudo gpasswd -d grahman@rodekruis.nl ibf-users
- Secret Generator