forked from AtlasOfLivingAustralia/spatial-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from biodiversitydata-se/sbdi-dev
Add config files and scripts
- Loading branch information
Showing
7 changed files
with
408 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Run build with Gradle Wrapper | ||
run: ./gradlew build -x integrationTest | ||
|
||
- name: Upload war | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: package | ||
path: build/libs | ||
|
||
- name: Log in to the Container registry | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
|
||
- name: Build and push Docker image | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM tomcat:9.0-jdk11-temurin | ||
|
||
ENV TZ=Europe/Stockholm | ||
|
||
RUN mkdir -p \ | ||
/data/spatial-service/config \ | ||
/data/spatial-data | ||
|
||
COPY build/libs/spatial-service-*.war $CATALINA_HOME/webapps/ws.war | ||
|
||
ENV DOCKERIZE_VERSION v0.7.0 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y wget \ | ||
&& wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin \ | ||
&& apt-get autoremove -yqq --purge wget && rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
run: | ||
docker compose up --detach postgis geoserver | ||
./gradlew bootRun | ||
|
||
# In spatial-service-config-yml you need to change dataSource.url to 'postgis' | ||
# and geoserver.url to 'geoserver:8079' for this to work | ||
run-docker: | ||
./gradlew war | ||
docker compose build --no-cache | ||
docker compose up --detach | ||
|
||
release: | ||
@./sbdi/make-release.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: '3.7' | ||
|
||
services: | ||
|
||
geoserver: | ||
image: ghcr.io/biodiversitydata-se/geoserver:1.0.0 | ||
#image: sbdi/geoserver-dev | ||
#build: | ||
# context: ../geoserver | ||
environment: | ||
JAVA_OPTS: -Xmx2g -Xms128m -Xss512k -Djava.awt.headless=true | ||
TZ: Europe/Stockholm | ||
env_file: ./docker/env/geoserver/.envgeoserver | ||
volumes: | ||
- /data/geoserver_data_dir:/data/geoserver_data_dir | ||
- /data/spatial-data:/data/spatial-data | ||
ports: | ||
- "8079:8080" | ||
|
||
postgis: | ||
image: postgis/postgis:13-3.4 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_HOST_AUTH_METHOD: md5 | ||
TZ: Europe/Stockholm | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- db_data_spatial-service:/var/lib/postgresql/data | ||
- ./docker/env/postgis/layersdb.sql:/docker-entrypoint-initdb.d/layersdb.sql | ||
|
||
spatial-service: | ||
image: sbdi/spatial-service-dev | ||
build: | ||
context: . | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./sbdi/data/config/spatial-service-config.yml:/data/spatial-service/config/spatial-service-config.yml | ||
|
||
volumes: | ||
db_data_spatial-service: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Spatial-service | ||
|
||
## Setup | ||
|
||
### Config and data directory | ||
Create data directory at `/data/spatial-service` and populate as below (it is easiest to symlink the config files to the ones in this repo): | ||
``` | ||
mats@xps-13:/data/spatial-service$ tree | ||
. | ||
└── config | ||
└── spatial-service-config.yml -> /home/mats/src/biodiversitydata-se/spatial-service/sbdi/data/config/spatial-service-config.yml | ||
``` | ||
|
||
You'll also need to create the directories `/data/spatial-data` and `/data/geoserver_data_dir`. | ||
|
||
### Database | ||
An empty database will be created the first time the application starts. You can then export the database from production and import it. | ||
|
||
### GeoServer | ||
By default the development configuration will use a local GeoServer running at http://localhost:8079/geoserver. Alternatively you can use the production GeoServer (for read-only). Change `geoserver.url` to https://spatial.biodiversitydata.se/geoserver. | ||
|
||
## Usage | ||
Run locally: | ||
``` | ||
make run | ||
``` | ||
|
||
Build and run in Docker (using Tomcat). This requires a small change in the config file to work. See comment in Makefile. | ||
``` | ||
make run-docker | ||
``` | ||
|
||
Make a release. This will create a new tag and push it. A new Docker container will be built on Github. | ||
``` | ||
mats@xps-13:~/src/biodiversitydata-se/spatial-service (master *)$ make release | ||
Current version: 1.0.1. Enter the new version (or press Enter for 1.0.2): | ||
Updating to version 1.0.2 | ||
Tag 1.0.2 created and pushed. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
# | ||
# au.org.ala.spatial.service config | ||
# | ||
data: | ||
dir: '/data/spatial-data' | ||
geoserver: | ||
url: 'http://localhost:8079/geoserver' | ||
#url: 'https://spatial.biodiversitydata.se/geoserver' | ||
username: 'admin' | ||
password: 'geoserver' | ||
canDeploy: true | ||
# To use a remote geoserver instance, set geoserver.remote.geoserver_data_dir to the geoserver_data_dir path on the | ||
# remote server. This will cause layer files to be copied to geoserver_data_dir/data/ | ||
# remote: | ||
geoserver_data_dir: "/data/geoserver_data_dir" | ||
|
||
shpResolutions: [0.5, 0.25, 0.1, 0.05] | ||
grdResolutions: [0.5, 0.25, 0.1, 0.05, 0.01] | ||
|
||
biocacheServiceUrl: "https://records.biodiversitydata.se/ws" | ||
biocacheUrl: "https://records.biodiversitydata.se" | ||
openstreetmap: | ||
url: "https://tile.openstreetmap.org" | ||
|
||
slave.enable: true | ||
service.enable: true | ||
|
||
batch_sampling_passwords: "" | ||
batch_sampling_points_limit: 1000000 | ||
batch_sampling_fields_limit: 1000 | ||
|
||
--- | ||
# | ||
# au.org.ala.spatial.slave config | ||
# | ||
spatialService.url: "http://localhost:8080/ws" | ||
shp2pgsql.path: "/usr/bin/shp2pgsql" | ||
gdal.dir: "/usr/bin/" | ||
gdm.dir: "/data/spatial-data/modelling/gdm/DoGdm" | ||
|
||
aloc.xmx: "6G" | ||
aloc.threads: 4 | ||
maxent.mx: "1G" | ||
maxent.threads: 4 | ||
|
||
sampling.threads: 4 | ||
|
||
slaveKey: "" | ||
serviceKey: "" | ||
|
||
# time between pushing status updates to the master for a task | ||
statusTime: 3000 | ||
retryCount: 10 | ||
retryTime: 30000 | ||
|
||
# | ||
# CAS SETTINGS | ||
# | ||
# NOTE: Some of these will be ignored if default_config exists | ||
security: | ||
cas: | ||
appServerName: http://localhost:8080 | ||
casServerName: https://auth.biodiversitydata.se | ||
casServerUrlPrefix: https://auth.biodiversitydata.se/cas | ||
loginUrl: https://auth.biodiversitydata.se/cas/login | ||
logoutUrl: https://auth.biodiversitydata.se/cas/logout | ||
enabled: true | ||
bypass: false | ||
disableCAS: false | ||
gateway: false | ||
apikey: | ||
check: | ||
serviceUrl: https://auth.biodiversitydata.se/apikey/ws/check?apikey={0} | ||
oidc: | ||
enabled: false | ||
jwt: | ||
enabled: false | ||
|
||
|
||
auth.admin_role: ROLE_ADMIN | ||
app.http.header.userId: X-ALA-userId | ||
|
||
headerAndFooter: | ||
baseURL: "https://static.biodiversitydata.se" | ||
version: "2" | ||
|
||
ala.baseURL: https://biodiversitydata.se | ||
bie.baseURL: https://species.biodiversitydata.se | ||
bie.searchPath: '/search' | ||
|
||
records.url: https://archives.ala.org.au/archives/exports/lat_lon_taxon.zip | ||
|
||
api_key: | ||
lists.url: https://lists.biodiversitydata.se | ||
collections.url: https://collections.biodiversitydata.se | ||
sandboxHubUrl: | ||
sandboxBiocacheServiceUrl: | ||
phyloServiceUrl: | ||
|
||
spatialHubUrl: https://spatial.biodiversitydata.se | ||
|
||
gazField: "" | ||
userObjectsField: "" | ||
|
||
#apiKeyCheckUrlTemplate: "https://auth.ala.org.au/apikey/ws/check?apikey={0}" | ||
spatialService.remote: "" | ||
|
||
journalmap.api_key: | ||
journalmap.url: https://www.journalmap.org/ | ||
|
||
# For side by side installation with layers-service, analysis-service | ||
#legacy.workingdir: '/data/ala/data/alaspatial/' | ||
|
||
#legacy.enabled: true | ||
|
||
#legacy compatability type | ||
#"link" = link legacy files into new locations | ||
#"copy" = copy legacy files into new locations | ||
#"move" = move legacy files into new locations | ||
#legacy.type="link" | ||
|
||
#legacy.ANALYSIS_LAYER_FILES_PATH: '/data/ala/data/layers/analysis/' | ||
#legacy.LAYER_FILES_PATH: '/data/ala/data/layers/ready' | ||
#legacy.ALASPATIAL_OUTPUT_PATH: '/data/ala/runtime/output' | ||
|
||
grails.plugin.elfinder.rootDir: '/data/spatial-service' | ||
|
||
i18n.override.dir: '/data/spatial-service/config/i81n/' | ||
|
||
|
||
#layers-store config | ||
|
||
#Threads created for each batch intersection and each individual shape file | ||
#layers_store.BATCH_THREAD_COUNT: 3 | ||
|
||
#Set LAYER_INDEX_URL to use REMOVE layer intersections. | ||
#layers_store.LAYER_INDEX_URL: https://spatial.ala.org.au/layers-service | ||
|
||
#Use local layer files for sampling or the /intersect/batch service provided by LAYER_INDEX_URL | ||
#layers_store.LOCAL_SAMPLING: false | ||
layers_store.LOCAL_SAMPLING: true | ||
|
||
# Set intersect config reload time in ms | ||
#layers_store.CONFIG_RELOAD_WAIT: 12000000 | ||
|
||
#Comma separated shape file fields to preload, or 'all' | ||
#layers_store.PRELOADED_SHAPE_FILES: all | ||
#layers_store.PRELOADED_SHAPE_FILES: cl22,cl20 | ||
|
||
# Grid intersection buffer size in bytes. Must be multiple of 64. | ||
# Only applies to grids > 80MB. | ||
# layers_store.GRID_BUFFER_SIZE=4096 | ||
#layers_store.GRID_BUFFER_SIZE: 40960 | ||
|
||
# Number of GridCacheReader objects to open. | ||
#layers_store.GRID_CACHE_READER_COUNT: 5 | ||
|
||
# layers_store ingestion | ||
#layers_store.CAN_INGEST_LAYERS: false | ||
#layers_store.CAN_UPDATE_LAYER_DISTANCES: false | ||
#layers_store.CAN_UPDATE_GRID_CACHE: false | ||
#layers_store.CAN_GENERATE_ANALYSIS_FILES: false | ||
#layers_store.CAN_INTERSECT_LAYERS: false | ||
#layers_store.CAN_GENRATE_THUMBNAILS: false | ||
|
||
#layers_store.FIELD_STYLES: true | ||
|
||
layers_store.GEONETWORK_URL: 'https://spatial.biodiversitydata.se/geonetwork' | ||
|
||
distributions.cache.dir: "/data/spatial-service/mapCache/" | ||
distributions.geoserver.image.url: "/ALA/wms?service=WMS&version=1.1.0&request=GetMap&sld=https://fish.ala.org.au/data/dist.sld&layers=ALA:aus1,ALA:Distributions&styles=&bbox=109,-47,157,-7&srs=EPSG:4326&format=image/png&width=400&height=400&viewparams=s:" | ||
|
||
dataSource: | ||
url: 'jdbc:postgresql://localhost/layersdb' | ||
username: layers | ||
password: layers | ||
|
||
grails.serverURL: http://localhost:8080/ws | ||
grails.app.context: /ws | ||
|
||
skin.layout: main | ||
skin.fluidLayout: false | ||
skin.orgNameLong: Swedish Biodiversity Data Infrastructure | ||
skin.orgNameShort: SBDI | ||
skin.favicon: https://static.biodiversitydata.se/favicon.ico | ||
skin.homeUrl: https://tools.biodiversitydata.se | ||
|
||
grails.controllers.upload.maxFileSize: 2097152000 | ||
grails.controllers.upload.maxRequestSize: 2097152000 | ||
|
||
# Needed for map exports | ||
google: | ||
apikey: "AIzaSyAJDtEeoy7Sc9pij2TAoVnmTwA34Q-2VHk" | ||
|
||
logging: | ||
level: | ||
root: INFO | ||
|
||
userdetails: | ||
baseUrl: "https://auth.biodiversitydata.se/userdetails" | ||
|
||
# ala-auth-plugin conf | ||
userDetails: | ||
url: "https://auth.biodiversitydata.se/userdetails" |
Oops, something went wrong.