diff --git a/stable/burrow/Chart.yaml b/stable/burrow/Chart.yaml index be8a026d48..6245bc9eb1 100644 --- a/stable/burrow/Chart.yaml +++ b/stable/burrow/Chart.yaml @@ -1,6 +1,6 @@ name: burrow -version: 1.0.6 -appVersion: 0.24.3 +version: 1.1.0 +appVersion: 0.24.6 description: Burrow is a permissionable smart contract machine home: https://github.com/hyperledger/burrow icon: https://raw.githubusercontent.com/hyperledger/burrow/develop/docs/assets/images/burrow.png diff --git a/stable/burrow/README.md b/stable/burrow/README.md index 6228303bfa..db240fbaca 100644 --- a/stable/burrow/README.md +++ b/stable/burrow/README.md @@ -52,12 +52,16 @@ The following table lists the configurable parameters of the Burrow chart and it | Parameter | Description | Default | | --------- | ----------- | ------- | | `image.repository` | image repository | `"hyperledger/burrow"` | -| `image.tag` | image tag | `"0.24.3"` | +| `image.tag` | image tag | `"0.24.6"` | | `image.pullPolicy` | image pull policy | `"IfNotPresent"` | | `chain.nodes` | number of nodes for the blockchain network | `1` | | `chain.logLevel` | log level for the nodes (`debug`, `info`, `warn`) | `"info"` | | `chain.extraSeeds` | network seeds to dial in addition to the cluster booted by the chart; each entry in the array should be in the form `ip:port` (note: because P2P connects over tcp, the port is absolutely required) | `[]` | | `chain.testing` | toggle pre-generated keys & genesis for ci testing | `false` | +| `contracts.enabled` | toggle post-install contract deployment | `false` | +| `contracts.image` | contract deployer image | `""` | +| `contracts.tag` | contract deployer tag | `""` | +| `contracts.deploy` | command to run in post-install hook | `""` | | `validatorAddresses` | list of validators to deploy | `[]` | | `env` | environment variables to configure burrow | `{}` | | `extraArgs` | extra arguments to give to the build in `burrow start` command | `{}` | diff --git a/stable/burrow/templates/_settings.yaml b/stable/burrow/templates/_settings.yaml new file mode 100644 index 0000000000..3909893726 --- /dev/null +++ b/stable/burrow/templates/_settings.yaml @@ -0,0 +1,13 @@ +{{- define "settings" -}} +{{- range $.Values.environment.secrets }} +- name: {{ .name }} + valueFrom: + secretKeyRef: + name: {{ .location }} + key: {{ .key }} +{{- end }} +{{- range $key, $val := $.Values.environment.inline }} +- name: {{ $key }} + value: {{ $val | quote }} +{{- end }} +{{- end -}} diff --git a/stable/burrow/templates/contracts.yaml b/stable/burrow/templates/contracts.yaml new file mode 100644 index 0000000000..218f34cab6 --- /dev/null +++ b/stable/burrow/templates/contracts.yaml @@ -0,0 +1,53 @@ +{{- if .Values.contracts.enabled }} +{{- $refDir := printf "/ref" }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template "burrow.fullname" $ }}-contracts + namespace: {{ $.Release.Namespace | quote }} + labels: + app: {{ template "burrow.name" $ }} + chart: {{ template "burrow.chart" $ }} + heritage: {{ $.Release.Service }} + release: {{ $.Release.Name }} + annotations: + "helm.sh/hook": "post-install" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded +spec: + template: + spec: + # we always want burrow & solc installed + initContainers: + - name: burrow + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + command: ['sh', '-c', 'cp /usr/local/bin/* /tmp'] + volumeMounts: + - name: bin + mountPath: /tmp + containers: + - name: contracts-deploy + image: "{{ .Values.contracts.image }}:{{ $.Values.contracts.tag }}" + imagePullPolicy: Always + volumeMounts: + - name: bin + mountPath: /usr/local/bin/ + - mountPath: {{ $refDir }} + name: ref-dir + env: + - name: CHAIN_URL_GRPC + value: {{ template "burrow.fullname" $ }}-grpc:{{ .Values.rpcGRPC.service.port }} +{{- include "settings" . | indent 8 }} + command: ["/bin/sh", "-c", "{{ .Values.contracts.deploy }}"] + restartPolicy: Never + volumes: + - name: bin + emptyDir: {} + - name: ref-dir + projected: + sources: + - configMap: + name: {{ template "burrow.fullname" $ }}-config + - configMap: + name: {{ template "burrow.fullname" $ }}-genesis + backoffLimit: 0 +{{- end }} \ No newline at end of file diff --git a/stable/burrow/templates/deployments.yaml b/stable/burrow/templates/deployments.yaml index 79c06eeddc..93c4034d86 100644 --- a/stable/burrow/templates/deployments.yaml +++ b/stable/burrow/templates/deployments.yaml @@ -85,10 +85,7 @@ spec: - --{{ $key }}={{ $value }} {{- end }} env: -{{- range $key, $value := $.Values.env }} - - name: "{{ $key }}" - value: "{{ $value }}" -{{- end }} +{{- include "settings" $ | indent 10 }} volumeMounts: - mountPath: {{ $refDir }} name: ref-dir diff --git a/stable/burrow/values.yaml b/stable/burrow/values.yaml index b3e9a3b53a..6a8df4c0a9 100644 --- a/stable/burrow/values.yaml +++ b/stable/burrow/values.yaml @@ -1,6 +1,6 @@ image: repository: hyperledger/burrow - tag: 0.24.3 + tag: 0.24.6 pullPolicy: IfNotPresent chain: @@ -23,8 +23,17 @@ validatorAddresses: Address: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA NodeAddress: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -env: {} +contracts: + # wait required to ensure chain readiness + enabled: false + image: "" + tag: "" + deploy: "" + extraArgs: {} +environment: + inline: {} + secrets: [] organization: "user"