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 0000000000..ef6f820efb Binary files /dev/null and b/test/collabora/1.0.0/charts/common-2105.0.0.tgz differ 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]))))