diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..513892c3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "config"] + path = config + url = git@github.com:geoserver/geoserver-cloud-config.git + branch = master diff --git a/config b/config new file mode 160000 index 00000000..b1efaafb --- /dev/null +++ b/config @@ -0,0 +1 @@ +Subproject commit b1efaafb67e9670d63253c27ab3f8466a13cdcf9 diff --git a/config/README.md b/config/README.md deleted file mode 100644 index 42e728ee..00000000 --- a/config/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Cloud Native GeoServer Externalized configuration sample repository - -This repository contains sample/default spring configuration files for all -micro-services in the [Cloud Native GeoServer](https://github.com/geoserver/geoserver-cloud) project, as used by the `config-service`, following -[spring-cloud-config](https://cloud.spring.io/spring-cloud-config/reference/html/) guidelines. - diff --git a/config/application.yml b/config/application.yml deleted file mode 100644 index 3f44dddb..00000000 --- a/config/application.yml +++ /dev/null @@ -1,193 +0,0 @@ -server: - tomcat: - # Maximum number of connections that the server accepts and processes at any given time. - # Once the limit has been reached, the operating system may still accept connections based on the "acceptCount" property. - max-connections: 1000 # default: 8192 - # Maximum queue length for incoming connection requests when all possible request processing threads are in use. - accept-count: 100 # default: 100 - accesslog: - enabled: false - directory: logs - encoding: UTF-8 - threads: - # Minimum amount of worker threads. - min-spare: 2 #default: 10 - # Maximum amount of worker threads. - max: 20 #defaul: 200 - -# Common configuration for all services. Override or add service specific config -# properties on each -service.yml file -geoserver: - security.enabled: true - servlet.filter.session-debug.enabled: false # until the NPE is fixed - catalog: - advertised: true - localWorkspace: true - secure: true - # enable caching if using the catalog-service as backend - caching.enabled: ${geoserver.backend.catalog-service.enabled} - bus: - # whether to send distributed events (i.e. acts as master). All instances receive remote events. - send-events: true - # whether to send the object (CatalogInfo/config info) as payload with the event. Set to false, - # not all possible payload types are properly tested, and full object payload is not needed. - send-object: ${geoserver.backend.data-directory.enabled} - # whether to send a diff of changes as payload with the event. Set to false, not all possible payload types are properly tested nor needed. - send-diff: ${geoserver.backend.data-directory.enabled} - backend: - # configure catalog backends and decide which backend to use on this service. - # All backends are disabled, enable the required one on each service. For example, the catalog microservice - # will enable one backend type, and the front services the catalog-service backend. - # revisit: Could be split into profiles - catalog-service: - enabled: ${backend.catalog:false} - # Base URI of the catalog service. If not set, will be automatically determined using the discovery service, looking for "catalog-service" - # This allows to explicitly set a fixed location for the catalog service. - # uri: http://catalog:8080 - cache-directory: ${java.io.tmpdir}/cngs/catalog-client/resource_store - fallback-resource-directory: ${java.io.tmpdir}/cngs/catalog-client/fallback_resource_store - data-directory: - enabled: ${backend.data-directory:false} - location: ${GEOSERVER_DATA_DIR:/opt/app/data_directory} - jdbcconfig: - enabled: ${backend.jdbcconfig:false} - initdb: false - web.enabled: true - cache-directory: ${jdbcconfig.cachedir:${java.io.tmpdir}/cngs/jdbcconfig/cache} - datasource: - jdbcUrl: ${jdbcconfig.url:jdbc:postgresql://database:5432/geoserver_config} - username: ${jdbcconfig.username:geoserver} - password: ${jdbcconfig.password:geo5erver} - driverClassname: ${jdbcconfig.driverClassname:org.postgresql.Driver} - # optional: - schema: ${jdbcconfig.schema:public} - minimumIdle: ${jdbcconfig.minConnections:2} - maximumPoolSize: ${jdbcconfig.maxConnections:8} - -management: - endpoints: - enabled-by-default: true - web.exposure.include: "*" - endpoint: - info.enabled: true - metrics.enabled: true - shutdown.enabled: true - health: - enabled: true - show-details: always - metrics: - binders: - processor.enabled: true - uptime.enabled: true - jvm.enabled: true - enable.all: true - enable.jvm: true - export: - atlas.enabled: false - -spring: - rabbitmq: - host: ${rabbitmq.host:rabbitmq} - port: ${rabbitmq.port:5672} - username: ${rabbitmq.user:guest} - password: ${rabbitmq.password:guest} - cloud: - bus: - enabled: true - id: ${server.instance-id} # use the same instance id for eureka (see service's' bootstrap.yml) and cloud-bus' rabbitmq instance id - trace.enabled: false #switch on tracing of acks (default off). - stream: - bindings: - springCloudBusOutput: - destination: gscatalog - springCloudBusInput: - destination: gscatalog - jackson: - default-property-inclusion: non_empty - serialization.indent_output: false #set to true if doing manual testing and want formatted output - -reactive.feign.cloud.enabled: true -reactive.feign.hystrix.enabled: false - -logging: - level: - root: WARN - org.springframework: ERROR - org.springframework.cloud.bus: INFO - org.springframework.retry: INFO - org.springframework.jdbc.support: INFO - com.zaxxer.hikari.pool: OFF - # geoserver roots - org.geoserver: INFO - org.geoserver.catalog.plugin: INFO - org.geoserver.wms: WARN #don't flood the logs with every request details - org.geoserver.wfs: WARN - org.geoserver.jackson: INFO - org.geotools.jackson: INFO - org.geoserver.platform: INFO - org.geoserver.platform.resource: INFO - org.geoserver.jdbcconfig: INFO - oshi.hardware.platform.linux: ERROR - oshi.software.os: ERROR - # gs-cloud roots - org.geoserver.cloud: INFO - org.geoserver.cloud.autoconfigure: INFO - org.geoserver.cloud.config.factory: INFO - # bus debugging - org.geoserver.cloud.bus: INFO - org.springframework.cloud.bus.BusAutoConfiguration: INFO - org.springframework.cloud.bus.DefaultBusPathMatcher: INFO - # reactivefeign: - reactivefeign.client.log: INFO - org.springframework.cloud.config.server.environment.NativeEnvironmentRepository: WARN - ---- -spring.profiles: local -# provide environment variables that otherwise would be given by docker-compose.yml -rabbitmq.host: localhost - -jdbcconfig.url: jdbc:postgresql://localhost:5432/geoserver_config -jdbcconfig.username: geoserver -jdbcconfig.password: geo5erver ---- -spring.profiles: datadir -backend.jdbcconfig: false -backend.catalog: false -backend.data-directory: true ---- -spring.profiles: jdbcconfig -backend.jdbcconfig: true -backend.catalog: false -backend.data-directory: false ---- -spring.profiles: catalog -backend.catalog: true -backend.jdbcconfig: false -backend.data-directory: false ---- -spring.profiles: debug - -logging: - level: - root: WARN - org.springframework: INFO - # geoserver roots - org.geoserver: INFO - org.geoserver.catalog.plugin: DEBUG - org.geoserver.wms: WARN - org.geoserver.wfs: WARN - org.geoserver.jackson: DEBUG - org.geotools.jackson: DEBUG - org.geoserver.platform: ERROR - org.geoserver.jdbcconfig: INFO - # gs-cloud roots - org.geoserver.cloud: DEBUG - org.geoserver.cloud.autoconfigure: DEBUG - org.geoserver.cloud.config.factory: DEBUG - # bus debugging - org.geoserver.cloud.bus: TRACE - org.springframework.cloud.bus: DEBUG - org.springframework.cloud.bus.BusAutoConfiguration: DEBUG - org.springframework.cloud.bus.DefaultBusPathMatcher: INFO - # reactivefeign: - reactivefeign.client.log: DEBUG diff --git a/config/catalog-service.yml b/config/catalog-service.yml deleted file mode 100644 index 72fd8987..00000000 --- a/config/catalog-service.yml +++ /dev/null @@ -1,33 +0,0 @@ -geoserver: - security.enabled: false - # Disable advertised catalog, it checks the org.geoserver.ows.Dispatcher.REQUEST to check if an OWS is in progress, - # which can never be the case, and causes a java.lang.NoClassDefFoundError on org.springframework.web.servlet.mvc.AbstractController - catalog: - advertised: false - # Disable LocalWorkspaceCatalog decorator, this service exposes a "raw catalog" backend, there's no concept of local workspaces - localWorkspace: false - secure: false - # enable caching while using the jdbcconfig backend, we've disabled its own internal caching due to concurrency related bugs - caching.enabled: ${geoserver.backend.jdbcconfig.enabled} - catalog-service: - io-threads: - # Number of back-end threads to hit the actual catalog with. Defaults 4 * number of cores if unset. - # If using jdbcconfig, let io-threads be about half the size of geoserver.backend.jdbcconfig.datasource.maximumPoolSize, - # it has the tendency to use more than one jdbc connection for some requests. - max-size: ${catalog.io.threads:8} - # maximum number of queued requests per worker thread before rejecting new requests - max-queued: ${catalog.io.maxQueued:10000} - bus: - # receive events but don't publish, it's the front catalogs that publish events to better track where the changes come from - send-events: false - backend: - # decide which catalog backend to use on this service, default to using jdbcconfig - jdbcconfig.enabled: ${backend.jdbcconfig:true} - -#spring: -# error.includeStacktrace: on_trace_param -# jackson.serialization.WRAP_ROOT_VALUE: false - ---- -spring.profiles: local -server.port: 9100 diff --git a/config/config-service.yml b/config/config-service.yml deleted file mode 100644 index e167c0bc..00000000 --- a/config/config-service.yml +++ /dev/null @@ -1,9 +0,0 @@ -spring: - profiles: - active: native #use native filesystem config by default instead of git. REVISIT. - config.server.native.searchLocations: ${config.path:file:./config} - -logging: - level: - root: WARN - org.springframework.cloud.config.server.environment.NativeEnvironmentRepository: WARN \ No newline at end of file diff --git a/config/gateway-service.yml b/config/gateway-service.yml deleted file mode 100644 index 6bc3a8fb..00000000 --- a/config/gateway-service.yml +++ /dev/null @@ -1,83 +0,0 @@ -server: - compression: - enabled: true -# Configure routes to services. See https://cloud.spring.io/spring-cloud-gateway/single/spring-cloud-gateway.html - -management: - endpoint.gateway.enabled: true # default value - endpoints: - enabled-by-default: true - web.exposure.include: "*" - #web.exposure.include: gateway, info, health - -spring: - cloud: - gateway: - actuator: - verbose: - enabled: true - routes: - - id: catalog - uri: lb://catalog-service - predicates: - - Path=/api/v1/** - filters: # Expose the catalog and configuration API only if the dev profile is active - - RouteProfile=dev,403 -# WFS routes - - id: wfs # proxies requests to gateway-service:/wfs to wfs-service:/wfs - uri: lb://wfs-service #load balanced to the wfs-service instances - predicates: - - Path=/wfs,/{workspace}/wfs,/{workspace}/{layer}/wfs,/schemas/wfs/** -# proxy [/{workspace}]/ows?SERVICE=wfs to wfs-service:[/{workspace}]/ows?SERVICE=wfs. Param value is case insensitive, name is not. - - id: wfs_ows - uri: lb://wfs-service - predicates: - - Path=/ows,/{workspace}/ows,/{workspace}/{layer}/ows - - RegExpQuery=(?i:service),(?i:wfs) # match service=wfs case insensitively -# WMS routes - - id: wms # proxies requests to gateway-service:/wms to wms-service:/wms - uri: lb://wms-service #load balanced to the wms-service instances - predicates: - - Path=/wms,/{workspace}/wms,/{workspace}/{layer}/wms,/schemas/wms/**,/openlayers/**,/openlayers3/** - - id: wms_ows # proxy [/{workspace}]/ows?SERVICE=wms to wms-service:[/{workspace}]/ows?SERVICE=wms. Param value is case insensitive, name is not. - uri: lb://wms-service - predicates: - - Path=/ows,/{workspace}/ows,/{workspace}/{layer}/ows - - RegExpQuery=(?i:service),(?i:wms) # match service=wms case insensitively -# WCS routes - - id: wcs # proxies requests to gateway-service:/wcs to wcs-service:/wcs - uri: lb://wcs-service #load balanced to the wps-service instances - predicates: - - Path=/wcs,/{workspace}/wcs,/{workspace}/{layer}/wcs,/schemas/wcs/** - - id: wcs_ows # proxy [/{workspace}]/ows?SERVICE=wcs to wcs-service:[/{workspace}]/ows?SERVICE=wcs. Param value is case insensitive, name is not. - uri: lb://wcs-service - predicates: - - Path=/ows,/{workspace}/ows,/{workspace}/{layer}/ows - - RegExpQuery=(?i:service),(?i:wcs) # match service=wcs case insensitively -# WPS routes - - id: wps # proxies requests to gateway-service:/wps to wfs-service:/wps - uri: lb://wps-service #load balanced to the wps-service instances - predicates: - - Path=/wps,/{segment}/wps,/schemas/wps/** - - id: wps_ows # proxy [/{workspace}]/ows?SERVICE=wps to wps-service:[/{workspace}]/ows?SERVICE=wps. Param value is case insensitive, name is not. - uri: lb://wps-service - predicates: - - Path=/ows,/{segment}/ows - - RegExpQuery=(?i:service),(?i:wps) # match service=wps case insensitively -# REST configuration routes - - id: restconfig - uri: lb://restconfig-v1 #load balanced to the restconfig-v1 instances - predicates: - - Path=/rest/** -# Web UI configuration routes - - id: restconfig - uri: lb://web-ui - predicates: - - Path=/,/index.html,/web,/web/**,/j_spring_security_check,/j_spring_security_logout - -logging: - level: - root: WARN - com.netflix.discovery: WARN - com.netflix.eureka: WARN - diff --git a/config/restconfig-v1.yml b/config/restconfig-v1.yml deleted file mode 100644 index 40eb2ec1..00000000 --- a/config/restconfig-v1.yml +++ /dev/null @@ -1,5 +0,0 @@ -geoserver: - backend.catalog-service.enabled: ${backend.catalog:true} ---- -spring.profiles: local -server.port: 9105 diff --git a/config/wcs-service.yml b/config/wcs-service.yml deleted file mode 100644 index 0ba69525..00000000 --- a/config/wcs-service.yml +++ /dev/null @@ -1,6 +0,0 @@ -geoserver: - backend.catalog-service.enabled: ${backend.catalog:true} ---- -spring.profiles: local -server.port: 9103 - \ No newline at end of file diff --git a/config/web-ui.yml b/config/web-ui.yml deleted file mode 100644 index 6f4049df..00000000 --- a/config/web-ui.yml +++ /dev/null @@ -1,33 +0,0 @@ -geoserver: - backend.catalog-service.enabled: ${backend.catalog:true} - web-ui: - file-browser.hide-file-system: true - # These are all default values, here just for reference. You can omit them and add only the ones to disable or further configure - security.enabled: true - wfs.enabled: true - wms.enabled: true - wcs.enabled: true - wps.enabled: false # not working yet - gwc.enabled: false # not ready yet - extensions: - importer.enabled: true - demos: - enabled: true - wps-request-builder: true - wcs-request-builder: true - demo-requests: true - srs-list: true - reprojection-console: true - layer-preview-page: - enabled: true - common-formats: - open-layers: true - gml: true - kml: false #kml links are broken - tools: - enabled: true - resource-browser: true - catalog-bulk-load: true ---- -spring.profiles: local -server.port: 9106 diff --git a/config/wfs-service.yml b/config/wfs-service.yml deleted file mode 100644 index adf6ff15..00000000 --- a/config/wfs-service.yml +++ /dev/null @@ -1,6 +0,0 @@ -geoserver: - backend.catalog-service.enabled: ${backend.catalog:true} ---- -spring.profiles: local -server.port: 9101 - \ No newline at end of file diff --git a/config/wms-service.yml b/config/wms-service.yml deleted file mode 100644 index 8332d4f5..00000000 --- a/config/wms-service.yml +++ /dev/null @@ -1,5 +0,0 @@ -geoserver: - backend.catalog-service.enabled: ${backend.catalog:true} ---- -spring.profiles: local -server.port: 9102 diff --git a/config/wps-service.yml b/config/wps-service.yml deleted file mode 100644 index 5c4059be..00000000 --- a/config/wps-service.yml +++ /dev/null @@ -1,5 +0,0 @@ -geoserver: - backend.catalog-service.enabled: ${backend.catalog:true} ---- -spring.profiles: local -server.port: 9104 diff --git a/docs/develop/index.md b/docs/develop/index.md index ddaf7e15..870a3c47 100644 --- a/docs/develop/index.md +++ b/docs/develop/index.md @@ -72,14 +72,17 @@ You need to have [docker](https://www.docker.com/) and [docker-compose](https:// ## Build -> The main branch follows GeoServer's main branch, currently `2.19-SNAPSHOT`. -> The stable branch builds against a released GeoServer version. -> Building `main` against the latest stable version (`2.18.2`) is no longer possible due to binary incompatible between `2.18.x` and `2.19.x`. Once 2.19.0 is released, it'll be possible to build against a stable version activating the `geoserver_stable_version` profile as follows: -> `./mvnw clean install -P geoserver_stable_version` +Clone the repository, including submodules: + +```bash +git clone --recursive /data2/groldan/git/geoserver-microservices +``` To build the applications run the following command from the root project directory: - ./mvnw clean install +```bash +./mvnw clean install +``` That will compile, run unit and integration tests, install maven artifacts to the local maven repository, and create all microservices docker images. The maven build uses the `com.spotify:dockerfile-maven-plugin` maven plugin to build the microservice docker images. @@ -87,25 +90,24 @@ The maven build uses the `com.spotify:dockerfile-maven-plugin` maven plugin to b The simple build command above creates the following docker images: ```bash -$ docker images -REPOSITORY TAG IMAGE ID CREATED SIZE -org.geoserver.cloud/gs-cloud-catalog 0.2-SNAPSHOT cd7159216be8 About an hour ago 406MB -org.geoserver.cloud/gs-cloud-config-service 0.2-SNAPSHOT 28f4f4f9ff35 25 hours ago 332MB -org.geoserver.cloud/gs-cloud-database 0.2-SNAPSHOT 0022bb2d2a1e 6 weeks ago 491MB -org.geoserver.cloud/gs-cloud-discovery-service 0.2-SNAPSHOT 827e3ebde911 25 hours ago 334MB -org.geoserver.cloud/gs-cloud-gateway 0.2-SNAPSHOT 55ecab20b51e 25 hours ago 330MB -org.geoserver.cloud/gs-cloud-restconfig-v1 0.2-SNAPSHOT d1aa8a3495a1 About an hour ago 432MB -org.geoserver.cloud/gs-cloud-wcs 0.2-SNAPSHOT 580b2336ab02 About an hour ago 416MB -org.geoserver.cloud/gs-cloud-web-ui 0.2-SNAPSHOT da1e714ff851 About an hour ago 461MB -org.geoserver.cloud/gs-cloud-wfs 0.2-SNAPSHOT 6f296b3ba198 About an hour ago 427MB -org.geoserver.cloud/gs-cloud-wms 0.2-SNAPSHOT 294ab913aaf4 About an hour ago 439MB -org.geoserver.cloud/gs-cloud-wps 0.2-SNAPSHOT 07135b861814 About an hour ago 440MB +$ docker images|grep geoserver-cloud|sort +geoservercloud/geoserver-cloud-catalog 1.0-SNAPSHOT afed2dc4888e 39 minutes ago 403MB +geoservercloud/geoserver-cloud-config 1.0-SNAPSHOT be987ff2a85e 42 minutes ago 319MB +geoservercloud/geoserver-cloud-discovery 1.0-SNAPSHOT abc5a17cf14c 42 minutes ago 320MB +geoservercloud/geoserver-cloud-gateway 1.0-SNAPSHOT 10f267950c15 42 minutes ago 317MB +geoservercloud/geoserver-cloud-postgres-jdbcconfig 1.0-SNAPSHOT 6014df31f1ee 2 hours ago 196MB +geoservercloud/geoserver-cloud-rest 1.0-SNAPSHOT 29406a1e1fdb 36 minutes ago 429MB +geoservercloud/geoserver-cloud-wcs 1.0-SNAPSHOT c77ac22aa522 37 minutes ago 391MB +geoservercloud/geoserver-cloud-webui 1.0-SNAPSHOT 876d6fc3fac0 36 minutes ago 449MB +geoservercloud/geoserver-cloud-wfs 1.0-SNAPSHOT 62960137eb5a 38 minutes ago 410MB +geoservercloud/geoserver-cloud-wms 1.0-SNAPSHOT 6686ca90b552 38 minutes ago 437MB +geoservercloud/geoserver-cloud-wps 1.0-SNAPSHOT 73bae600226c 37 minutes ago 416MB ``` To run the build without building the docker images, disable the `docker` maven profile: ```bash -$ ./mvnw clean install -P\!docker +$ ./mvnw clean install -P-docker ``` # Running @@ -115,15 +117,15 @@ $ ./mvnw clean install -P\!docker Now run the docker composition as follows, the first time it might need to download some additional images for the `rabbitmq` event broker and the `postgresql` config database: ```bash -$ docker-compose up -d +$ docker-compose --compatibility up -d ``` -Run `docker-compose logs -f` to watch startup progress of all services. +Run `docker-compose --compatibility logs -f` to watch startup progress of all services. Watch the output of `docker-compose ps` until all services are healthy: ```bash -$ docker-compose ps +$ docker-compose --compatibility ps Name Command State Ports ----------------------------------------------------------------------------------------------------------------- gscloud_catalog_1 dockerize -wait http://con ... Up (healthy)