This section explains how to setup and configure The Development Infrastructure consists of two parts.
- The Docker-based development Infrastructure to be installed on your computer.
- The database containing HMI images and preprocessed data, which is hosted on the FLARECAST cluster in France.
This document explains the first part, i.e how to install the FLARECAST development infrastructure on your personal computer.
Getting ready
Install software
Follow this procedure if you intend to develop your own algorithms.
Access to the Infrastructure in France is documented in Setup access to FLARECAST cluster.
In case you run into problems or think we should improve things please send a message to marco.soldati@fhnw.ch or leave a comment below. Many thanks.
Table of Contents | ||||
---|---|---|---|---|
|
System Requirements
- 64-bit host system (OSX or Linux, Windows is currently not tested/supported)
- min. 3.5 GB free disk space (the more the better, depends on how much HMI data you want to download)
- min 4.0 GB RAM (the more the better)
Recommended versions
(Tested, running on cluster)
Tool/Library | Recommended version |
---|---|
Docker | 17.09 |
Docker Compose | |
docker-py | |
IDL | 8.3 |
Install software
Note: Windows has not been tested yet
Software | OS X | Linux | |||||||
---|---|---|---|---|---|---|---|---|---|
Python | Install https://www.python.org/downloads/release/python-2711/ | Should be preinstalled. Test with
Otherwise check here. | |||||||
PIP (Python installer) | PIP is shipped with Python 2.7.9+ and Python 3.4+.
If you don't have it follow https://pip.pypa.io/en/stable/installing/ | ||||||||
Python IDE | We suggest PyCharm, but any text editor or Spyder will work as well. | ||||||||
IDL | You can use your normal IDL setup to access data and prototype your algorithms. Note: We do not support execution of IDL code on our cluster due to licensing issues. Let us know if this is a problem. Please avoid SolarSoft/SSW-specific functionality in your algorithms. They tend to be hard to be ported to a cluster. | ||||||||
Git (source code repository) |
|
| |||||||
Docker and docker-compose | Install Docker community edition. https://docs.docker.com/engine/installation/
|
| Install https://www.docker.com/docker-toolbox |
Access to Infrastructure
Info |
---|
This step is required to get access either to the HMI files stored in France or the properties extracted by our algorithms. If you want to do all processing on your local machine, you can skip this step. |
In order to access the FLARECAST development infrastructure in France you need a dedicated account.
To get an account send a message to Eric Buchlin <eric.buchlin@ias.u-psud.fr>.
With this account you can connect to the computing infrastructure. The following figure outlines how this connection is being established.
...
|
...
|
Setup Docker
Make sure you have decent internet connection.
Info | ||
---|---|---|
| ||
|
Info | ||
---|---|---|
| ||
Usually, the Docker daemon is started automatically. If not, follow this guide: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-getting-started |
Create a base directory for the FLARECAST development infrastructure (e.g. mkdir ~/flarecast/dev-infra
). We assume the following commands are executed in this directory.
Code Block | ||||
---|---|---|---|---|
| ||||
local> ssh username@ias-ssh.ias.u-psud.fr
inf-ssh2> ssh-keygen -t rsa -C "your-mail-address" # -C is just a comment
# use default settings and no password
inf-ssh2> scp ~/.ssh/id_rsa.pub username@cluster-head:~/.ssh/authorized_keys
inf-ssh2> ssh username@cluster-head # to test the connection
cluster-head> exit
inf-ssh2> exit
local> |
Code Block | ||||
---|---|---|---|---|
| ||||
# create file .ssh/config to auto-forward yourself to cluster-head
local> nano .ssh/config
# content of .ssh/config
Host flarecast-infra
ProxyCommand ssh username@ias-ssh.ias.u-psud.fr nc cluster-head.ias.u-psud.fr 22
User username
ForwardX11Trusted yes
ServerAliveInterval 60
# Ctrl-x y <return> to save and close
local> ssh flarecast-infra
# accept fingerprint
# enter FLARECAST cluster password
# you can ignore message: /usr/bin/xauth: file ~/.Xauthority does not exist
cluster-head> exit
local>
|
From now on you can login to the cluster as follows
Code Block | ||||
---|---|---|---|---|
| ||||
local> ssh flarecast-infra
# enter FLARECAST cluster password
cluster-head> exit
local> |
Test installation
Create a base directory for the FLARECAST development infrastructure. We will call this $FC_DEVINFRA in the remainder of this document.
Code Block | ||||
---|---|---|---|---|
| ||||
local> cd $FC_DEVINFRA
local> curl |
If you get message SSL certificate problem: Invalid certificate chain
- Create directory <your_flarecast_homedir>
- Download the docker-compose-yml file.
- Go to a directory where you downloaded the file.
Run
docker pull flarecast/smart-python
Run
docker pull flarecast/regiongraph
Run
docker-compose up
.In case you see any errors about database connection timeouts, just press Ctrl + C and run
docker-compose up
again.
Note: Windows has not been tested yet
* OS X or Linux (we have not tested Windows installations yet)
* Python 2.7
* Text Editor or your preferred Python Interactive Development Environment (IDE).
* Account to connect to the FLARECAST infrastructure at OBSPM.
| |
# download the helper script
local> curl -o infrastructure.sh https://dev.flarecast.eu/stash/projects/INFRA/repos/dev-infra/browse/infrastructure.sh?raw
local> chmod a+x infrastructure.sh
# setup infrastructure or update to most recent version
local> ./infrastructure.sh update
# run development infrastructure
local> ./infrastructure.sh run
# when you want to stop the development infrastructure, press <CTRL> + C
# cleanup everythin, this may be necessary in case of errors or old and incompatible containers
# this will also remove all the data you sent to the hmi/property services
local> ./infrastructure.sh clean
# in case you need already generated data, add a flag "keep_db"
local> ./infrastructure.sh clean keep_db |
All FLARECAST docker containers can be found at DockerHub
Troubleshooting:
curl: SSL certificate problem: Invalid certificate chain (OS X only)
- Open Safari (not Firefox, Opera, Chrome or similar)
- visit https://dev.flarecast.eu
- A certificate warning should pop up. -> Click "Show Certificate"
- Click on "Trust" and set to "Always trust"
- Retry curl
curl: SSL certificate problem: unable to get local issuer certificate
- Run curl with the --insecure option
docker: cannot resolve hostname
- Add your DNS server (xx.xx.xx.xxx) to '\etc\default\docker', e.g.
DOCKER_OPTS="--dns xx.xx.xx.xxx --dns 8.8.8.8 --dns 8.8.4.4"
where 8.8.8.8 and 8.8.4.4 are the Google DNS servers - Restart the docker service
sudo restart docker
Test Docker
Info | ||
---|---|---|
| ||
After starting infrastructure.sh switch to "Kitematic" Select Container "devinfrastest_webapp_1" On the right side panel click on the arrow icon next to "Web Preview" |
Info | ||
---|---|---|
| ||
Open http://127.0.0.1/ in a browser |