From 0146ba39a7f9dda764c4a03b7160b45d2ef1e475 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Wed, 8 Sep 2021 13:20:37 +0500 Subject: [PATCH] Add initial collabora app --- test/collabora/1.0.0/.helmignore | 23 +++ test/collabora/1.0.0/Chart.yaml | 18 ++ test/collabora/1.0.0/README.md | 8 + test/collabora/1.0.0/app-readme.md | 4 + .../1.0.0/charts/common-2105.0.0.tgz | Bin 0 -> 4288 bytes test/collabora/1.0.0/ix_values.yaml | 5 + test/collabora/1.0.0/questions.yaml | 155 ++++++++++++++++++ test/collabora/1.0.0/requirements.lock | 6 + .../collabora/1.0.0/templates/deployment.yaml | 40 +++++ test/collabora/1.0.0/test_values.yaml | 13 ++ test/collabora/item.yaml | 5 + test/collabora/upgrade_info.json | 1 + test/collabora/upgrade_strategy | 25 +++ 13 files changed, 303 insertions(+) create mode 100644 test/collabora/1.0.0/.helmignore create mode 100644 test/collabora/1.0.0/Chart.yaml create mode 100755 test/collabora/1.0.0/README.md create mode 100644 test/collabora/1.0.0/app-readme.md create mode 100644 test/collabora/1.0.0/charts/common-2105.0.0.tgz create mode 100644 test/collabora/1.0.0/ix_values.yaml create mode 100644 test/collabora/1.0.0/questions.yaml create mode 100644 test/collabora/1.0.0/requirements.lock create mode 100644 test/collabora/1.0.0/templates/deployment.yaml create mode 100644 test/collabora/1.0.0/test_values.yaml create mode 100644 test/collabora/item.yaml create mode 100644 test/collabora/upgrade_info.json create mode 100755 test/collabora/upgrade_strategy diff --git a/test/collabora/1.0.0/.helmignore b/test/collabora/1.0.0/.helmignore new file mode 100644 index 0000000000..a9fe727881 --- /dev/null +++ b/test/collabora/1.0.0/.helmignore @@ -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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +# OWNERS file for Kubernetes +OWNERS \ No newline at end of file diff --git a/test/collabora/1.0.0/Chart.yaml b/test/collabora/1.0.0/Chart.yaml new file mode 100644 index 0000000000..6a30daa2c3 --- /dev/null +++ b/test/collabora/1.0.0/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +appVersion: 6.4.10.10 +dependencies: +- name: common + repository: file://../../../library/common/2105.0.0 + version: 2105.0.0 +description: Global, Versioned, peer-to-peer filesystem. +home: https://www.chia.net/ +icon: https://www.chia.net/img/chia_logo.svg +keywords: +- office +- documents +- productivity +name: collabora +sources: +- https://github.com/CollaboraOnline/online.git +- https://hub.docker.com/r/collabora/code +version: 1.0.0 diff --git a/test/collabora/1.0.0/README.md b/test/collabora/1.0.0/README.md new file mode 100755 index 0000000000..d93ffcf19f --- /dev/null +++ b/test/collabora/1.0.0/README.md @@ -0,0 +1,8 @@ +Chia Network +===== + +[CHIA](https://www.chia.net/) is a new blockchain and smart transaction platform that is easier to use, more efficient, and secure. +Introduction +------------ + +This chart bootstraps CHIA deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. diff --git a/test/collabora/1.0.0/app-readme.md b/test/collabora/1.0.0/app-readme.md new file mode 100644 index 0000000000..18679e8cdf --- /dev/null +++ b/test/collabora/1.0.0/app-readme.md @@ -0,0 +1,4 @@ +Collabora +===== + +[CHIA](https://www.chia.net/) is a new blockchain and smart transaction platform that is easier to use, more efficient, and secure. diff --git a/test/collabora/1.0.0/charts/common-2105.0.0.tgz b/test/collabora/1.0.0/charts/common-2105.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..ef6f820efb63f7b71b04a313be6b82dee84585b7 GIT binary patch literal 4288 zcmV;x5I^r9iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<$Z`-(*{j6VcR_)-%-HH5&lPm%Zu-PPcCTJ%Onr!bKEEWM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;9exrwYc=FJNH#jrE#%6+XHJkrY)0;9|Mw=3tqH zThGI9cDet~*@XPlfC)>S8t(>Ne4c)d16IFcsqd7WT8!5VhdH!Snl^Fw7m?}~qvp)o zr9viJJD;|;2!#Z<%b_H*q@S@Ug*L6orl(jRQ}NJ6YS8-YFWT2Ohkm%S-2NvYEvG!` z{g3sToB|Kz#feUO2O$ zn%}1kB~SY~X_p9h^S{DyLFdxasQPmq z#!CL*+pququfxvv{+ErE=WvOn#GGnJpP>M_8)FKCoTLe%BgjyEi$+*P!E?}ufyqT9bo4WDoFYl4*vOHx9?>Lt4it|JKksB556MTIn7{P!Z>5!;wXqtuWqg+<2ZN@_O`NjCs&XVE`n%8WLy7h&<~=)|M9l|*Hw&1ZS{|P z6jRzR0S!=mn`ba2`nX>t?y}%zG(fk(%ScYtZ^p?ec=`Xqb9je1VYz_w(=!o78E5Zt zEQ5$77`07v&fW*nRKzU7?Qfj*b+P>a_U!od_p@k{JjEC*<3F7_{_kwh|7@l_hu8Lx z`kgHMqkgJRHwc24FaL4;_Tv2F*CV+8?feQ(emj194d+*I@#Y$SKRdp-hU+)*UuSTB zadmzC`t{iLeK?c#2b&0mXL?tz3tj^ajmsNy{k& iFxMjT=zEZJ+p;a&vMt+EE&mDt0RR8cdYzpBdH?`mlXJfS literal 0 HcmV?d00001 diff --git a/test/collabora/1.0.0/ix_values.yaml b/test/collabora/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..5120e01acf --- /dev/null +++ b/test/collabora/1.0.0/ix_values.yaml @@ -0,0 +1,5 @@ +image: + pullPolicy: IfNotPresent + repository: collabora/code + tag: 6.4.10.10 +updateStrategy: Recreate diff --git a/test/collabora/1.0.0/questions.yaml b/test/collabora/1.0.0/questions.yaml new file mode 100644 index 0000000000..d2e2e71a7b --- /dev/null +++ b/test/collabora/1.0.0/questions.yaml @@ -0,0 +1,155 @@ +groups: + - name: "Storage" + description: "Configure Storage for Chia" + - name: "Farmr.net Configuration" + description: "Configure farmr.net support" + - name: "Chia Environment Variables" + description: "Set the environment that will be visible to the container" + +portals: + web_portal: + protocols: + - "https" + host: + - "www.truepool.io" + ports: + - "443" + path: "/kb/truepool-docker-image/" + +questions: + - variable: farmr_env + label: "Enable 'farmr.net' support" + group: "Farmr.net Configuration" + description: "Configure 'farmr.net' support for chia" + schema: + type: string + default: "off" + enum: + - value: "off" + description: "OFF" + - value: "farmer" + description: "FARMER" + - value: "harvester" + description: "HARVESTER" + - variable: appVolumeMounts + label: "Chia Storage" + group: "Storage" + schema: + type: dict + attrs: + - variable: config + label: "Configuration Volume" + schema: + type: dict + attrs: + - variable: datasetName + label: "Configuration Volume Dataset Name" + schema: + type: string + hidden: true + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "config" + editable: false + - variable: mountPath + label: "Configuration Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + hidden: true + editable: true + default: "/data" + - variable: hostPathEnabled + label: "Enable Custom Host Path for Chia Configuration Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Chia Configuration Volume" + schema: + type: hostpath + required: true + - variable: plots + label: "Plot Volume" + schema: + type: dict + attrs: + - variable: datasetName + label: "Plots Volume Name" + schema: + type: string + hidden: true + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "plots" + editable: false + - variable: mountPath + label: "Plots Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + hidden: true + editable: false + default: "/plots" + - variable: hostPathEnabled + label: "Enable Custom Host Path for Chia Plots Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Chia Plots Volume" + schema: + type: hostpath + required: true + + - variable: extraAppVolumeMounts + label: "Chia Extra Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: extraAppVolume + label: "Chia Host Path Volume" + description: "Add an extra host path volume for chia application" + schema: + type: dict + attrs: + - variable: mountPath + label: "Mount Path in Pod" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + required: true + - variable: hostPath + label: "Host Path" + description: "Host path" + schema: + type: hostpath + required: true + + - variable: environmentVariables + label: "Environment Variables for Chia" + group: "Chia Environment Variables" + schema: + type: list + default: [] + items: + - variable: environmentVariable + label: "Environment Variable" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string diff --git a/test/collabora/1.0.0/requirements.lock b/test/collabora/1.0.0/requirements.lock new file mode 100644 index 0000000000..eba13d88bf --- /dev/null +++ b/test/collabora/1.0.0/requirements.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../library/common/2105.0.0 + version: 2105.0.0 +digest: sha256:11522ab36487826700d7ad0f86f713a4bb5d35248014bcef690fe94acbc09ef6 +generated: "2021-05-17T18:26:46.201544+05:00" diff --git a/test/collabora/1.0.0/templates/deployment.yaml b/test/collabora/1.0.0/templates/deployment.yaml new file mode 100644 index 0000000000..83eb2a02c6 --- /dev/null +++ b/test/collabora/1.0.0/templates/deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} +kind: Deployment +metadata: + name: {{ template "common.names.fullname" . }} + labels: {{ include "common.labels" . | nindent 4 }} +spec: + strategy: + type: {{ .Values.updateStrategy }} + selector: + matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }} + template: + metadata: + name: {{ template "common.names.fullname" . }} + labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} + spec: + # FIXME: Let's please remove hostnetwork when upstream hostport issue is sorted out with kube-router + hostNetwork: true + containers: + - name: {{ .Chart.Name }} + {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + mountPath: {{ $hostPathConfiguration.mountPath }} + {{ end }} + ports: + - name: chia-network + protocol: TCP + containerPort: 8444 + hostPort: 8444 + {{ $envList := (default list .Values.environmentVariables) }} + {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }} + {{ $envList = mustAppend $envList (dict "name" "farmr" "value" $.Values.farmr_env) }} + {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} + {{ end }} diff --git a/test/collabora/1.0.0/test_values.yaml b/test/collabora/1.0.0/test_values.yaml new file mode 100644 index 0000000000..f31037979d --- /dev/null +++ b/test/collabora/1.0.0/test_values.yaml @@ -0,0 +1,13 @@ +appVolumeMounts: + data: + emptyDir: true + mountPath: /data + staging: + emptyDir: true + mountPath: /plots +image: + pullPolicy: IfNotPresent + repository: collabora/code + tag: 6.4.10.10 +updateStrategy: Recreate + diff --git a/test/collabora/item.yaml b/test/collabora/item.yaml new file mode 100644 index 0000000000..1e6ded9124 --- /dev/null +++ b/test/collabora/item.yaml @@ -0,0 +1,5 @@ +categories: + - office + - documents + - productivity +icon_url: https://avatars.githubusercontent.com/u/22418908?s=200&v=4 diff --git a/test/collabora/upgrade_info.json b/test/collabora/upgrade_info.json new file mode 100644 index 0000000000..f22ddd1aee --- /dev/null +++ b/test/collabora/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "ix_values.yaml", "keys": ["image"], "test_filename": "test_values.yaml"} diff --git a/test/collabora/upgrade_strategy b/test/collabora/upgrade_strategy new file mode 100755 index 0000000000..6b95867d8d --- /dev/null +++ b/test/collabora/upgrade_strategy @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +import json +import sys + +from catalog_update.upgrade_strategy import semantic_versioning + + +def newer_mapping(image_tags): + key = list(image_tags.keys())[0] + tags = {t.strip('v').replace('_', '.'): t for t in image_tags[key]} + version = semantic_versioning(image_tags[key]) + if not version: + return {} + + return { + 'tags': {key: tags[version]}, + 'app_version': tags[version], + } + + +if __name__ == '__main__': + if len(sys.argv) != 2: + exit(1) + + print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))