EOX GitLab Instance

Commit 86ae1053 authored by Mussab Abdalla's avatar Mussab Abdalla
Browse files

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

parents a8929db1 37687e12
Pipeline #18230 failed with stages
in 21 seconds
[bumpversion]
current_version = 2.0.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)\.(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}-{release}.{build}
{major}.{minor}.{patch}
tag_name = release-{new_version}
[bumpversion:part:release]
optional_value = final
first_value = alpha
values =
alpha
beta
rc
final
[bumpversion:file:.bumpversion.cfg]
search = current_version = {current_version}
[bumpversion:file:Dockerfile]
search = version="{current_version}"
replace = version="{new_version}"
[bumpversion:glob:chart/Chart.yaml]
search = appVersion: "{current_version}"
replace = appVersion: "{new_version}"
chart/
tests/
.gitignore
.gitlab-ci.yml
Dockerfile
.venv/
.git/
requirements-test.txt
......@@ -111,6 +111,7 @@ venv/
ENV/
env.bak/
venv.bak/
.vscode/
# Spyder project settings
.spyderproject
......
stages:
- test
- deploy
- chart
variables:
DOCKER_TLS_CERTDIR: ""
......@@ -22,8 +23,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
......@@ -32,7 +33,18 @@ deploy:
stage: deploy
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE .
- docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
- 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
......@@ -25,34 +25,22 @@
# IN THE SOFTWARE.
#-----------------------------------------------------------------------------
FROM ubuntu:18.04
FROM python:3.8-slim
LABEL name="view server ingestor" \
vendor="EOX IT Services GmbH <https://eox.at>" \
license="MIT Copyright (C) 2020 EOX IT Services GmbH <https://eox.at>" \
type="view server ingestor"
USER root
ADD install.sh \
/
RUN /install.sh
ADD requirements.txt \
/
RUN pip3 install -r /requirements.txt
RUN mkdir /ingestor
RUN mkdir -p /var/ingestor/fail /var/ingestor/success
COPY app.py config.py filedaemon.py /
COPY ingestor/ /ingestor
ENV INSTANCE_ID="view-server_ingestor" \
REDIS_HOST="redis" \
REDIS_PORT="6379" \
REDIS_PREPROCESS_MD_QUEUE_KEY="preprocess-md_queue" \
INOTIFY_WATCH_DIR="/mnt/data" \
INOTIFY_MASKS="IN_MOVED_TO,IN_CLOSE_WRITE" \
INGESTOR_SUCCESS_DIR="/var/ingestor/success" \
INGESTOR_FAIL_DIR="/var/ingestor/fail"
vendor="EOX IT Services GmbH <https://eox.at>" \
license="MIT Copyright (C) 2020 EOX IT Services GmbH <https://eox.at>" \
type="view server ingestor"
WORKDIR /opt/ingestor
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt && \
mkdir -p /var/ingestor/fail /var/ingestor/success
COPY . .
CMD ["gunicorn", "-c", "config.py", "app"]
LABEL version="1.5.2"
LABEL version="2.0.0"
# 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-ingestor
description: A Helm chart for the View server ingestor
# 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-ingestor.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-ingestor.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-ingestor.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "vs-ingestor.labels" -}}
helm.sh/chart: {{ include "vs-ingestor.chart" . }}
{{ include "vs-ingestor.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "vs-ingestor.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vs-ingestor.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "vs-ingestor.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "vs-ingestor.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vs-ingestor.fullname" . }}
labels:
{{- include "vs-ingestor.labels" . | nindent 4 }}
app.kubernetes.io/service: ingestor
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "vs-ingestor.selectorLabels" . | nindent 6 }}
app.kubernetes.io/service: ingestor
strategy:
rollingUpdate:
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
annotations:
prometheus.io/scrape: "false"
labels:
{{- include "vs-ingestor.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: ingestor
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:
- "gunicorn"
- "-c"
- "config.py"
- "app"
env:
{{- range $key, $value := .Values.global.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: REDIS_HOST
value: {{ .Release.Name }}-redis-master
volumeMounts:
{{- range $volumes := .Values.volumeMounts }}
- {{- toYaml $volumes | nindent 16 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- range $volumes := .Values.volumes }}
- {{- toYaml $volumes | nindent 12 }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "vs-ingestor.fullname" . }}
labels:
{{- include "vs-ingestor.labels" . | nindent 4 }}
app.kubernetes.io/service: ingestor
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "vs-ingestor.selectorLabels" . | nindent 4 }}
app.kubernetes.io/service: ingestor
replicaCount: 1
nameOverride:
fullNameOverride:
image:
repository: registry.gitlab.eox.at/vs/ingestor
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: []
service:
type: ClusterIP
port: 80
resources:
limits:
cpu: 1.5
memory: 6Gi
requests:
cpu: 0.5
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 80
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
affinity: {}
volumes: []
volumeMounts: []
global:
env:
INSTANCE_ID: "view-server_ingestor"
REDIS_PORT: "6379"
REDIS_PREPROCESS_MD_QUEUE_KEY: "preprocess-md_queue"
INOTIFY_WATCH_DIR: "/mnt/data"
INOTIFY_MASKS: "IN_MOVED_TO,IN_CLOSE_WRITE"
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
bind = ['0.0.0.0:8000']
bind = ['0.0.0.0:80']
#!/bin/bash
set -eo pipefail
echo "Running install.sh"
apt update
echo "Installing packages"
DEBIAN_FRONTEND=noninteractive apt install -y python3-pip
rm -rf /var/lib/apt/lists/*
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