Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPS service integration #340

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COMPOSE_PROJECT_NAME=gscloud
TAG=1.1-SNAPSHOT
GS_USER="1000:1000"
BASE_PATH=/geoserver/cloud
DEFAULT_PROFILES="acl,debug"
DEFAULT_PROFILES="debug"
EUREKA_SERVER_URL=http://discovery:8761/eureka
JDBCCONFIG_DBNAME=geoserver_config
JDBCCONFIG_URL=jdbc:postgresql://database:5432/${JDBCCONFIG_DBNAME}
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ $ mkdir docker-compose_datadir
$ alias dcd="docker-compose -f docker-compose.yml -f docker-compose-shared_datadir.yml"
$ dcd up -d
```
Note: In case you want to start the docker composition and being able to test some layers,
you can copy data/release datadir that is part of the geoserver_submodule
instead of creating the docker-compose_datadir emtpy folder, as follow:

```bash
$ cp -rf ./geoserver_submodule/geoserver/data/release /tmp/datadir
$ ln -s /tmp/datadir docker-compose_datadir
```

Verify the services are running with `dcd ps`.
Healthckecks use `curl` hitting the `http:localhost:8081/actuator/health`.
Expand Down
2 changes: 1 addition & 1 deletion config
6 changes: 6 additions & 0 deletions docker-compose-shared_datadir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ services:
volumes:
- test_shared_data_directory:/opt/app/data_directory

wps:
environment:
SPRING_PROFILES_ACTIVE: "${DEFAULT_PROFILES},datadir"
volumes:
- test_shared_data_directory:/opt/app/data_directory

rest:
environment:
SPRING_PROFILES_ACTIVE: "${DEFAULT_PROFILES},datadir"
Expand Down
27 changes: 18 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,24 @@ services:
cpus: '2.0'
memory: 2G

# # WPS microservice, port dynamically allocated to allow scaling (e.g docker-compose scale wps=5)
# wps:
# image: geoservercloud/geoserver-cloud-wps:${TAG}
# depends_on:
# - rabbitmq
# environment:
# JAVA_OPTS: ${WPS_JAVA_OPTS}
# networks:
# - gs-cloud-network
# WPS microservice, port dynamically allocated to allow scaling (e.g docker-compose scale wps=5)
wps:
image: geoservercloud/geoserver-cloud-wps:${TAG}
user: ${GS_USER}
depends_on:
- rabbitmq
- discovery
environment:
SPRING_PROFILES_ACTIVE: "${DEFAULT_PROFILES}"
JAVA_OPTS: "${WPS_JAVA_OPTS}"
RETRY_MAX_ATTEMPTS: 100
networks:
- gs-cloud-network
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G

# REST config microservice, port dynamically allocated to allow scaling (e.g docker-compose scale rest=5)
rest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.vfny.geoserver.wfs.servlets.TestWfsPost;

@Configuration(proxyBeanMethods = true)
@ImportResource( //
Expand All @@ -29,6 +30,10 @@ public class WebCoreConfiguration {
return new GeoServerWicketServlet();
}

public @Bean TestWfsPost testWfsPostServlet() {
return new TestWfsPost();
}

/** Register the {@link WicketServlet} */
public @Bean ServletRegistrationBean<GeoServerWicketServlet>
geoServerWicketServletRegistration() {
Expand All @@ -40,6 +45,15 @@ public class WebCoreConfiguration {
return registration;
}

/** Register the {@link TestWfsPost servlet} */
public @Bean ServletRegistrationBean<TestWfsPost> wfsTestServletRegistration() {
TestWfsPost servlet = testWfsPostServlet();
ServletRegistrationBean<TestWfsPost> registration;
registration = new ServletRegistrationBean<TestWfsPost>(servlet, "/TestWfsPost");

return registration;
}

public @Bean HeaderContribution geoserverCloudCssTheme() {
HeaderContribution contribution = new HeaderContribution();
contribution.setScope(GeoServerBasePage.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
@ImportResource( //
reader = FilteringXmlBeanDefinitionReader.class, //
locations = { //
"jar:gs-wps-.*!/applicationContext.xml" // , //
"jar:gs-wps-.*!/applicationContext.xml", //
"jar:gs-wfs-.*!/applicationContext.xml", //
"jar:gs-wcs-.*!/applicationContext.xml", //
"jar:gs-wcs1_0-.*!/applicationContext.xml", //
"jar:gs-wcs1_1-.*!/applicationContext.xml", //
"jar:gs-wcs2_0-.*!/applicationContext.xml" //
// // REVISIT: wps won't start without the web components! see note in pom.xml
// "jar:gs-web-core-.*!/applicationContext.xml", //
// "jar:gs-web-wps-.*!/applicationContext.xml", //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
package org.geoserver.cloud.wps;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@Disabled("Ignore until the app it functional")
@SpringBootTest
@EnableAutoConfiguration
@ActiveProfiles("test")
public class WpsApplicationTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.geoserver.wms.CacheConfiguration;
import org.geoserver.wms.WMSInfo;
import org.geoserver.wms.WMSInfoImpl;
import org.geoserver.wps.WPSInfo;
import org.geoserver.wps.WPSInfoImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand All @@ -50,6 +52,13 @@ public void before() {
testRemoteAddEvent(service, geoserver::add, ServiceAdded.class);
}

public @Test void testConfigAddEvent_WPSInfo() {
WPSInfoImpl service = new WPSInfoImpl();
service.setName("WPS");
service.setTitle("My WPS");
testRemoteAddEvent(service, geoserver::add, ServiceAdded.class);
}

public @Test void testConfigAddEvent_ServiceInfo_Workspace() {
WMSInfoImpl workspaceService = new WMSInfoImpl();
workspaceService.setName("WMS");
Expand All @@ -74,6 +83,20 @@ public void before() {
ServiceModified.class);
}

public @Test void testConfigRemoteModifyEvent_WPSInfo() {
WPSInfo service = testData.faker().serviceInfo("WPS_WS_TEST", WPSInfoImpl::new);
service.setWorkspace(testData.workspaceB);
geoserver.add(service);

testRemoteModifyEvent(
service,
s -> {
s.setTitle("My WPS");
},
geoserver::save,
ServiceModified.class);
}

public @Test void testConfigAddEvent_SettingsInfo() {
catalog.add(testData.workspaceB);

Expand Down