Skip to content

Development

Adrian Wilke edited this page Dec 5, 2020 · 18 revisions

Ensure access to Elasticsearch

The web-service component requires a running Elasticsearch like configured in the demo component.
On your machine, you can test it calling http://localhost:9200/

Set the environment variables

You have to set the following variables to configure Elasticsearch access:

ES_INDEX=opal
OPAL_ELASTICSEARCH_URL=localhost
OPAL_ELASTICSEARCH_PORT=9200

Other values may be:

ES_INDEX=opal_2020
OPAL_ELASTICSEARCH_URL=opal_es.cs.uni-paderborn.de
OPAL_ELASTICSEARCH_PORT=9200

OPAL developers can use our OPAL-data machine. It is available via UPB VPN.
In Eclipse, you can set the environment variables in your run-configuration.

Set the SPARQL endpoints for dataset history feature

If the SPARQL endpoint changed, edit the file opal-webservices.properties.

Set the log file

If you don't have access to /var/log/ you have 2 options:

  • Create /var/log/opal/webservices.log
    sudo mkdir /var/log/opal/
    sudo touch /var/log/opal/webservices.log
    sudo chmod 777 /var/log/opal/webservices.log (or change the owner of the file)
    or
  • Edit the 2 occurences of /var/log/opal/webservices.log in src/main/resources/logback-spring.xml

Start the project using Maven

In Eclipse:

  • Right click on project name -> Run As -> Maven Build...
    In the goals, enter spring-boot:run then click Run button.
    Now a Eclipse run configuration is created, but the configuration itself is missing.
  • Set the 3 configuration variables described above:
    Eclipse menu -> Run -> Run Configurations ... -> Select project -> Environment
  • Right click on project name -> Run As -> Maven Build...
    In the goals, enter spring-boot:run then click Run button.

From the command line:

export ES_INDEX=opal
export OPAL_ELASTICSEARCH_URL=localhost
export OPAL_ELASTICSEARCH_PORT=9200
mvn spring-boot:run

Finally, you will get a response here: http://localhost:8081/opalinfo

Testing

  • Integration tests can be found in the test directory
Clone this wiki locally