Skip to content

Commit

Permalink
Merge pull request #46 from curie-data-factory/doccano
Browse files Browse the repository at this point in the history
Add postgresql as Doccano Backend
  • Loading branch information
armandleopold committed Mar 25, 2022
2 parents 0082d77 + 02dfc60 commit 0aa94bb
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 31 deletions.
2 changes: 1 addition & 1 deletion charts/bookstack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: bookstack
description: bookstack documentation platform
appVersion: "21.12.4"
version: "0.1.3"
version: 0.1.4
home: https://www.bookstackapp.com/
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/BookStack_logo.svg/225px-BookStack_logo.svg.png
maintainers:
Expand Down
6 changes: 5 additions & 1 deletion charts/doccano/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: doccano
appVersion: 1.6.2
version: 1.4.2
version: 2.0.0
description: A Helm chart for doccano, Open source text annotation tool for machine learning practitioner.
home: https://doccano.herokuapp.com/
icon: https://raw.githubusercontent.com/doccano/doccano/master/docs/images/logo/doccano.png
Expand All @@ -11,6 +11,10 @@ maintainers:
- name: armandleopold
email: [email protected]
kubeVersion: ">= 1.14.0-0"
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 11.1.9
keywords:
- annotation
- ml
Expand Down
22 changes: 22 additions & 0 deletions charts/doccano/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-conf
namespace: {{ .Release.Namespace }}
data:
bootstrap.sh: |-
#!/bin/bash
export PATH=$PATH:/home/doccano/.local/bin
# install dependency
python -m pip install doccano
python -m pip install 'doccano[postgresql]'
# Initialize database.
doccano init
# Create a super user.
doccano createuser --username admin --password {{ .Values.ADMIN_PASSWORD }}
# Start Task Thread
doccano task &
# Start web server.
doccano webserver --port 8000
37 changes: 16 additions & 21 deletions charts/doccano/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ spec:
rollme: {{ randAlphaNum 5 | quote }}
spec:
containers:
- env:
- args:
- /bin/bash
- /config/bootstrap.sh
env:
- name: ADMIN_EMAIL
value: {{ .Values.env.ADMIN_EMAIL }}
- name: ADMIN_USERNAME
Expand All @@ -36,6 +39,8 @@ spec:
key: ADMIN_PASSWORD
name: doccano-password
optional: false
- name: DATABASE_URL
value: "postgres://{{ .Values.postgresql.global.postgresql.auth.username }}:{{ .Values.postgresql.global.postgresql.auth.password }}@{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.global.postgresql.auth.database }}?sslmode=disable"
name: {{ .Values.image.name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand All @@ -46,21 +51,8 @@ spec:
volumeMounts:
- mountPath: {{ .Values.persistence.mountPath }}
name: {{ .Values.persistence.volumeName }}
{{- if .Values.dump.enabled }}
- name: {{ .Chart.Name }}-dump
image: {{ .Values.dump.image }}
imagePullPolicy: Always
{{- with .Values.dump.env }}
env:
{{ toYaml . | indent 8 }}
{{- end }}
volumeMounts:
- mountPath: {{ .Values.dump.mountPath }}
name: {{ .Values.persistence.volumeName }}
readOnly: true
- mountPath: /nfs
name: nfs-dump
{{- end }}
- mountPath: /config
name: bootstrap
initContainers:
- args:
- chown
Expand All @@ -73,14 +65,17 @@ spec:
- mountPath: {{ .Values.persistence.mountPath }}
name: {{ .Values.persistence.volumeName }}
volumes:
- configMap:
defaultMode: 0777
items:
- key: bootstrap.sh
path: ./bootstrap.sh
name: {{ .Release.Name }}-conf
optional: false
name: bootstrap
- name: {{ .Values.persistence.volumeName }}
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-{{ .Values.persistence.volumeName }}"
{{- if .Values.dump.enabled }}
- hostPath:
path: {{ .Values.dump.nfsPath }}
name: nfs-dump
{{- end }}
{{- if .Values.image.deployRegistry }}
imagePullSecrets:
- name: "{{ .Values.image.name }}-{{ .Values.image.imagePullSecrets }}"
Expand Down
17 changes: 11 additions & 6 deletions charts/doccano/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ image:
deployRegistry: false
imagePullSecrets: registrysecret
dataSecret: |-
{"auths":{"registry.company.com":{"password":"","username":""}}}
{"auths":{"registry.localhost":{"password":"","username":""}}}
env:
ADMIN_EMAIL: admin@company.com
ADMIN_EMAIL: admin@localhost
ADMIN_USERNAME: admin

deploySecret: true
Expand All @@ -25,10 +25,10 @@ ingress:
enabled: true
path: /
hostnames:
- doccano.company.com
- doccano.localhost
tls:
- hosts:
- doccano.company.com
- doccano.localhost
secretName: doccano

persistence:
Expand All @@ -42,5 +42,10 @@ persistence:
annotations:
helm.sh/resource-policy: keep

dump:
enabled: false
postgresql:
global:
postgresql:
auth:
database: doccano
username: doccano
password: 58sdf9hgd1gs8sdfzerJHFdf
2 changes: 1 addition & 1 deletion charts/gitlabmonitor/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: gitlab-monitor
description: A web-based monitor dashboard for GitLab CI
appVersion: "1.7"
version: 1.3.0
version: 1.3.1
home: https://github.com/timoschwarzer/gitlab-monitor
icon: https://i.ibb.co/vVys3Yt/logo.png
sources:
Expand Down
3 changes: 2 additions & 1 deletion charts/gitlabmonitor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: GITLAB_MONITOR_CONFIG
value: | {{ .Values.config | trim | nindent 12 }}
value: |-
{{ .Values.config | trim | nindent 12 }}
ports:
- containerPort: {{ .Values.service.targetPort }}
name: {{ .Values.service.targetPort }}{{ .Values.service.protocol | lower }}
Expand Down

0 comments on commit 0aa94bb

Please sign in to comment.