EOX GitLab Instance

Commit bc4839e5 authored by Nikola Jankovic's avatar Nikola Jankovic 💻
Browse files

Merge branch 'main' of gitlab.eox.at:vs/cache into main

parents ca515751 7364a9fe
Pipeline #18235 failed with stages
in 3 minutes and 8 seconds
......@@ -38,9 +38,7 @@ USER root
COPY . .
RUN ./install.sh
ADD requirements.txt \
/
RUN pip3 install -r /requirements.txt
ENV COLLECTION_ID= \
INSTANCE_ID="view-server_cache" \
RENDERER_HOST= \
......
# 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-cache
description: A Helm chart for the View server cache
# 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
maintainers:
- name: EOX IT Services GmbH
url: https://eox.at
# 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"
{{/*
Expand the name of the chart.
*/}}
{{- define "vs-cache.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-cache.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-cache.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "vs-cache.labels" -}}
helm.sh/chart: {{ include "vs-cache.chart" . }}
{{ include "vs-cache.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "vs-cache.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vs-cache.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "vs-cache.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "vs-cache.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vs-cache.fullname" . }}-config
data:
{{ (tpl (.Files.Glob "files/mapcache.xml").AsConfig . ) | nindent 2}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vs-cache.fullname" . }}
labels:
{{- include "vs-cache.labels" . | nindent 4 }}
app.kubernetes.io/service: cache
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "vs-cache.selectorLabels" . | nindent 6 }}
app.kubernetes.io/service: cache
strategy:
rollingUpdate:
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
annotations:
prometheus.io/scrape: "false"
labels:
{{- include "vs-cache.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: cache
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
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
startupProbe:
httpGet:
path: /
port: http
failureThreshold: 30
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
args:
- /opt/cache/run-httpd.sh
env:
{{- range $key, $value := .Values.global.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: DB_HOST
value: {{ .Release.Name }}-database
- name: RENDERER_HOST
value: {{ .Release.Name }}-renderer
- name: WAIT_SERVICES
value: "{{ .Release.Name }}-database:{{ .Values.global.env.DB_PORT }} {{ .Release.Name }}-renderer:80"
volumeMounts:
- mountPath: /mapcache-template.xml
name: cache-config
subPath: mapcache.xml
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- configMap:
items:
- key: mapcache.xml
path: mapcache.xml
name: {{ include "vs-cache.fullname" . }}-config
name: cache-config
{{- $fullName := include "vs-cache.fullname" . -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "vs-cache.labels" . | nindent 4 }}
{{- with .Values.global.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
nginx.ingress.kubernetes.io/rewrite-target: /$1
{{- end }}
spec:
{{- if .Values.global.ingress.tls }}
tls:
{{- range .Values.global.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.global.ingress.hosts }}
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
- host: {{ .host | quote }}
http:
paths:
- path: /cache/(.*)
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: 80
{{- else }}
- host: {{ .host | quote }}
http:
paths:
- path: /cache/(.*)
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end -}}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "vs-cache.fullname" . }}
labels:
{{- include "vs-cache.labels" . | nindent 4 }}
app.kubernetes.io/service: cache
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "vs-cache.selectorLabels" . | nindent 4 }}
app.kubernetes.io/service: cache
replicaCount: 1
nameOverride:
fullNameOverride:
image:
repository: registry.gitlab.eox.at/vs/cache
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: []
config:
wmsEnabled: true
wmtsEnabled: true
connectionTimeout: 10
timeout: 120
expires: 3600
key: /{tileset}/{grid}/{dim}/{z}/{x}/{y}.{ext}
service:
type: ClusterIP
port: 80
resources:
limits:
cpu: 0.5
memory: 1Gi
requests:
cpu: 0.1
memory: 0.1Gi
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 80
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
affinity: {}
global:
env:
INSTANCE_ID: prism-view-server_cache
DB_PORT: 5432
metadata:
title: PRISM Data Access Service developed by EOX
header: PRISM Data Access View Server (VS) Client powered by <a href="//eox.at"><img src="//eox.at/wp-content/uploads/2017/09/EOX_Logo.svg" alt="EOX" style="height:25px;margin-left:10px"/></a>
abstract: PRISM Data Access Service developed by EOX
url: https://ecma/cache/ows
keywords:
- view server
accessConstraints: UNKNOWN
fees: UNKNOWN
contactName: Stephan Meissl
contactPhone: Please contact via mail.
contactFacsimile: None
contactOrganization: EOX IT Services GmbH
contactCity: Vienna
contactStateOrProvince: Vienna
contactPostcode: 1090
contactCountry: Austria
contactElectronicMailAddress: office@eox.at
contactPosition: CTO
providerName: EOX
providerUrl: https://eox.at
inspireProfile: true
inspireMetadataUrl: TBD
defaultLanguage: eng
language: eng
storage:
cache: {}
layers: []
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/enable-cors: "true"
cert-manager.io/cluster-issuer: letsencrypt
hosts:
- host: vs.local
tls:
- hosts:
- vs.local
secretName: vs-secret
# hosts and tls will be redefined always
......@@ -14,6 +14,5 @@ VERSION=1.10.0-1~bionic0eox5
DEBIAN_FRONTEND=noninteractive apt --no-install-recommends install -y \
libmapcache1=${VERSION} libapache2-mod-mapcache=${VERSION} mapcache-tools=${VERSION} \
sqlite3 curl ca-certificates apache2 python3-dateutil python3-redis wait-for-it postgresql-client \
python3-pip
rm -rf /var/lib/apt/lists/*
#------------------------------------------------------------------------------
#
# Project: view server
# Authors: Stephan Meissl <stephan.meissl@eox.at>
#
#------------------------------------------------------------------------------
# Copyright (C) 2018 EOX IT Services GmbH <https://eox.at>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies of this Software or works derived from this Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#-----------------------------------------------------------------------------
FROM registry.gitlab.eox.at/vs/cache:latest
LABEL name="view server seeder" \
vendor="EOX IT Services GmbH <https://eox.at>" \
license="MIT Copyright (C) 2019 EOX IT Services GmbH <https://eox.at>" \
type="view server cache"
COPY . .
RUN apt --no-install-recommends install -y \
python3-pip
ADD requirements.txt \
/
RUN pip3 install -r /requirements.txt
EXPOSE 80
ENTRYPOINT ["./entrypoint.sh"]
CMD ["./run-httpd.sh"]
LABEL version="2.0.0"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment