From a8209fc9e793ad1edca4f0faa0687d839ecfd9cd Mon Sep 17 00:00:00 2001 From: David Montemayor Date: Mon, 11 Nov 2024 13:32:46 -0800 Subject: [PATCH 1/3] chore: pull helm chart upon release to remove duplication To reduce confusion between public helm chart and the internal one, we'll update the release workflow to pull the version specified in version.txt from artifactory and use its NOTES.txt file for the release notes. Additionally, this removes the dependency on the chart-releaser-action, which had some rough edges that required explicitly ignoring error conditions and manually push gh-pages. This also obviates the need to download previous releases to generate the index.yaml file (this was going to be increasingly slower, and was already hitting GitHub API limits). Instead, we will manually pull the helm chart from artifactory, take the previous index.yaml from gh-pages, and merge it with the newest contents. --- .github/workflows/release.yml | 70 ++--- .gitignore | 3 +- charts/sxt-node-chart/Chart.yaml | 35 --- charts/sxt-node-chart/LICENSE | 202 -------------- charts/sxt-node-chart/templates/_helpers.tpl | 62 ----- .../templates/sxt-node-ext4-csi-tuned.yaml | 21 -- .../templates/sxt-node-flightsql-service.yaml | 21 -- .../sxt-node-jsonrpc-internal-service.yaml | 22 -- .../templates/sxt-node-jsonrpc-service.yaml | 22 -- .../templates/sxt-node-p2p-tcp-svc.yaml | 20 -- .../templates/sxt-node-p2p-udp-svc.yaml | 20 -- .../templates/sxt-node-statefulset.yaml | 257 ------------------ charts/sxt-node-chart/values.yaml | 85 ------ version.txt | 1 + 14 files changed, 39 insertions(+), 802 deletions(-) delete mode 100644 charts/sxt-node-chart/Chart.yaml delete mode 100644 charts/sxt-node-chart/LICENSE delete mode 100644 charts/sxt-node-chart/templates/_helpers.tpl delete mode 100644 charts/sxt-node-chart/templates/sxt-node-ext4-csi-tuned.yaml delete mode 100644 charts/sxt-node-chart/templates/sxt-node-flightsql-service.yaml delete mode 100644 charts/sxt-node-chart/templates/sxt-node-jsonrpc-internal-service.yaml delete mode 100644 charts/sxt-node-chart/templates/sxt-node-jsonrpc-service.yaml delete mode 100644 charts/sxt-node-chart/templates/sxt-node-p2p-tcp-svc.yaml delete mode 100644 charts/sxt-node-chart/templates/sxt-node-p2p-udp-svc.yaml delete mode 100644 charts/sxt-node-chart/templates/sxt-node-statefulset.yaml delete mode 100644 charts/sxt-node-chart/values.yaml create mode 100644 version.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d8b5354..1428160 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,8 @@ on: push: branches: - main + paths: + - version.txt permissions: write-all @@ -21,8 +23,7 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config - persist-credentials: false + persist-credentials: true # Pull all previous tags fetch-depth: 0 fetch-tags: true @@ -32,46 +33,47 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: Conventional Changelog Action - id: conventional-changelog - uses: TriPSs/conventional-changelog-action@v5 - with: - github-token: ${{ secrets.GH_TOKEN }} - skip-git-pull: true - skip-version-file: false - version-file: charts/sxt-node-chart/Chart.yaml - git-push: true - skip-on-empty: false # Always create commit - tag-prefix: "" #remove the 'v' prefix in tag - - name: Install Helm uses: azure/setup-helm@v1 with: version: v3.14.4 - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 - continue-on-error: true + - name: Pull Helm Chart + run: | + helm repo add sxt-charts-central https://spaceandtime.jfrog.io/artifactory/api/helm/sxt-charts-central --username ${{secrets.ARTIFACTORY_USER}} --password ${{secrets.ARTIFACTORY_API_KEY}} + version=$(cat version.txt) + mkdir -p .cr-release-packages/$version + helm pull sxt-charts-central/sxt-node-chart --version $version --destination .cr-release-packages/$version + mkdir -p charts + tar xf .cr-release-packages/$version/sxt-node-chart-$version.tgz -C charts + touch charts/sxt-node-chart/templates/NOTES.txt + echo "version=$version" >> $GITHUB_ENV + + - name: Create Release + uses: ncipollo/release-action@v1 with: - charts_dir: charts - env: - CR_TOKEN: "${{ secrets.GH_TOKEN }}" + tag: ${{ env.version }} + bodyFile: charts/sxt-node-chart/templates/NOTES.txt + token: ${{ secrets.GH_TOKEN }} + makeLatest: true + artifacts: ".cr-release-packages/${{ env.version }}/*.tgz" + artifactErrorsFailBuild: true + - name: Continue chart-release - env: - CR_TOKEN: "${{ secrets.GH_TOKEN }}" run: | - mkdir -p .cr-index .cr-release-packages - # download index.yaml or start as empty .. the index.yaml needs to be placed inside .cr-index/ - curl --fail https://spaceandtimelabs.github.io/sxt-node-chart-repo/index.yaml -o .cr-index/index.yaml || touch .cr-index/index.yaml - # download all known release packages, the packages needs to be placed inside .cr-release-packages/ - curl --fail -L -H "Authorization: token $CR_TOKEN" https://api.github.com/repos/spaceandtimelabs/sxt-node-chart-repo/releases | jq -r '.[].assets[] | (.name, .url)' | xargs -n 2 | while read name url; do - curl --fail -L -H "Authorization: token $CR_TOKEN" -H 'Accept: application/octet-stream' $url -o .cr-release-packages/$name - file .cr-release-packages/${i}.tgz |grep "gzip compressed data" || rm -f .cr-release-packages/${i}.tgz - done - # cr command.. will fail - cr index --owner "spaceandtimelabs" --git-repo sxt-node-chart-repo || cat .cr-index/index.yaml - git checkout -t origin/gh-pages - mv .cr-index/index.yaml index.yaml + set -x + if git rev-parse --verify --quiet origin/gh-pages:index.yaml; then + git cat-file -p origin/gh-pages:index.yaml > .cr-release-packages/index.yaml + fi + + if [ -e .cr-release-packages/index.yaml ]; then + helm repo index .cr-release-packages --url "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download" --merge .cr-release-packages/index.yaml + else + helm repo index .cr-release-packages --url "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download" + fi + + git switch -t origin/gh-pages || git switch --orphan gh-pages + mv .cr-release-packages/index.yaml index.yaml git add index.yaml git commit -m "update index.yaml" git push origin HEAD diff --git a/.gitignore b/.gitignore index ed5ec06..8509492 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.cr-*/* +.cr-*/ +/charts/ diff --git a/charts/sxt-node-chart/Chart.yaml b/charts/sxt-node-chart/Chart.yaml deleted file mode 100644 index b7bd780..0000000 --- a/charts/sxt-node-chart/Chart.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: v2 -name: sxt-node-chart -description: SXT-Node Testnet Helm Chart - -dependencies: - - name: ingress-nginx - condition: ingress-nginx.enabled - version: "4.11.1" - repository: https://kubernetes.github.io/ingress-nginx - - - name: external-dns - condition: external-dns.enabled - version: "1.15.0" - repository: https://kubernetes-sigs.github.io/external-dns/ - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# 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. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/charts/sxt-node-chart/LICENSE b/charts/sxt-node-chart/LICENSE deleted file mode 100644 index d645695..0000000 --- a/charts/sxt-node-chart/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/charts/sxt-node-chart/templates/_helpers.tpl b/charts/sxt-node-chart/templates/_helpers.tpl deleted file mode 100644 index 2cc2451..0000000 --- a/charts/sxt-node-chart/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "sxt-node-chart.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "sxt-node-chart.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "sxt-node-chart.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "sxt-node-chart.labels" -}} -helm.sh/chart: {{ include "sxt-node-chart.chart" . }} -{{ include "sxt-node-chart.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "sxt-node-chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "sxt-node-chart.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "sxt-node-chart.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "sxt-node-chart.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/charts/sxt-node-chart/templates/sxt-node-ext4-csi-tuned.yaml b/charts/sxt-node-chart/templates/sxt-node-ext4-csi-tuned.yaml deleted file mode 100644 index 76bcedc..0000000 --- a/charts/sxt-node-chart/templates/sxt-node-ext4-csi-tuned.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{ $enableTunedCSI := .Values.tunedCSI }} -{{- if ne .Values.useDefaultStorageClass false }} -{{ $enableTunedCSI = false }} -{{- end }} -{{- if $enableTunedCSI -}} ---- -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: sxt-node-ext4-csi-tuned -provisioner: disk.csi.azure.com -parameters: - skuName: PremiumV2_LRS - fsType: ext4 - DiskIOPSReadWrite: "16000" - DiskMBpsReadWrite: "1200" - cachingMode: "None" -reclaimPolicy: Retain -volumeBindingMode: WaitForFirstConsumer -allowVolumeExpansion: true -{{- end }} diff --git a/charts/sxt-node-chart/templates/sxt-node-flightsql-service.yaml b/charts/sxt-node-chart/templates/sxt-node-flightsql-service.yaml deleted file mode 100644 index 2169acb..0000000 --- a/charts/sxt-node-chart/templates/sxt-node-flightsql-service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- if eq .Values.sxt.flightSQL.exposed true -}} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.sxt.flightSQL.name }} - annotations: - service.beta.kubernetes.io/azure-load-balancer-internal: "true" - service.beta.kubernetes.io/azure-load-balancer-ipv4: {{ .Values.sxt.flightSQL.ipaddr }} - service.beta.kubernetes.io/azure-load-balancer-internal-subnet: {{ .Values.sxt.flightSQL.subnet }} - service.beta.kubernetes.io/azure-load-balancer-resource-group: {{ .Values.sxt.flightSQL.resourceGroup }} -spec: - type: LoadBalancer - externalTrafficPolicy: Local - selector: - statefulset.kubernetes.io/pod-name: sxt-node-0 - ports: - - protocol: TCP - port: 50555 - targetPort: 50555 -{{- end }} diff --git a/charts/sxt-node-chart/templates/sxt-node-jsonrpc-internal-service.yaml b/charts/sxt-node-chart/templates/sxt-node-jsonrpc-internal-service.yaml deleted file mode 100644 index 7ab334a..0000000 --- a/charts/sxt-node-chart/templates/sxt-node-jsonrpc-internal-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if eq .Values.sxt.internalService.enabled true -}} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.sxt.internalService.name }} - annotations: -{{- range $env_key, $env_value := .Values.sxt.internalService.annotations }} - {{ $env_key }}: "{{ $env_value }}" -{{- end }} -spec: - type: {{ .Values.sxt.internalService.type }} - selector: -{{- range $env_key, $env_value := .Values.sxt.internalService.selectors }} - {{ $env_key }}: "{{ $env_value }}" -{{- end }} - ports: - - name: rpc - protocol: TCP - port: {{ .Values.sxt.rpcPort }} - targetPort: {{ .Values.sxt.rpcPort }} -{{- end }} diff --git a/charts/sxt-node-chart/templates/sxt-node-jsonrpc-service.yaml b/charts/sxt-node-chart/templates/sxt-node-jsonrpc-service.yaml deleted file mode 100644 index 564599e..0000000 --- a/charts/sxt-node-chart/templates/sxt-node-jsonrpc-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if eq .Values.sxt.service.enabled true -}} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.sxt.service.name }} - annotations: -{{- range $env_key, $env_value := .Values.sxt.service.annotations }} - {{ $env_key }}: "{{ $env_value }}" -{{- end }} -spec: - type: {{ .Values.sxt.service.type }} - selector: -{{- range $env_key, $env_value := .Values.sxt.service.selectors }} - {{ $env_key }}: "{{ $env_value }}" -{{- end }} - ports: - - name: rpc - protocol: TCP - port: {{ .Values.sxt.rpcPort }} - targetPort: {{ .Values.sxt.rpcPort }} -{{- end }} diff --git a/charts/sxt-node-chart/templates/sxt-node-p2p-tcp-svc.yaml b/charts/sxt-node-chart/templates/sxt-node-p2p-tcp-svc.yaml deleted file mode 100644 index 1f1ba65..0000000 --- a/charts/sxt-node-chart/templates/sxt-node-p2p-tcp-svc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if .Values.sxt.p2pService }} -{{ $svcname := "sxtnode-p2p-tcp-service" }} -{{ $appname := "sxt-node" }} -{{- if ne .Values.sxt.nameSuffix nil -}} -{{ $svcname = printf "sxtnode-p2p-tcp-service-%s" .Values.sxt.nameSuffix }} -{{ $appname = printf "sxt-node-%s" .Values.sxt.nameSuffix }} -{{- end -}} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ $svcname }} -spec: - selector: - statefulset.kubernetes.io/pod-name: "{{ $appname }}-0" - ports: - - protocol: TCP - port: {{ .Values.sxt.p2pLbPort }} - targetPort: {{ .Values.sxt.port }} -{{- end }} diff --git a/charts/sxt-node-chart/templates/sxt-node-p2p-udp-svc.yaml b/charts/sxt-node-chart/templates/sxt-node-p2p-udp-svc.yaml deleted file mode 100644 index aaaaedc..0000000 --- a/charts/sxt-node-chart/templates/sxt-node-p2p-udp-svc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if .Values.sxt.p2pService }} -{{ $svcname := "sxtnode-p2p-udp-service" }} -{{ $appname := "sxt-node" }} -{{- if .Values.sxt.nameSuffix -}} -{{ $svcname = printf "sxtnode-p2p-udp-service-%s" .Values.sxt.nameSuffix }} -{{ $appname = printf "sxt-node-%s" .Values.sxt.nameSuffix }} -{{- end -}} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ $svcname }} -spec: - selector: - statefulset.kubernetes.io/pod-name: "{{ $appname }}-0" - ports: - - protocol: UDP - port: {{ .Values.sxt.p2pLbPort }} - targetPort: {{ .Values.sxt.port }} -{{- end }} diff --git a/charts/sxt-node-chart/templates/sxt-node-statefulset.yaml b/charts/sxt-node-chart/templates/sxt-node-statefulset.yaml deleted file mode 100644 index 715ea2f..0000000 --- a/charts/sxt-node-chart/templates/sxt-node-statefulset.yaml +++ /dev/null @@ -1,257 +0,0 @@ -{{ $storageDir := "/storage" }} -{{ $initDirList := "/storage/data /storage/keys /storage/pgdata /storage/pgdbdata /storage/logs /storage/sxtuser" }} -{{ $appname := "sxt-node" }} -{{ $pvcname := "azuredisk" }} -{{ $customDBPasswords := false }} -{{- if eq .Values.sxt.isValidator true }} -{{- if ne .Values.sxt.dbsecret nil }} -{{ $customDBPasswords = true }} -{{- end }} -{{- end }} -{{- if ne .Values.useDefaultStorageClass false }} -{{ $pvcname = "storagedisk" }} -{{- end }} -{{ $chainspec := .Values.networkID }} -{{- if ne .Values.sxt.genesisPath nil -}} -{{ $chainspec = .Values.sxt.genesisPath }} -{{- end -}} -{{- if ne .Values.sxt.nameSuffix nil -}} -{{ $appname = printf "sxt-node-%s" .Values.sxt.nameSuffix }} -{{ $pvcname = printf "%s-%s" $pvcname .Values.sxt.nameSuffix }} -{{- end -}} ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ $pvcname }} -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: {{ .Values.sxt.resources.storage }} -{{- if ne .Values.useDefaultStorageClass true }} - storageClassName: sxt-node-ext4-csi-tuned -{{- end }} -{{- if .Values.sxt.useExistingPV -}} - volumeName: {{ .Values.sxt.existingPV }} -{{- end }} ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - labels: - app: "sxt-node" - name: {{ $appname }} -spec: - persistentVolumeClaimRetentionPolicy: - whenDeleted: Retain - whenScaled: Retain - replicas: {{ .Values.sxt.replicaCount }} - revisionHistoryLimit: 5 - selector: - matchLabels: - app: "sxt-node" - serviceName: {{ $appname }} - template: - metadata: - annotations: - labels: - app: "sxt-node" - spec: - securityContext: - fsGroup: 1001 - nodeSelector: -{{- range $env_key, $env_value := .Values.sxt.nodeSelectors }} - {{ $env_key }}: "{{ $env_value }}" -{{- end }} - initContainers: - - name: mkdir - command: - - /bin/bash - - -c - - >- - mkdir -p {{ $initDirList }}; - chmod 700 {{ $storageDir }}/pgdata /pg_data; - image: "{{ .Values.sxt.image.repository }}:{{ default .Chart.AppVersion .Values.sxt.image.tag }}" - imagePullPolicy: {{ .Values.sxt.image.pullPolicy }} - volumeMounts: - - mountPath: {{ $storageDir }} - name: acsdisk -{{- if .Values.sxt.isValidator }} - - name: mkkey - command: - - /bin/bash - - -c - - >- - cd "{{ $storageDir }}/keys"; - /usr/local/bin/sxt-node key insert --scheme sr25519 --keystore-path {{ $storageDir }}/keys --chain {{ $chainspec }} --key-type aura --suri ${SECRET_SEED}; - /usr/local/bin/sxt-node key insert --scheme ed25519 --keystore-path {{ $storageDir }}/keys --chain {{ $chainspec }} --key-type gran --suri ${SECRET_SEED}; - echo -n "${NODE_KEY}" > {{ $storageDir }}/keys/node_key - env: - - name: SECRET_SEED - valueFrom: - secretKeyRef: - name: {{ .Values.sxt.secret.name }} - key: {{ .Values.sxt.secret.key }} - - name: NODE_KEY - valueFrom: - secretKeyRef: - name: {{ .Values.sxt.secret.name }} - key: {{ .Values.sxt.secret.nodeKey }} - image: "{{ .Values.sxt.image.repository }}:{{ default .Chart.AppVersion .Values.sxt.image.tag }}" - imagePullPolicy: {{ .Values.sxt.image.pullPolicy }} - volumeMounts: - - mountPath: {{ $storageDir }} - name: acsdisk -{{- end }} - containers: - - command: -{{- if not .Values.sxt.manual }} - - /opt/sxtnode.sh - - --base-path - - "{{ $storageDir }}/data" - - --prometheus-port - - "9615" - - --pool-limit - - "10240" - - --pool-kbytes - - "1024000" -{{- range .Values.sxt.bootnodes }} - - --bootnodes - - {{ . | quote }} -{{- end }} - - --log - - "info" -{{- if ne .Values.networkID "dev" }} - - --chain - - "{{ .Values.sxt.genesisPath }}" -{{- end }} -{{- if .Values.sxt.isValidator -}} -{{- if eq .Values.networkID "dev" }} - - --dev - - --alice -{{- else }} - - --keystore-path - - "{{ $storageDir }}/keys" - - --node-key-file - - "{{ $storageDir }}/keys/node_key" -{{- end -}} -{{- end }} - - --port - - "{{ .Values.sxt.port }}" -{{- if .Values.sxt.isValidator }} - - --validator -{{- if .Values.sxt.isDatabase }} - - --with-db -{{- end -}} -{{- end }} -{{- if .Values.sxt.isRpcNode }} - - --rpc-rate-limit - - "{{ .Values.sxt.rpc.rate }}" - - --rpc-external - - --rpc-methods - - "{{ .Values.sxt.rpc.methods }}" - - --rpc-port - - "{{ .Values.sxt.rpc.port }}" - - --rpc-max-connections - - "{{ .Values.sxt.rpc.maxConnections }}" - - --rpc-max-request-size - - "{{ .Values.sxt.rpc.maxRequestSize }}" - - --rpc-max-response-size - - "{{ .Values.sxt.rpc.maxResponseSize }}" - - --rpc-cors - - "all" -{{- end }} -{{- else }} - - /bin/bash - - -c - - >- - while true; do - echo "manual debugging"; sleep 1; - done -{{- end }} -{{- if .Values.sxt.restartOnFailure }} - livenessProbe: - exec: - command: - - pgrep - - sxt-node - initialDelaySeconds: 180 - periodSeconds: 5 -{{- end }} - env: - - name: RUST_BACKTRACE - value: "1" - - name: RUST_LOG - value: "info" -{{- if eq $customDBPasswords true }} - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Values.sxt.dbsecret.name }} - key: {{ .Values.sxt.dbsecret.pgkey }} - - name: FLIGHTSQL_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Values.sxt.dbsecret.name }} - key: {{ .Values.sxt.dbsecret.fsqlkey }} - - name: DATABASE_URL - valueFrom: - secretKeyRef: - name: {{ .Values.sxt.dbsecret.name }} - key: {{ .Values.sxt.dbsecret.pgurlkey }} -{{- end }} -{{- if .Values.sxt.flightSQL.exposed }} - - name: FLIGHTSQL_HOST - value: "0.0.0.0" - - name: FLIGHTSQL_PORT - value: "50555" - - name: HOST - value: "0.0.0.0" - - name: PORT - value: "50555" -{{- end }} - image: "{{ .Values.sxt.image.repository }}:{{ default .Chart.AppVersion .Values.sxt.image.tag }}" - imagePullPolicy: {{ .Values.sxt.image.pullPolicy }} - name: alice - ports: - - containerPort: {{ .Values.sxt.port }} - protocol: TCP - - containerPort: {{ .Values.sxt.port }} - protocol: UDP -{{- if .Values.sxt.isRpcNode }} - - containerPort: {{ .Values.sxt.rpcPort }} - protocol: TCP -{{- end }} -{{- if .Values.sxt.flightSQL.exposed }} - - containerPort: 50555 - protocol: TCP -{{- end }} - resources: - requests: - cpu: {{ .Values.sxt.resources.cpu }} - memory: {{ .Values.sxt.resources.memory }} - volumeMounts: - - mountPath: {{ $storageDir }} - name: acsdisk - - mountPath: /data - name: acsdisk - subPath: pgdbdata - - mountPath: /pg_data - name: acsdisk - subPath: pgdata - - mountPath: /logs - name: acsdisk - subPath: logs - - mountPath: /sxtuser - name: acsdisk - subPath: sxtuser - restartPolicy: Always - terminationGracePeriodSeconds: 180 - imagePullSecrets: - - name: {{ .Values.imageRegistryCredentials }} - volumes: - - name: acsdisk - persistentVolumeClaim: - claimName: {{ $pvcname }} diff --git a/charts/sxt-node-chart/values.yaml b/charts/sxt-node-chart/values.yaml deleted file mode 100644 index ae13071..0000000 --- a/charts/sxt-node-chart/values.yaml +++ /dev/null @@ -1,85 +0,0 @@ -# Default values for sxt-tx-node. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -networkID: dev -imageRegistryCredentials: -tunedCSI: true -useDefaultStorageClass: false - -sxt: - replicaCount: 1 - nameSuffix: - restartOnFailure: true - useExistingPV: false - isValidator: true - isDatabase: false - isRpcNode: false - flightSQL: - enabled: false - name: sxt-node-flightsql-svc - ipaddr: - subnet: - resourceGroup: - existingPV: - manual: false - image: - repository: ghcr.io/spaceandtimelabs/sxt-node - pullPolicy: IfNotPresent - tag: "testnet-0.45.1" - p2pService: true - port: 30333 - rpc: - port: 9944 - rate: 250 - methods: "safe" - maxConnections: 10000 - maxRequestSize: 1024 - maxResponseSize: 1024 - p2pLbPort: 30333 - genesisPath: - bootnodes: - - /dns/bootnode0.testnet.sxt.network/tcp/30333/p2p/12D3KooWDV5kmYUR5nxruFBfdGX2ZMR43iSe3SfmopZ3sLBFvZzc - - /dns/bootnode1.testnet.sxt.network/tcp/30333/p2p/12D3KooWGAQAg7iZgyn8wnnT8nkDo9NVAPbfubpMgL1mYTRNgjdD - - /dns/bootnode2.testnet.sxt.network/tcp/30333/p2p/12D3KooWLLf8tW3PPbj9MCda9rfypNN5xyZRi1bKoLj8s9UkeJDZ - secret: - name: "validatorseed" - key: "Secret-Seed" - nodeKey: "Node-Key" -# This only needed when sxt.isDatabase is set to true -# dbsecret: -# name: "sxt-db-passwords" -# pgkey: "PGDB_PASSWORD" -# fsqlkey: "FSQL_PASSWORD" -# pgurlkey: "PGDB_URL" - service: - enabled: false - name: sxt-node-jsonrpc-svc - ipaddr: - subnet: - resourceGroup: - selectors: {} - type: LoadBalancer - annotations: {} - internalService: - enabled: false - name: sxt-node-jsonrpc-svc-internal - selectors: {} - type: LoadBalancer - annotations: {} - nodeSelectors: - agentpool: archive1 - resources: - storage: 1Ti - cpu: 13000m - memory: 24G - -ingress-nginx: - enabled: false - nameOverride: "sxtnode-p2p-lb-nginx" - fullnameOverride: "sxtnode-p2p-lb-nginx" - -external-dns: - enabled: false - nameOverride: "external-dns-cloudflare" - fullnameOverride: "external-dns-cloudflare" diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..4b9fcbe --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.5.1 From a6b3cdfb8bff40e718bb7bf0383f7ba4f176cb2c Mon Sep 17 00:00:00 2001 From: David Montemayor Date: Tue, 12 Nov 2024 14:44:12 -0800 Subject: [PATCH 2/3] chore: remove preview-release workflow This calculated the next version based in commits in the repository but that's no longer used for the release, no we use version.txt and the release notes from the chart. --- .github/workflows/preview-release.yml | 55 --------------------------- 1 file changed, 55 deletions(-) delete mode 100644 .github/workflows/preview-release.yml diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml deleted file mode 100644 index e6c3837..0000000 --- a/.github/workflows/preview-release.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Preview Release -on: - pull_request: - branches: - - main - -jobs: - release-preview: - name: Preview Release - - runs-on: ubuntu-latest - - permissions: - contents: read - pull-requests: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config - persist-credentials: false - # Pull all previous tags - fetch-depth: 0 - fetch-tags: true - - - name: Conventional Changelog Action - id: conventional-changelog - uses: TriPSs/conventional-changelog-action@v5 - with: - github-token: ${{ steps.app-token.outputs.token }} - skip-git-pull: true - skip-version-file: true - git-push: false - skip-commit: true - skip-tag: true - output-file: false - skip-on-empty: false # Always create commit - tag-prefix: "" #remove the 'v' prefix in tag - - - name: Format Changelog - id: format-changelog - run: | - echo "${{ steps.conventional-changelog.outputs.changelog }}" > step-changes.md - { - echo 'changelog<> "$GITHUB_OUTPUT" - - - name: Add PR Comment - uses: mshick/add-pr-comment@v2 - with: - message: ${{ steps.format-changelog.outputs.changelog }} From 40defa730a10cfa1f0b3d6a2077c75dc78dec53b Mon Sep 17 00:00:00 2001 From: David Montemayor Date: Thu, 14 Nov 2024 15:17:03 -0800 Subject: [PATCH 3/3] chore: update to chart version 0.6.0 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 4b9fcbe..a918a2a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.5.1 +0.6.0