diff --git a/charts/machinaris/1.0.0/.helmignore b/charts/machinaris/1.0.0/.helmignore new file mode 100644 index 0000000000..a9fe727881 --- /dev/null +++ b/charts/machinaris/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/charts/machinaris/1.0.0/Chart.yaml b/charts/machinaris/1.0.0/Chart.yaml new file mode 100644 index 0000000000..bbe91624b7 --- /dev/null +++ b/charts/machinaris/1.0.0/Chart.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +appVersion: v1.2.3 +dependencies: +- name: common + repository: file://../../../library/common/2105.0.0 + version: 2105.0.0 +description: Global, Versioned, peer-to-peer filesystem. +home: https://github.com/guydavis/machinaris +icon: https://raw.githubusercontent.com/guydavis/machinaris/main/web/static/favicon.ico +keywords: +- storage +- crypto +- blockchain +name: machinaris +sources: +- https://github.com/guydavis/machinaris +version: 1.0.0 diff --git a/charts/machinaris/1.0.0/README.md b/charts/machinaris/1.0.0/README.md new file mode 100755 index 0000000000..613aec890d --- /dev/null +++ b/charts/machinaris/1.0.0/README.md @@ -0,0 +1,9 @@ +Machinaris +===== + +[MACHINARIS](https://github.com/guydavis/machinaris) is an easy-to-use WebUI for Chia plotting and farming. Includes Chia, Plotman, MadMax, Chiadog, and Flax in a single Docker image. + +Introduction +------------ + +This chart bootstraps MACHINARIS deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. diff --git a/charts/machinaris/1.0.0/app-readme.md b/charts/machinaris/1.0.0/app-readme.md new file mode 100644 index 0000000000..0e815a115c --- /dev/null +++ b/charts/machinaris/1.0.0/app-readme.md @@ -0,0 +1,4 @@ +Machinaris +===== + +[MACHINARIS](https://github.com/guydavis/machinaris) is an easy-to-use WebUI for Chia plotting and farming. Includes Chia, Plotman, MadMax, Chiadog, and Flax in a single Docker image. diff --git a/charts/machinaris/1.0.0/charts/common-2105.0.0.tgz b/charts/machinaris/1.0.0/charts/common-2105.0.0.tgz new file mode 100644 index 0000000000..ef6f820efb Binary files /dev/null and b/charts/machinaris/1.0.0/charts/common-2105.0.0.tgz differ diff --git a/charts/machinaris/1.0.0/ix_values.yaml b/charts/machinaris/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..3312566406 --- /dev/null +++ b/charts/machinaris/1.0.0/ix_values.yaml @@ -0,0 +1,5 @@ +image: + pullPolicy: IfNotPresent + repository: ghcr.io/guydavis/machinaris + tag: v0.5.1 +updateStrategy: Recreate diff --git a/charts/machinaris/1.0.0/questions.yaml b/charts/machinaris/1.0.0/questions.yaml new file mode 100644 index 0000000000..f186d981ff --- /dev/null +++ b/charts/machinaris/1.0.0/questions.yaml @@ -0,0 +1,159 @@ +groups: + - name: "Networking" + description: "Configure Networking for Machinaris" + - name: "Machinaris Configuration" + description: "Machinaris configuration" + - name: "Storage" + description: "Configure Storage for Machinaris" + - name: "Machinaris Environment Variables" + description: "Set the environment that will be visible to the container" + +portals: + web_portal: + protocols: + - "http" + host: + - "$node_ip" + ports: + - "$variable-machinaris_ui_port" + +questions: + - variable: timezone + label: "Configure timezone" + group: "Machinaris Configuration" + description: "Configure timezone for machinaris" + schema: + type: string + $ref: + - "definitions/timezone" + - variable: machinaris_ui_port + label: "Machinaris Web UI" + group: "Networking" + description: "Web UI Port for Machinaris" + schema: + type: int + min: 9000 + max: 65535 + default: 9003 + - variable: appVolumeMounts + label: "Machinaris 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: "/root/.chia" + - variable: hostPathEnabled + label: "Enable Custom Host Path for Machinaris Configuration Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Machinaris 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 Machinaris Plots Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Machinaris Plots Volume" + schema: + type: hostpath + required: true + + - variable: extraAppVolumeMounts + label: "Machinaris Extra Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: extraAppVolume + label: "Machinaris Host Path Volume" + description: "Add an extra host path volume for machinaris 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 Machinaris" + group: "Machinaris 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/charts/machinaris/1.0.0/requirements.lock b/charts/machinaris/1.0.0/requirements.lock new file mode 100644 index 0000000000..eba13d88bf --- /dev/null +++ b/charts/machinaris/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/charts/machinaris/1.0.0/templates/deployment.yaml b/charts/machinaris/1.0.0/templates/deployment.yaml new file mode 100644 index 0000000000..60aceb7326 --- /dev/null +++ b/charts/machinaris/1.0.0/templates/deployment.yaml @@ -0,0 +1,42 @@ +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 + - name: machinaris-ui + protocol: TCP + containerPort: 8926 + {{ $envList := (default list .Values.environmentVariables) }} + {{ $envList = mustAppend $envList (dict "name" "TZ" "value" $.Values.timezone) }} + {{ 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/charts/machinaris/1.0.0/templates/service.yaml b/charts/machinaris/1.0.0/templates/service.yaml new file mode 100644 index 0000000000..bc10f57869 --- /dev/null +++ b/charts/machinaris/1.0.0/templates/service.yaml @@ -0,0 +1,6 @@ +{{ $svc := .Values }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "pms" "port" $svc.machinaris_ui_port "nodePort" $svc.machinaris_ui_port "targetPort" "machinaris-ui") }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "ports" $ports "type" "NodePort" ) }} +{{ include "common.classes.service" $params }} diff --git a/charts/machinaris/1.0.0/test_values.yaml b/charts/machinaris/1.0.0/test_values.yaml new file mode 100644 index 0000000000..baead8e556 --- /dev/null +++ b/charts/machinaris/1.0.0/test_values.yaml @@ -0,0 +1,14 @@ +appVolumeMounts: + config: + emptyDir: true + mountPath: /data + plots: + emptyDir: true + mountPath: /plots +timezone: 'America/Edmonton' +image: + pullPolicy: IfNotPresent + repository: ghcr.io/guydavis/machinaris + tag: v0.5.1 +updateStrategy: Recreate +machinaris_ui_port: 9003 diff --git a/charts/machinaris/item.yaml b/charts/machinaris/item.yaml new file mode 100644 index 0000000000..26ee7a8040 --- /dev/null +++ b/charts/machinaris/item.yaml @@ -0,0 +1,4 @@ +categories: + - storage + - crypto +icon_url: https://raw.githubusercontent.com/guydavis/machinaris/main/web/static/favicon.ico diff --git a/charts/machinaris/upgrade_info.json b/charts/machinaris/upgrade_info.json new file mode 100644 index 0000000000..f22ddd1aee --- /dev/null +++ b/charts/machinaris/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "ix_values.yaml", "keys": ["image"], "test_filename": "test_values.yaml"} diff --git a/charts/machinaris/upgrade_strategy b/charts/machinaris/upgrade_strategy new file mode 100755 index 0000000000..6b95867d8d --- /dev/null +++ b/charts/machinaris/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]))))