https://github.com/52north/javaps-docker-backend
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.0%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: 52North
- Language: Java
- Default Branch: master
- Size: 159 KB
Statistics
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 10
- Releases: 1
Metadata Files
README.md
JavaPS Docker Backend Setup Guide
This page aims to guide developers on how to create and add new custom processes to JavaPS using Docker images.
How can the javaPS Docker backend be extended with additional Docker-based processes?
To add a new processes to the javaPs Docker backend you need to create a JSON file that contains a process description and the docker image that contains your service. Then you need to add some configuration to enable the javaPS Docker backend.
javaPS Docker backend will parse the json file to get the image that you specified ,create a container form it and to create a dynamic description of your process.
docker-backend
JavaPs depends on a docker-backend that is responsible for adding new services using docker containers. It automates the process of adding new services to the javaPs by parsing a json file that contains a description of the added service.
javaps-rest
javaps-rest REST/JSON Binding for javaPS and responsible for the documentation of the Web service .it provides information dynamically through hypermedia concerning the existing services. and gets the required information from the json file which contains the service description
Service Description Example
json
{
"processDescription": {
"process": {
"id": "org.n52.docker.StringReplace",
"title": "StringReplace",
"description": "this process replaces he wps in a text to a javaPs",
"version": "1.0.0",
"keywords": [
"string"
],
"inputs": [
{
"id": "source",
"title":"Source input text",
"description": "Source input text to be replaced",
"minOccurs": 1,
"maxOccurs": 1,
"input": {
"formats": [
{
"mimeType": "text/plain",
"default": true
}
]
}
}],
"outputs": [
{
"id": "output",
"title": "text after processing",
"output": {
"formats": [
{
"mimeType": "text/plain",
"default": true
}
]
}
}
]
},
"jobControlOptions": [
"sync-execute"
],
"outputTransmission": [
"value"
]
},
"immediateDeployment": true,
"executionUnit": [
{
"unit": {
"type": "docker",
"image": "mohammedsaad/service:2.0"
}
}
],
"deploymentProfileName": "http://www.opengis.net/profiles/eoc/dockerizedApplication"
}
so all what is required after creating the json file are the following steps of configration
- creating a DockerConfiguration that implements DockerEnvironmentConfigurer as in the following example
@Value("${scihub.password}")will be included from the environment variables - then Initial Algorithm Configuration that implements TransactionalAlgorithmConfigurer as in the following example
```java package org.n52.javaps.eopad;
import org.n52.faroe.ConfigurationError; import org.n52.javaps.docker.DockerEnvironmentConfigurer; import org.n52.javaps.docker.Environment; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration;
import java.util.Objects;
@Configuration public class DockerConfiguration implements DockerEnvironmentConfigurer { private static final String SCIHUBPASSWORD = "SCIHUBPASSWORD"; private static final String SCIHUBUSERNAME = "SCIHUBUSERNAME";
private String username;
private String password;
@Value("${scihub.username}")
public void setUsername(String username) {
this.username = Objects.requireNonNull(username);
}
@Value("${scihub.password}")
public void setPassword(String password) {
this.password = Objects.requireNonNull(password);
}
@Override
public void configure(Environment environment) {
if (username == null || username.isEmpty() ||
password == null || password.isEmpty()) {
throw new ConfigurationError("missing SCIHUB credentials");
}
environment.put(SCIHUB_USERNAME, username);
environment.put(SCIHUB_PASSWORD, password);
}
} ```
you can add different processes using configuration.addAlgorithmFromResource(algorithmSource)
```java package org.n52.javaps.eopad;
import org.n52.javaps.transactional.TransactionalAlgorithmConfiguration; import org.n52.javaps.transactional.TransactionalAlgorithmConfigurer; import org.springframework.context.annotation.Configuration;
@Configuration public class InitialAlgorithmConfiguration implements TransactionalAlgorithmConfigurer {
private static final String NDVI
= "https://raw.githubusercontent.com/52North/eopad-docker/master/ndvi/application-package.json";
private static final String QUALITY
= "https://raw.githubusercontent.com/52North/eopad-docker/master/quality/application-package.json";
@Override
public void configure(TransactionalAlgorithmConfiguration configuration) {
configuration.addAlgorithmFromResource(NDVI).addAlgorithmFromResource(QUALITY);
}
} ```
Request/Response pattern
Request:
- request:
POST <http://localhost:8080/rest/processes/org.n52.docker.StringReplace/jobs> HTTP/1.1
Content-Type: application/json
- request body:
json
{
"inputs":[
{
"id":"source",
"input":{
"format":{
"mimeType":"text/plain"
},
"value": "The string 'WPS is the best' can be replaced"
}
}
],
"outputs":[
{
"id":"output",
"format":{
"mimeType":"text/plain"
},
"transmissionMode":"value"
}
]
}
Response:
the response to the previous request will contain a URL with the job id in the response header .
after requesting the result from the provided URL in the header the response pattern will look like:
json
{
"outputs":[
{
"id":"output",
"value":{
"inlineValue":"The string 'javaPS is the best' can be replaced"
}
}
]
}
Owner
- Name: 52°North Spatial Information Research GmbH
- Login: 52North
- Kind: organization
- Email: info@52north.org
- Location: Münster
- Website: https://52north.org/
- Twitter: fivetwon
- Repositories: 261
- Profile: https://github.com/52North
Advancing spatial information infrastructures to foster open science
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 1
- Total pull requests: 46
- Average time to close issues: N/A
- Average time to close pull requests: 30 days
- Total issue authors: 1
- Total pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.65
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 45
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- autermann (1)
Pull Request Authors
- dependabot-preview[bot] (44)
- matthesrieke (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 1
repo1.maven.org: org.n52.wps:docker-backend
52°North Maven Parent Project
- Homepage: https://github.com/52North/javaPS-docker-backend
- Documentation: https://appdoc.app/artifact/org.n52.wps/docker-backend/
- License: The Apache Software License, Version 2.0
-
Latest release: 1.0.0
published over 5 years ago
Rankings
Dependencies
- org.n52.wps:javaPS 1.7.1 import
- com.github.spotbugs:spotbugs-annotations 4.2.0 provided
- com.github.docker-java:docker-java 3.2.7
- com.github.docker-java:docker-java-api 3.2.7
- com.github.docker-java:docker-java-core 3.2.7
- com.google.code.findbugs:jsr305 3.0.2
- com.google.guava:guava
- joda-time:joda-time 2.10.10
- org.apache.commons:commons-compress 1.20
- org.n52.arctic-sea:janmayen
- org.n52.arctic-sea:shetland
- org.n52.arctic-sea:svalbard-json 8.2.0
- org.n52.wps:engine
- org.n52.wps:transactional 1.7.1
- org.slf4j:jcl-over-slf4j
- org.slf4j:slf4j-api
- org.springframework.boot:spring-boot-autoconfigure 2.4.1
- org.springframework:spring-beans
- org.springframework:spring-context
- junit:junit test
- org.hamcrest:hamcrest-all test
- org.mockito:mockito-core test