Skip to content

Commit 8f19604

Browse files
committed
Update the README
1 parent 620f772 commit 8f19604

File tree

1 file changed

+111
-124
lines changed

1 file changed

+111
-124
lines changed

README.md

Lines changed: 111 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,200 +1,187 @@
1-
### Channel Finder
1+
# Channel Finder
22

3-
#### A simple directory service
3+
ChannelFinder is a directory server, implemented as a REST style web service.
4+
Its intended use is for control systems, namely the EPICS Control system.
45

5-
ChannelFinder is a directory server, implemented as a REST style web service.
6-
Its intended use is within control systems, namely the EPICS Control system, for which it has been written.
6+
- [Documentation](https://channelfinder.readthedocs.io/en/latest/)
7+
- [Releases](https://github.com/ChannelFinder/ChannelFinderService/releases)
8+
- [Docker Containers](https://github.com/ChannelFinder/ChannelFinderService/pkgs/container/channelfinderservice)
79

8-
* Motivation and Objectives
10+
## Description
911

10-
High level applications tend to prefer an hierarchical view of the control system name space. They group channel names by location or physical function. The name space of the EPICS Channel Access protocol, on the other hand, is flat. A good and thoroughly enforced naming convention may solve the problem of creating unique predictable names. It does not free every application from being configured explicitly, so that it knows all channel names it might be interested in beforehand.
12+
* **Motivation and Objectives**
1113

12-
ChannelFinder tries to overcome this limitation by implementing a generic directory service, which applications can query for a list of channels that match certain conditions, such as physical functionality or location. It also provides mechanisms to create channel name aliases, allowing for different perspectives of the same set of channel names.
14+
High level applications tend to prefer a hierarchical view of the control system name space. They group channel names
15+
by location or physical function. The name space of the EPICS Channel Access protocol, on the other hand, is flat. A
16+
good and thoroughly enforced naming convention may solve the problem of creating unique predictable names. It does not
17+
free every application from being configured explicitly, so that it knows all channel names it might be interested in
18+
beforehand.
1319

14-
* Directory Data Structure
20+
ChannelFinder tries to overcome this limitation by implementing a generic directory service, which applications can
21+
query for a list of channels that match certain conditions, such as physical functionality or location. It also
22+
provides mechanisms to create channel name aliases, allowing for different perspectives of the same set of channel
23+
names.
1524

16-
Each directory entry consists of a channel `<name>`, an arbitrary set of `<properties>` (name-value pairs), and an arbitrary set of `<tags>` (names).
25+
* **Directory Data Structure**
1726

18-
* Basic Operation
27+
Each directory entry consists of a channel `<name>`, an arbitrary set of `<properties>` (name-value pairs), and an
28+
arbitrary set of `<tags>` (names).
1929

20-
An application sends an HTTP query to the service, specifying an expression that references tags, properties and their values, or channel names. The service returns a list of matching channels with their properties and tags, as JSON documents.
30+
* **Basic Operation**
2131

32+
An application sends an HTTP query to the service, specifying an expression that references tags, properties and their
33+
values, or channel names. The service returns a list of matching channels with their properties and tags, as JSON
34+
documents.
2235

23-
#### API reference guide
36+
## Installation
2437

25-
https://channelfinder.readthedocs.io/en/latest/
38+
ChannelFinder is a Java EE5 REST-style web service. The directory data is held in a ElasticSearch index.
2639

27-
#### Installation
40+
### Docker Compose
2841

29-
ChannelFinder is a Java EE5 REST-style web service. The directory data is held in a ElasticSearch index.
42+
For using docker containers there is a barebones [docker compose file](./docker-compose.yml).
3043

31-
Collected installation recipes and notes may be found on [wiki pages](https://github.com/ChannelFinder/ChannelFinder-SpringBoot/wiki).
44+
### Manual Installation
3245

3346
* Prerequisites
3447

35-
* JDK 17
36-
* Elastic version 8.2.x
37-
* <For authN/authZ using LDAP:> LDAP server, e.g. OpenLDAP
38-
39-
* setup elastic search
40-
**Install**
41-
Download and install elasticsearch (verision 8.2.0) from [elastic.com](https://www.elastic.co/downloads/past-releases/elasticsearch-8-2-0)
42-
following the instructions for your platform.\
43-
<Alternatively:> Install the elastic server from your distribution using a package manager.
44-
45-
* Build
46-
```
47-
# Debian 10
48-
sudo apt-get install openjdk-17-jdk git curl wget
49-
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.2.0-amd64.deb
50-
sudo dpkg -i elasticsearch-8.2.0-amd64.deb
51-
sudo systemctl start elasticsearch
48+
* JDK 17
49+
* Elastic version 8.11.x
50+
* **For authN/authZ using LDAP:** LDAP server, e.g. OpenLDAP
5251

53-
#### Checkout and build ChannelFinder service source
54-
git clone https://github.com/ChannelFinder/ChannelFinderService.git
55-
cd ChannelFinderService
56-
.\mvnw clean install
52+
#### Setup Elasticsearch
5753

58-
```
54+
Options:
5955

60-
#### Start the service
56+
- Download and install elasticsearch (version 8.11.0)
57+
from [elastic.com](https://www.elastic.co) following the instructions for
58+
your platform.
59+
- Install the elastic server from your distribution using a package manager.
60+
- Run Elasticsearch in a [docker container](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html)
6161

62-
* Using spring boot via Maven
62+
#### Running
6363

64-
```
65-
.\mvnw spring-boot:run
66-
```
64+
```bash
65+
sudo apt-get install openjdk-17-jre git curl wget
66+
sudo systemctl start elasticsearch # Or other command to run elastic search
6767

68-
* or using the jar
68+
# Replace verison with the release you want
69+
wget https://github.com/ChannelFinder/ChannelFinderService/releases/download/ChannelFinder-{version}/ChannelFinder-{version}.jar
70+
java -jar target/ChannelFinder-*.jar
71+
```
6972

70-
```
71-
java -jar target/ChannelFinder-4.7.0.jar
73+
Other installation recipes can be found
74+
on [the wiki pages](https://github.com/ChannelFinder/ChannelFinder-SpringBoot/wiki).
75+
76+
### Configuration
77+
78+
By default, the channelfinder service will start on port 8080 with the default settings. To start with a
79+
different `application.properties` file:
80+
81+
```bash
82+
java -Dspring.config.location=file:./application.properties -jar ChannelFinder-*.jar
7283
```
7384

74-
The above command will start the channelfinder service on port 8080 with the default settings,
75-
which use embedded ldap server with users and roles defined in the [`cf.ldif`](src/main/resources/cf.ldif) file.
85+
The default authentication includes an embedded ldap server with users and roles defined in
86+
the [`cf.ldif`](src/main/resources/cf.ldif) file.
7687
Note that `cf.ldif` contains **default credentials** and should only be used during testing and evaluation.
7788

78-
#### Verification
89+
### Verification
7990

80-
To check that the server is running correctly.
91+
To check that the server is running correctly, visit [the default homepage](http://localhost:8080/).
8192

82-
```
83-
$ curl --fail-with-body http://localhost:8080/ChannelFinder
84-
{
85-
"name" : "ChannelFinder Service",
86-
"version" : "4.7.0",
87-
"elastic" : {
88-
"status" : "Connected",
89-
"clusterName" : "elasticsearch",
90-
"clusterUuid" : "sA2L_cpoRD-H46c_Mya3mA",
91-
"version" : "8.2.0"
92-
}
93-
}
94-
95-
96-
# Verify by creating a simple Channel using the demo auth
97-
$ curl --location -u admin:adminPass --request PUT 'http://localhost:7070/ChannelFinder/resources/channels/test_channel' \
98-
--header 'Content-Type: application/json' \
99-
--data '{
100-
"name": "test_channel",
101-
"owner": "admin"
102-
}'
103-
104-
$ curl --fail-with-body http://localhost:8080/ChannelFinder/resources/channels
105-
106-
...
107-
$ curl --basic -u admin:adminPass --fail-with-body -H 'Content-Type: application/json' \
108-
-X PUT -d '{"name":"foo", "owner":"admin"}' \
109-
http://localhost:8080/ChannelFinder/resources/tags/foo
110-
111-
$ curl --fail-with-body http://localhost:8080/ChannelFinder/resources/tags
112-
113-
...
114-
$ curl --fail-with-body http://localhost:8080/ChannelFinder/resources/tags
115-
[{"name":"foo","owner":"admin","channels":[]}]
116-
117-
$ curl --basic -u admin:1234 --fail-with-body -X DELETE \
118-
http://localhost:8080/ChannelFinder/resources/tags/foo
119-
```
93+
## Development
12094

121-
#### Start up options
95+
It's strongly encouraged to use a modern IDE such as [Intelij](https://www.jetbrains.com/idea/) and [Eclipse](https://eclipseide.org/).
12296

123-
You can start the channelfinder service with your own applications.properties file as follows:
97+
* Prerequisites
12498

125-
```
126-
.\mvnw spring-boot:run -Dspring.config.location=file:./application.properties
127-
```
128-
or
129-
```
130-
java -Dspring.config.location=file:./application.properties -jar ChannelFinder-4.7.0.jar
131-
```
99+
* JDK 17
100+
* Maven (via package manager or via the wrapper `./mvnw`) (version specified in [the wrapper properties](./.mvn/wrapper/maven-wrapper.properties))
132101

133-
You can also start up channelfinder with demo data using the command line argument `demo-data` followed by an integer number `n`. For example, `--demo-data=n`. With this argument, `n*1500` channels will be created to simulate some of the most common types of devices found in accelerators like magnets, power supplies, etc...
102+
For the following commands `mvn` can be interchangeably used instead via `./mvnw`
134103

104+
To build:
105+
106+
```bash
107+
mvn clean install
135108
```
136-
java -jar target/ChannelFinder-4.7.*.jar --demo-data=1
137-
java -jar target/ChannelFinder-4.7.*.jar --cleanup=1
138-
```
139-
109+
110+
To test:
111+
112+
```bash
113+
mvn test
140114
```
141-
.\mvnw spring-boot:run -Dspring-boot.run.arguments="--demo-data=1"
142-
.\mvnw spring-boot:run -Dspring-boot.run.arguments="--cleanup=1"
115+
116+
To run the server in development (you need a running version of Elasticsearch)
117+
118+
```bash
119+
mvn spring-boot:run
143120
```
144121

145-
#### Integration tests with Docker containers
122+
### Integration tests with Docker containers
146123

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

149126
See `src/test/java` and package
127+
150128
* `org.phoebus.channelfinder.docker`
151129

152-
Integration tests start docker containers for ChannelFinder and Elasticsearch and run http requests (GET) and curl commands (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.
130+
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
131+
replies are received and checked if content is as expected.
153132

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

156135
Integration tests can be run in IDE and via Maven.
157136

158137
```
159-
.\mvnw failsafe:integration-test -DskipITs=false
138+
mvn failsafe:integration-test -DskipITs=false
160139
```
161140

162-
See
141+
See also
142+
163143
* [How to run Integration test with Docker](src/test/resources/INTEGRATIONTEST_DOCKER_RUN.md)
164144
* [Tutorial for Integration test with Docker](src/test/resources/INTEGRATIONTEST_DOCKER_TUTORIAL.md)
165145

166-
#### ChannelFinder data managment
167-
168-
The [cf-manager](https://github.com/ChannelFinder/cf-manager) project provides tools to perform operations on large queries ( potentially the entire directory ).
169-
Some examples of these operations include running checks to validate the pv names or producing reports about the number of active PVs, a list of IOC names, etc..
170-
171146
### Release ChannelFinder Server binaries to maven central
172147

173-
The Phoebus ChannelFinder service uses the maven release plugin to prepare the publish the ChannelFinder server binaries to maven central
148+
The Phoebus ChannelFinder service uses the maven release plugin to prepare the publish the ChannelFinder server binaries
149+
to maven central
174150
using the sonatype repositories.
175151

176-
**Setup**
152+
#### Setup
177153

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

180-
```
156+
```xml
181157
<servers>
182158
<server>
183159
<id>phoebus-releases</id>
184-
<username>shroffk</username>
160+
<username>username</username>
185161
<password>*******</password>
186162
</server>
187163
</servers>
188164
```
189165

190-
**Prepare the release**
191-
`.\mvnw release:prepare`
166+
#### Prepare the release
167+
168+
```bash
169+
mvn release:prepare
170+
```
192171
In this step will ensure there are no uncommitted changes, ensure the versions number are correct, tag the scm, etc..
193-
A full list of checks is documented [here](https://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html):
172+
A full list of checks is
173+
documented [here](https://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html):
174+
175+
#### Perform the release
176+
177+
178+
```bash
179+
mvn release:perform
180+
```
194181

195-
**Perform the release**
196-
`.\mvnw release:perform`
197182
Checkout the release tag, build, sign and push the build binaries to sonatype.
198183

199-
**Publish**
200-
Open the staging repository in [sonatype](https://s01.oss.sonatype.org/#stagingRepositories) and hit the *publish* button
184+
#### Publish
185+
186+
Open the staging repository in [sonatype](https://s01.oss.sonatype.org/#stagingRepositories) and hit the *publish*
187+
button

0 commit comments

Comments
 (0)