ChannelFinder / ChannelFinderService

A RESTful directory services for a list channels
MIT License
9 stars 15 forks source link

Channel Finder

ChannelFinder is a directory server, implemented as a REST style web service. Its intended use is for control systems, namely the EPICS Control system.

Description

Installation

ChannelFinder is a Java EE5 REST-style web service. The directory data is held in a ElasticSearch index.

Docker Compose

For using docker containers there is a barebones docker compose file.

Manual Installation

Setup Elasticsearch

Options:

Running

sudo apt-get install openjdk-17-jre git curl wget
sudo systemctl start elasticsearch # Or other command to run elastic search

# Replace verison with the release you want
wget https://github.com/ChannelFinder/ChannelFinderService/releases/download/ChannelFinder-{version}/ChannelFinder-{version}.jar 
java -jar target/ChannelFinder-*.jar

Other installation recipes can be found on the wiki pages.

Configuration

By default, the channelfinder service will start on port 8080 with the default settings. To start with a different application.properties file:

java -Dspring.config.location=file:./application.properties -jar ChannelFinder-*.jar

The default authentication includes an embedded ldap server with users and roles defined in the cf.ldif file. Note that cf.ldif contains default credentials and should only be used during testing and evaluation.

Verification

To check that the server is running correctly, visit the default homepage. For more information on the api see the swagger docs endpoint.

Development

It's strongly encouraged to use a modern IDE such as Intelij and Eclipse.

For the following commands mvn can be interchangeably used instead via ./mvnw

To build:

mvn clean install

To test:

mvn test

To run the server in development (you need a running version of Elasticsearch)

mvn spring-boot:run

Integration tests with Docker containers

Purpose is to have integration tests for ChannelFinder API with Docker.

See src/test/java and package

Integration tests start docker containers for ChannelFinder and Elasticsearch and run http requests (GET, POST, PUT, DELETE) towards the application to test behavior (read, list, query, create, update, remove) and replies are received and checked if content is as expected.

There are tests for properties, tags and channels separately and in combination.

Integration tests can be run in IDE and via Maven.

mvn failsafe:integration-test -DskipITs=false

See also

Release ChannelFinder Server binaries to maven central

The Phoebus ChannelFinder service uses the maven release plugin to prepare the publish the ChannelFinder server binaries to maven central using the sonatype repositories.

Setup

Create a sonatype account and update the maven settings.xml file with your sonatype credentials

<servers>
    <server>
        <id>phoebus-releases</id>
        <username>username</username>
        <password>*******</password>
    </server>
</servers>

Prepare the release

mvn release:prepare

In this step will ensure there are no uncommitted changes, ensure the versions number are correct, tag the scm, etc.. A full list of checks is documented here:

Perform the release

mvn release:perform

Checkout the release tag, build, sign and push the build binaries to sonatype.

Publish

Open the staging repository in sonatype and hit the publish button