EOX GitLab Instance

Commit 7be03b2e authored by Nikola Jankovic's avatar Nikola Jankovic 💻
Browse files

added helm chart

updated versions in prep for v2.0
parent ba8e2b38
Pipeline #17761 failed
......@@ -39,11 +39,7 @@ bower_components
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.vscode/
# misc
.sass-cache
......@@ -88,4 +84,4 @@ lerna-debug.log
# System Files
.DS_Store
Thumbs.db
\ No newline at end of file
Thumbs.db
......@@ -13,8 +13,8 @@ deploy_latest:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker build -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE:latest
except:
- tags
only:
- main
deploy:
image: docker:20.10.8
......@@ -27,3 +27,14 @@ deploy:
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
only:
- tags
helm:
image: devth/helm:v3.6.3
stage: chart
script:
# push Helm chart
- "upload_filename=$(helm package ./chart | sed 's/^Successfully packaged chart and saved it to: \\(.*\\)/\\1/')"
- curl -u $HELM_CHART_REPOSITORY_CREDENTIALS -v -X POST https://charts-public.hub.eox.at/api/charts --data-binary "@${upload_filename}"
only:
- tags
- main
......@@ -44,4 +44,4 @@ COPY --from=build-stage /dist /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
LABEL version="1.5.2"
LABEL version="2.0.0"
# Client
The client service of the view server
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
apiVersion: v2
name: vs-client
description: A Helm chart for the View server client
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.0.0"
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta charset="UTF-8">
<title>{{ .Values.global.metadata.title | default "PRISM View Server" }}</title>
<link rel="icon" href="//eox.at/favicon.ico" type="image/x-icon">
<link rel="icon" sizes="16x16" href="//eox.at/favicon-16x16.png" type="image/png">
<link rel="icon" sizes="32x32" href="//eox.at/favicon-32x32.png" type="image/png">
<link rel="apple-touch-icon" sizes="180x180" href="//eox.at/apple-touch-icon.png" type="image/png">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#004170">
</head>
<body>
<header id="header" style="width: 100%; height:70px;">
<h3 style="width:100%; text-align:center; color: #006699;">
{{ .Values.global.metadata.header | default "PRISM View Server (PVS) Client powered by <a href=\"//eox.at\"><img src=\"//eox.at/EOX_Logo.svg\" alt=\"EOX\" style=\"height:25px;margin-left:10px\"/></a>" }}
</h3>
</header>
<div id="app" style="width: 100%; top: 60px; bottom: 0; position: absolute; margin: 0; padding:0;"></div>
<script src="vsclient.js"></script>
<script>
var baseUrl = '//{{ index (index .Values.ingress.tls 0).hosts 0 }}/';
var baseUrlsWMTS = [
'//{{ index (index .Values.ingress.tls 0).hosts 0 }}/cache/ows/wmts',
];
var baseUrlsOws = [
'//{{ index (index .Values.ingress.tls 0).hosts 0 }}/ows',
];
var config = {
"settings": {
"rightPanelOpen": true,
"leftPanelOpen": true,
"leftPanelTabIndex": 1,
"tutorial": "once",
"uploadEnabled": true,
"selectFilesDownloadEnabled": false,
"downloadEnabled": true,
"searchEnabled" : true,
"searchDebounceTime": 500,
"language": "en",
"timeDomain": {{ .Values.config.timeDomain | toJson }},
"constrainTimeDomain": true,
"displayTimeDomain": {{ .Values.config.displayTimeDomain | toJson }},
"displayInterval": {{ .Values.config.displayInterval | quote }},
"selectedTimeDomain": {{ .Values.config.selectedTimeDomain | toJson }},
"selectableInterval": {{ .Values.config.selectableInterval | quote }},
"timeSliderControls": true,
"enableSingleLayerMode": false,
"maxTooltips": 1,
"center": {{ .Values.config.center | toJson }},
"zoom": {{ .Values.config.zoom }},
"maxZoom": {{ .Values.config.maxZoom }},
"footprintFillColor": "rgba(0, 0, 0, 0.2)",
"footprintStrokeColor": "rgba(0, 0, 0, 1)",
"filterFillColor": "rgba(0, 165, 255, 0)",
"filterStrokeColor": "rgba(0, 165, 255, 1)",
"filterOutsideColor": "rgba(0, 0, 0, 0.5)",
"selectedFootprintFillColor": "rgba(255, 0, 0, 0.2)",
"selectedFootprintStrokeColor": "rgba(255, 0, 0, 1)",
"highlightFillColor": "rgba(246, 182, 0, 0.5)",
"highlightStrokeColor": "rgba(246, 182, 0, 1)",
"highlightStrokeWidth": 3,
"translations": {
"en": {
"Cloud Cover": "Cloud coverage (%)",
"Error: NoApplicableCode": "Search timed out. Please refine the filter criteria.",
}
},
"filterSettings": {
"time": {
"hidden": true,
}
},
"downloadFormats": [
{
"name": "TIFF",
"mimeType": "image/tiff"
},
{
"name": "JPEG 2000",
"mimeType": "image/jp2"
},
{
"name": "HDF",
"mimeType": "application/x-hdf",
},
],
"downloadProjections": [
{
"name": "WGS-84",
"identifier": "http://www.opengis.net/def/crs/EPSG/0/4326"
},
{
"name": "Web Mercator",
"identifier": "http://www.opengis.net/def/crs/EPSG/0/3857"
},
{
"name": "ETRS89 / LAEA Europe",
"identifier": "http://www.opengis.net/def/crs/EPSG/0/3035"
}
],
"downloadInterpolations": [
{
"name": "Bilinear",
"identifier": "http://www.opengis.net/def/interpolation/OGC/1/bilinear"
},
{
"name": "Nearest Neighbour",
"identifier": "http://www.opengis.net/def/interpolation/OGC/1/nearest-neighbour"
},
{
"name": "Average",
"identifier": "http://www.opengis.net/def/interpolation/OGC/1/average"
},
]
},
"baseLayers": [
{
"id": "terrain-light",
"displayName": "EOX Terrain-Light",
"display": {
"id": "terrain-light",
"visible": true,
"protocol": "WMTS",
"urls": [
"//a.s2maps-tiles.eu/wmts/",
"//b.s2maps-tiles.eu/wmts/",
"//c.s2maps-tiles.eu/wmts/",
"//d.s2maps-tiles.eu/wmts/",
"//e.s2maps-tiles.eu/wmts/",
],
"matrixSet": "WGS84",
"format": "image/png",
"projection": "EPSG:4326",
"style": "default",
"attribution": "Terrain-Light { Data &copy; <a href=\"//www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors and <a href='javascript:;' onClick='toggle(terrain_attribution)'>others</a>, Rendering &copy; <a href=\"//eox.at\" target=\"_blank\">EOX</a> }"
}
},
{
"id": "terrain",
"displayName": "EOX Terrain",
"display": {
"id": "terrain",
"visible": false,
"protocol": "WMTS",
"urls": [
"//a.s2maps-tiles.eu/wmts/",
"//b.s2maps-tiles.eu/wmts/",
"//c.s2maps-tiles.eu/wmts/",
"//d.s2maps-tiles.eu/wmts/",
"//e.s2maps-tiles.eu/wmts/"
],
"matrixSet": "WGS84",
"format": "image/png",
"projection": "EPSG:4326",
"style": "default",
"attribution": "Terrain { Data &copy; <a href=\"//www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors and <a href='javascript:;' onClick='toggle(terrain_attribution)'>others</a>, Rendering &copy; <a href=\"//eox.at\" target=\"_blank\">EOX</a> }"
}
},
{
"id": "s2cloudless",
"displayName": "EOX Sentinel-2 cloudless",
"display": {
"id": "s2cloudless-2018",
"visible": false,
"protocol": "WMTS",
"urls": [
"//a.s2maps-tiles.eu/wmts/",
"//b.s2maps-tiles.eu/wmts/",
"//c.s2maps-tiles.eu/wmts/",
"//d.s2maps-tiles.eu/wmts/",
"//e.s2maps-tiles.eu/wmts/"
],
"matrixSet": "WGS84",
"format": "image/png",
"projection": "EPSG:4326",
"style": "default",
"attribution": "<a xmlns:dct=\"//purl.org/dc/terms/\" href=\"//s2maps.eu\" property=\"dct:title\">Sentinel-2 cloudless - //s2maps.eu</a> by <a xmlns:cc=\"//creativecommons.org/ns#\" href=\"s://eox.at\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">EOX IT Services GmbH</a> (Contains modified Copernicus Sentinel data 2017 &amp; 2018)"
}
}
],
"layers": [ {{/* Create subLayers for client */}}
{{- $parentLayers := list -}}
{{- $subLayersMap := dict -}}
{{- range $layer := .Values.global.layers }}
{{- if eq $layer.id $layer.parentLayer }}
{{- $parentLayers = append $parentLayers $layer.id }}
{{- end }}
{{- end }}
{{- range $parentLayer := $parentLayers -}}
{{- $subLayers := list }}
{{- range $layer := $.Values.global.layers -}}
{{- if and (eq $layer.parentLayer $parentLayer) (not (eq $layer.id $parentLayer)) -}}
{{- $subLayers = append $subLayers $layer }}
{{- end }}
{{- end }}
{{- $_ := set $subLayersMap $parentLayer $subLayers -}}
{{- end }}
{{- range $layer := .Values.global.layers }}
{{- if eq $layer.parentLayer $layer.id }}
{
"id": {{ $layer.id | quote }},
"displayName": {{ $layer.title | quote }},
"displayColor": {{ $layer.display_color | default "eb3700" | quote }},
"display": {
"id": {{ $layer.id | quote }},
"visible": {{ $layer.visible | default true }},
"protocol": 'WMTS',
"urls": baseUrlsWMTS,
"format": 'image/png',
"projection": 'EPSG:4326',
"matrixSet": "WGS84",
"style": 'default',
"useMilliseconds": false,
"maxZoom": 17,
"options": [{
"name": "Style",
"target": "display.extraParameters.LAYERS",
"values": [
{{- range $subLayer := get $subLayersMap $layer.id }}
{
"label": {{ $subLayer.title | quote }},
"value": {{ $subLayer.id | quote }}
},
{{- end }}
]
}],
},
"search": {
"protocol": "OpenSearch",
"url": baseUrl + "opensearch/collections/{{ $layer.id }}/",
"id": {{ $layer.id | quote }},
"histogramBinCount": 28,
"format": "application/atom+xml",
"method": "GET",
"histogramThreshold": 600,
"lightweightBuckets": true,
"searchLimit": 600,
"loadMore": 600,
"pageSize": 200,
"countZeroRecords": true,
"parameters": [
{
"max": 100,
"min": 0,
"step": 1,
"range": true,
"type": "eo:cloudCover",
"name": "Cloud Coverage",
"title": "Cloud Coverage in percent"
},
],
"parametersFilterSettings": {
"collapsed": false,
},
},
"download": {
"protocol": "EO-WCS",
"url": baseUrl + "ows",
// "method": "GET",
"rewrite": {
// add __coverage to the coverageId
"from": "({{ "{{" }}id}})",
"to": "$1__coverage"
}
}
}
{{- end }}
{{- end }}
],
"overlayLayers": [
{
"id": "overlay_base",
"displayName": "EOX Borders and Labels",
"display": {
"id": "overlay_base",
"visible": false,
"protocol": "WMTS",
"urls": [
"//a.s2maps-tiles.eu/wmts/",
"//b.s2maps-tiles.eu/wmts/",
"//c.s2maps-tiles.eu/wmts/",
"//d.s2maps-tiles.eu/wmts/",
"//e.s2maps-tiles.eu/wmts/"
],
"matrixSet": "WGS84",
"style": "default",
"format": "image/png",
"projection": "EPSG:4326",
"attribution": "Overlay { Data &copy; <a href=\"//www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, Rendering &copy; <a href=\"//eox.at\" target=\"_blank\">EOX</a> and <a href=\"//github.com/mapserver/basemaps\" target=\"_blank\">MapServer</a> }"
}
},
{{- range $layer := .Values.global.overlayLayers }}
{
"id": {{ $layer.id | quote }},
"displayName": {{ $layer.title | quote }},
"displayColor": {{ $layer.displayColor | quote }},
"display": {
"id": {{ $layer.id | quote }},
"visible": false,
"protocol": 'WMS',
"urls": baseUrlsOws,
"format": 'image/png',
"projection": 'EPSG:4326',
"style": 'red',
"useMilliseconds": false,
"maxZoom": 17,
"synchronizeTime": true,
},
},
{{- end }}
]
};
var app = new Application({
config: config,
container: document.getElementById('app'),
});
app.start();
</script>
</body>
</html>
{{/*
Expand the name of the chart.
*/}}
{{- define "vs-client.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "vs-client.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vs-client.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "vs-client.labels" -}}
helm.sh/chart: {{ include "vs-client.chart" . }}
{{ include "vs-client.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "vs-client.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vs-client.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "vs-client.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "vs-client.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vs-client.fullname" . }}-config
data:
{{ (tpl (.Files.Glob "files/index.html").AsConfig . ) | nindent 2}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vs-client.fullname" . }}-client
labels:
{{- include "vs-client.labels" . | nindent 4 }}
app.kubernetes.io/service: client
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "vs-client.selectorLabels" . | nindent 6 }}
app.kubernetes.io/service: client
strategy:
rollingUpdate:
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
annotations:
prometheus.io/scrape: "false"
labels:
{{- include "vs-client.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: client
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-client
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default ( print "release-" .Chart.AppVersion ) }}
imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /usr/share/nginx/html/index.html
name: client
subPath: index.html
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- configMap:
items:
- key: index.html
path: index.html
name: {{ include "vs-client.fullname" . }}-client
name: client
apiVersion: v1
kind: Service
metadata:
name: {{ include "vs-client.fullname" . }}-client
labels:
{{- include "vs-client.labels" . | nindent 4 }}
app.kubernetes.io/service: client
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "vs-client.selectorLabels" . | nindent 4 }}
app.kubernetes.io/service: client
replicaCount: 1
image:
repository: registry.gitlab.eox.at/vs/client
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: []
config:
timeDomain:
- "2019-01-01T00:00:00Z"
- "2020-12-31T23:59:59Z"
displayTimeDomain:
- "2019-01-01T00:00:00Z"
- "2020-12-31T23:59:59Z"
displayInterval: P1096D
selectedTimeDomain:
- "2020-08-01T00:00:00Z"
- "2020-08-31T23:59:59Z"
selectableInterval: P1096D
center:
- 12
- 49
zoom: 5
maxZoom: 17
service:
type: ClusterIP
port: 80