forked from uhh-lt/cam
-
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.
- Loading branch information
1 parent
6382d12
commit 25de6bf
Showing
15 changed files
with
235 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,3 @@ | ||
**/requirements.lock | ||
**/requirements.yaml.bak | ||
**/*.tgz |
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,23 @@ | ||
# 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/ |
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,21 @@ | ||
apiVersion: v2 | ||
name: cam | ||
description: "CAM: The Comparative Argument Machine" | ||
type: application | ||
home: https://demo.webis.de/cam/ | ||
sources: | ||
- https://github.com/webis-de/cam | ||
icon: https://assets.webis.de/img/webis-logo-gray.svg | ||
maintainers: # (optional) | ||
- name: Jan Heinrich Reimer | ||
email: [email protected] | ||
- name: Alexander Bondarenko | ||
email: [email protected] | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. | ||
appVersion: 0.1.0 | ||
|
||
# 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. | ||
version: 0.1.0 |
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,3 @@ | ||
# CAM: The Comparative Argument Machine | ||
|
||
Helm chart for installing CAM on a Kubernetes cluster. |
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,4 @@ | ||
# TODO: Add instructions on how to get service IP addresses. | ||
|
||
# You may overwrite the `{{ .Release.Name }}-elasticsearch-login` secret: | ||
kubectl create secret generic {{ .Release.Name }}-elasticsearch-login --from-literal=username=USERNAME --from-literal=password=PASSWORD |
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,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Release.Name }}-backend-config-map | ||
data: | ||
config.json: | | ||
{ | ||
"use_heuristics": {{ .Values.backend.useHeuristics }}, | ||
"elasticsearch": { | ||
"url": "https://{{ .Values.elasticsearch.host }}:{{ .Values.elasticsearch.port }}", | ||
"index_arguments": "{{ .Values.elasticsearch.indices.arguments }}" | ||
"index_suggestions": "{{ .Values.elasticsearch.indices.suggestions }}" | ||
} | ||
} |
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,54 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: {{ .Release.Name }}-backend | ||
name: {{ .Release.Name }}-backend | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ .Release.Name }}-backend | ||
replicas: {{ .Values.backend.replicas }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Release.Name }}-backend | ||
spec: | ||
containers: | ||
- name: {{ .Release.Name }}-backend | ||
image: {{ .Values.backend.image }} | ||
resources: | ||
requests: | ||
memory: 15Gi | ||
env: | ||
- name: ES_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Release.Name }}-elasticsearch-login | ||
key: username | ||
- name: ES_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Release.Name }}-elasticsearch-login | ||
key: password | ||
volumeMounts: | ||
- name: {{ .Release.Name }}-backend-models | ||
mountPath: /app/data/glove.840B.300d.txt | ||
subPath: glove.840B.300d.txt | ||
readOnly: true | ||
- name: {{ .Release.Name }}-backend-models | ||
mountPath: /app/data/infersent.allnli.pickle | ||
subPath: infersent.allnli.pickle | ||
readOnly: true | ||
- name: {{ .Release.Name }}-backend-config | ||
mountPath: /app/config.json | ||
subPath: config.json | ||
restartPolicy: Always | ||
volumes: | ||
- name: {{ .Release.Name }}-backend-models | ||
hostPath: | ||
path: {{ .Values.backend.modelsPath }} | ||
type: Directory | ||
- name: {{ .Release.Name }}-backend-config | ||
configMap: | ||
name: {{ .Release.Name }}-backend-config-map |
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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Release.Name }}-backend | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: {{ .Release.Name }}-backend | ||
ports: | ||
- nodePort: {{ .Values.backend.port }} | ||
port: 5000 | ||
targetPort: 5000 |
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,8 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ .Release.Name }}-elasticsearch-login | ||
type: Opaque | ||
data: | ||
username: {{ b64enc .Values.elasticsearch.username }} | ||
password: {{ b64enc .Values.elasticsearch.password }} |
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,11 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Release.Name }}-frontend-config-map | ||
data: | ||
environment.ts: | | ||
export const environment = { | ||
production: true, | ||
apiUrl: '{{ .Values.backend.url }}cam', | ||
suggestionsElasticsearchUrl: '{{ .Values.backend.url }}suggestions' | ||
}; |
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,28 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
service: {{ .Release.Name }}-frontend | ||
name: {{ .Release.Name }}-frontend | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ .Release.Name }}-frontend | ||
replicas: {{ .Values.frontend.replicas }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Release.Name }}-frontend | ||
spec: | ||
containers: | ||
- name: {{ .Release.Name }}-frontend | ||
image: {{ .Values.frontend.image }} | ||
volumeMounts: | ||
- name: {{ .Release.Name }}-frontend-config | ||
mountPath: /usr/src/app/src/environments/environment.ts | ||
subPath: environment.ts | ||
restartPolicy: Always | ||
volumes: | ||
- name: {{ .Release.Name }}-frontend-config | ||
configMap: | ||
name: {{ .Release.Name }}-frontend-config-map |
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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Release.Name }}-frontend | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: {{ .Release.Name }}-frontend | ||
ports: | ||
- nodePort: {{ .Values.frontend.port }} | ||
port: 4200 | ||
targetPort: 4200 |
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,8 @@ | ||
# ToDo's for Kubernetes/Helm deployment | ||
|
||
- [x] Fix Docker images locally. | ||
- [x] Frontend | ||
- [x] Backend | ||
- [x] Publish Docker images (e.g. to the [GitHub Package registry](https://github.com/features/packages) or [Docker Hub](https://hub.docker.com)). | ||
- [ ] Improve Kubernetes configurability | ||
- [ ] Setup [GitHub Actions](https://github.com/features/actions) for automatic deployments. |
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,27 @@ | ||
# Default values for CAM. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
frontend: | ||
# url: https://demo.webis.de/cam/ | ||
port: 30294 | ||
image: webis/cam-frontend:0.1.3 | ||
replicas: 3 | ||
|
||
backend: | ||
url: https://demo.webis.de/cam-api/ | ||
port: 30293 | ||
image: webis/cam-backend:0.1.3 | ||
replicas: 3 | ||
# Paths of models on each host's file system. | ||
modelsPath: /mnt/ceph/storage/data-in-progress/cam/models/ | ||
useHeuristics: true | ||
|
||
elasticsearch: | ||
host: betaweb001.bw.webis.de | ||
port: 30920 | ||
username: "" # Override username with `--set elasticsearch.username=EXAMPLE` Helm option. | ||
password: "" # Override username with `--set elasticsearch.password=EXAMPLE` Helm option. | ||
indices: | ||
arguments: depcc | ||
suggestions: suggestions-index |
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,7 @@ | ||
#!/bin/bash | ||
|
||
# Print Helm template. | ||
helm template cam cam --set elasticsearch.username=reader --set elasticsearch.password=reader | ||
|
||
# Install Helm chart. | ||
helm install cam cam --set elasticsearch.username=reader --set elasticsearch.password=reader |