Aurora /docs/sysop/development
development

AURORA development considerations and solutions

This document shows considerations as relates to developing the AURORA-system and how this can be done in the best possible manner.

In order to execute the development of AURORA in the best possible manner, we have created a set of docker-definitions that will make it possible to test the entire system while coding on you own machine.

There are several ways to be coding the AURORA-system and this goes to what preferences that the individual coder may have. In any event, we recommend that you have the AURORA git repo synchronized to a folder on your computer and that this folder is then bound/shared into the docker containers (the docker solution includes a configuration-script that setup all of this).

The advantage of this scheme is that you can change the code in whatever branch that you wish and this branch is then directly exposed into the docker containers.

Please note that this solution is meant to accomodate a setup on a Linux host, not on Windows. While it might work in Windows, we have not made any attempts to accomodate this or tested it.

How to install the AURORA docker containers

In the AURORA repo under the folder “devdockers” it is included a tar.gz-file that includes the whole package needed to setup a complete AURORA-system on your own computer.

In order to install these dockers, you do the following:

  1. Install necesary packages to use Docker on your system. For Ubuntu 22.04 this means the package “docker.io”. Install on Ubuntu by running: “sudo apt install docker.io”.

  2. Have the AURORA git code/repo sync available in some folder on your computer.

  3. Create a folder somewhere on your computer (eg. /home/USER/aurora).

  4. Copy the aurora_dockers.tar.gz to the new folder.

  5. Unpack the aurora_dockers.tar.gz file by writing:

     tar -xvf aurora_dockers.tar.gz
  6. Run the config-script in the unpacked files:

     ./config
  7. Answer all the questions asked, but be careful to get the working folder/AURORA docker root location (the one you created for the tar-set above)`and the AURORA git code locations correctly. These locations are written into the configuration of the dockers, so it needs to be correct. Also say yes to all patching and creation of FileInterface structure as well as other folder areas needed. Also ensure that the docker network and volume is created as needed. Several of the tasks being executed needs sudo permissions. The docker volume is used by the database for its files.

  8. Start the aurora-db container by going into the aurora-db-folder and cat the ref.txt file:

     cd aurora-db
     cat ref.txt
  9. Write the command for running the container as referenced in the ref.txt-file (starts with “sudo docker run”).

  10. Inside the aurora-db container, do the following:

     mysql
     create database auroradev;
     create user 'auroradev'@'10.0.10.%' identified with mysql_native_password by 'Auroradev1234';
     grant all privileges on auroradev.* to 'auroradev'@'10.0.10.%';
     flush privileges;
     quit
     cd /root
     mysql -f auroradev < CreateDB.sql
     mysql -f auroradev < initdata.sql
     mysql -f auroradev < initdata_docker.sql

We use the “-f” option when importing the database data since we are not using one data dump that includes drop statements for each table, view and trigger followed by the recreation of them before adding the data. This may cause some issues with data that is both present in the database data and similar data being written by triggers. The force-option alleviates this issue, while not ideal.

  1. Start the aurora-server container by using its ref.txt-file.
  2. Start the aurora-web container by using its ref.txt-file.
  3. Start whatever else of containers you need in the AURORA-system.

If you have problems with missing permissions after installing, you can attempt to give the Admins-group (id 46) the permissions you need by using the setperm-utility in the utility folder of the aurora-server container:

cd /local/app/aurora/dist/utility
./setperm.pl +46 1 grant MY_FIRST_PERMISSION,MY_SECOND_PERMISSION

The above setperm-utility adds a permission (+) on the Admins-group (46) and assigns that permission on the root node (1). After that one adds the textual names of the permissions one wants to give, separated by commas.

The admin@localhost user that one uses to log into the svelte web-client is a member of the Admins-group. The password for the user is: “Aurora2019”. All permissions for the admin-user are given to the already mentioned Admins-group (46) and assigned on the root node (1) of the entity tree. That means that all the given permissions, typically all for an admin, will be inherited down the entity tree and giving members of the Admins-group complete access.

All the containers will run with the prompt available, so that one can go into them and check, change or debug them. All of the images includes a set of useful debug-tools, such as strace, tcpdump, telnet etc.

The following containers exist in the development set:

Please note that the ref.txt-files within each of the container folders have two docker commands. The first is to build the docker image (which has already been done by the config-script) and the second is to run the docker container.

The AURORA web-client should upon starting the aurora-web docker image be available through https://10.0.10.12 on your host machine or alternately in addition https://auroradev if you added that to your hosts-file. Please do not mess around with this name, because it is also used for configurations, web certificates and such.

When you attempt to run the Web-client by accessing the web-server on 10.0.10.12, please note that you will have to add exceptions to the certificates being offered. They are self-signed and part of the docker distribution. There are two stages to this. The first is to accept the certificate for the aurora-server site itself (10.0.10.12/auroradev) and the second is to accept the certificate of the REST-server (10.0.10.11). For this to happen, it might be an advantage in several browsers to either add this exception manually in the site certificate store or to attempt to contact both the web- and rest-servers by writing https://auroradev and https://10.0.10.11:9393 respectively in the address box of the browser and then accept an exception. Without these security exceptions added, you will not be able to serve the web-client and/or the rest-server. The AURORA web-client relies on the AURORA REST-server to do all its tasks.

When you change the code, remember that services needs to be restarted or alternately exit one of the dockers and start the docker again. This is especially something to consider when changing the code for the aurora-server container.


For further questions, contact hjelp.ntnu.no