This chapter describes the steps for a manual installation (eg. not using the vagrant script and puppet scripts). This chapter is for developers who would like to have more control over the installation procedure.
With the increased control come increased risks of things not working with the versions or configuration of the software involved with the OSGP environment. If you run into issues, you may find clues in the puppet scripts about versions and modifications to the configuration of installed software.
Skip this chapter if you followed the Vagrant installation! You can continue with next chapter: Setup the Open Smart grid Platform
The Open Smart Grid Platform runs on a Linux environment. It is recommended to set up a machine running Ubuntu.
The Open Smart Grid platform needs the following software and tools installed/downloaded:
Java 8 openjdk-8
PostgreSQL and pgAdmin 3
Git
Maven
ActiveMQ
Tomcat
Apache HTTPD
SoapUi
Eclipse IDE for Java EE Developers
Google Protocol Buffers: protobuf-compiler, libprotoc7 and libprotobuf7
It is recommended to create a 'dev' user, because some scripts contain hard coded references to this 'dev' user. It is possible to skip this step, but then some of the scripts will have to be adjusted manually.
Place the PostgreSQL JDBC driver jar in the Tomcat lib directory.
Change permissions of Tomcat Config files to 644 in the Tomcat conf directory.
Enable mod_ssl by running the following command:
Enable proxy_ajp by running the following command:
Make sure the JAVA_HOME var is set, and points to openjdk-8.
Clone the following repo's, it is recommended to create a Sources/OSGP
directory in /home/dev/
since some scripts contain hard coded references to those folders.
Make sure you are on the development branch (default).
Create the following directories:
/var/log/osp/logs
/etc/osp/
Make the dev user (or equivalent) the owner of the log directory with rwx permission. Give the other users read and execute permission.
Execute the script /home/dev/Sources/OSGP/Config/scripts/create-symlinks.sh
Note This script uses hard coded references to /home/dev/Sources/OSGP/*
, if you used a different user, please edit the script before executing it.
The script will make symlinks to certificates, to Apache HTTP server configuration and copy configuration settings as samples to locations where these properties may be overridden.
To create the database run the following command (Change /home/dev/ in case of no dev user)
And create a backup of the pg_hba.conf file (modify if your version of PostgreSQL is different)
Finally, reload the postgresql service:
Continue with setting up the Open Smart Grid Platform by following the Set up the Open Smart Grid Platform Guide
To install the platform you can use one of the following procedures.
The Vagrant Installation. This procedure creates and installs a complete image with the Open Smart Grid Platform pre-installed, including all the tools such as Maven, Eclipse, SoapUI, etc.
The Manual Installation. Follow this guide if you want to install the Open Smart Grid Platform yourself.
This document describes the automatic installation procedure for your Open Smart Grid Platform development environment.
If you would like to follow the manual installation procedure, please proceed to the Manual Installation Chapter.
Creating a Virtual Machine using Virtual Box and Vagrant
To improve the usability of the Installation process, a Vagrant file and some puppet scripts are used to automatically set-up an virtual Open Smart Grid Platform development environment. The following steps will describe how to install VirtualBox, Vagrant and kick off the procedure by running the vagrant up
command.
The following system requirements are recommended:
Core i5/i7 ~2.5GHz Dual Core, Quad Core recommended
At least 16 GB RAM, 32 GB RAM recommended
At least 20 GB free space, 50 GB free space recommended
The installation procedure has been tested on Windows 10.
Start by downloading VirtualBox by going to https://www.virtualbox.org/wiki/Downloads And follow the installation steps.
note: If you already have VirtualBox, make sure it is at least version 6.1.38
note: Check whether Virtualbox stores the images on a drive with enough free space. (Open Oracle VM VirtualBox Manager -> Preferences -> General -> Default Machine Folder).
Now download and install Vagrant. Vagrant is available at the following URL: https://www.vagrantup.com/downloads.html
note: If you already have Vagrant, make sure it is at least version 2.3.0 Complete the installation and restart your PC.
note: If you did a fresh install of Vagrant and already had a command prompt open, make sure you close this command prompt and open it again.
Remember to enable Virtualization in your system BIOS.
Also disable Hyper-V in Windows (can be found in Windows Features)
First create a new directory (for example: D:\My Vagrant Images\OSGP Development\
)
Browse to https://github.com/OSGP/Config/tree/development/vagrant and save the png image and Vagrantfile files in your newly created directory.
Make sure that the file is named like this: Vagrantfile
without an extension!
If the file has an extension (for example .txt) you can rename the file using the following console command.
MacOS/Linux:
Windows:
Now open a Command Prompt and navigate to the newly created directory where you just put the files. Make sure that you run the Command Prompt using administrator rights.
note: When you open the Vagrantfile you see that default the image is configured to run in virtualbox with 2 cpu cores and 8192 MB of RAM. If you need to you can change this to more or less cpu cores and RAM, but it is recommended to use the provided settings.
Run the following command: vagrant up
note: In case of error bad uri Images/OSGP Development/hashicorp/itc/itc-ubuntu-mate-20.04-amd64 then use the following command;
vagrant destroy
vagrant box add itc/itc-ubuntu-mate-20.04-amd64
vagrant up
note: In case of an error complaining about not being able to resolve a URL (for instance to github.com) then try using a different internet connection not behind a proxy.
Vagrant will now automatically download an Ubuntu image (+- 2.6 Gb), create a virtualbox image from it and run the installation puppet script when finished. This might take a while, depending on your internet speed. After some time (while the script is still running) you will notice that a window with an Ubuntu Virtual Machine pops-up. Don't log in yet, wait until the script in the Console is finished.
If the script fails for some reason (eg. Errors in the console such as time outs during downloading), you can retry the procedure by running the following command vagrant destroy && vagrant up
Now that the script has ran its course, it will automatically log in on the Ubuntu virtual machine as user dev.
note: For some actions, like
sudo
, you will have to enter the password of user dev. The password for user dev is dev.
At this point you also can adjust the virtualbox settings like cpus and memory size. If you don't want to adjust this proceed to Chapter 2.1.2. Platform Setup.
If you do want to update the virtualbox settings for this image, shut down the image first:
Once the machine has been Shut Down, open VirtualBox and right click on the new virtual machine (called "OSGP Development") and select Settings. Go to System and increase the Base Memory of the system to at least 6144 MB (6 GB) (or the maximum recommended (in green) amount for your system).
Now go to the Processor Tab and increase the amount of Processors to the maximum recommended (in green) amount.
Close the Settings window and Start the Virtual Machine again. Once it is booted, you should be automatically logged in as the 'dev' user.
In order to use git correctly you need to execute the following commands in a terminal:
You just created a virtual machine running Ubuntu with pre-installed tooling. Proceed with Platform Setup of the guide describing how to set-up the open smart grid platform.