Skip to content

Commit 0cff8fd

Browse files
authored
Generated commit to update templated files based on rev ea8aa54 in stackabletech/operator-templating repo. (#36)
Original commit message: Added explicit extra_crates to repositories and fix Helm chart versions. (#9)
1 parent 45d7822 commit 0cff8fd

13 files changed

+481
-106
lines changed

.github/workflows/publish_dev_artifacts.yml

Lines changed: 19 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,33 @@ env:
1616
CARGO_INCREMENTAL: '0'
1717
CARGO_PROFILE_DEV_DEBUG: '0'
1818
RUSTFLAGS: "-D warnings -W rust-2021-compatibility"
19-
REPO_APT_DEV_URL: https://repo.stackable.tech/repository/deb-dev
20-
REPO_RPM_DEV_URL: https://repo.stackable.tech/repository/rpm-dev
19+
REPO_HELM_DEV_URL: https://repo.stackable.tech/repository/helm-dev
20+
CHART_TESTING_CONFIG: deploy/helm/chart-testing.yaml
2121

2222
jobs:
23-
debian10:
24-
runs-on: debian10
23+
helm:
24+
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v2.4.0
27-
- name: Change version if is PR
28-
if: ${{ github.event_name == 'pull_request' }}
29-
# We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically
30-
# sorting packages by version. This means that when installing the package without specifying a version the
31-
# nighly version is considered more current than mr versions and installed by default
32-
run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' rust/operator-binary/Cargo.toml
33-
- name: Build
34-
run: ~/.cargo/bin/cargo +nightly build --verbose --release
35-
- name: Build apt package
36-
run: ~/.cargo/bin/cargo deb --manifest-path rust/operator-binary/Cargo.toml --no-build
37-
- name: Publish apt package
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
with:
29+
fetch-depth: 0
30+
- name: Set up Helm
31+
uses: azure/setup-helm@v1
32+
with:
33+
version: v3.6.2
34+
- name: Compile chart
35+
run: make compile-chart
36+
- name: Package Chart
37+
run: mkdir -p target/helm && helm package --destination target/helm deploy/helm/${{ env.PRODUCT_NAME }}-operator
38+
- name: Publish Chart
3839
env:
3940
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
4041
if: env.NEXUS_PASSWORD != null
4142
run: >-
4243
/usr/bin/curl
4344
--fail
4445
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
45-
-H "Content-Type: multipart/form-data"
46-
--data-binary "@./$(find target/debian/ -name *.deb)"
47-
"${{ env.REPO_APT_DEV_URL }}/"
48-
- name: Clean
49-
run: ~/.cargo/bin/cargo clean
46+
--upload-file "./$(find target/helm/ -name *.tgz)"
47+
"${{ env.REPO_HELM_DEV_URL }}/"
5048
51-
centos:
52-
runs-on: centos${{ matrix.node }}
53-
strategy:
54-
matrix:
55-
node: [ 7, 8 ]
56-
steps:
57-
- uses: actions/checkout@v2.4.0
58-
- name: Change version if is PR
59-
if: ${{ github.event_name == 'pull_request' }}
60-
# We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically
61-
# sorting packages by version. This means that when installing the package without specifying a version the
62-
# nighly version is considered more current than mr versions and installed by default
63-
run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' rust/operator-binary/Cargo.toml
64-
- name: Build
65-
run: ~/.cargo/bin/cargo +nightly build --verbose --release
66-
- name: Build RPM package
67-
run: packaging/buildrpm.sh stackable-${{ env.PRODUCT_NAME }}-operator-binary stackable-${{ env.PRODUCT_NAME }}-operator
68-
- name: Publish RPM package
69-
env:
70-
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
71-
if: env.NEXUS_PASSWORD != null
72-
run: >-
73-
/usr/bin/curl
74-
--fail
75-
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
76-
--upload-file "./$(find target/rpm/RPMS/x86_64/ -name *.rpm)"
77-
"${{ env.REPO_RPM_DEV_URL }}/el${{ matrix.node }}/"
78-
- name: Clean
79-
run: ~/.cargo/bin/cargo clean

.github/workflows/publish_release_artifacts.yml

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -15,64 +15,31 @@ env:
1515
CARGO_INCREMENTAL: '0'
1616
CARGO_PROFILE_DEV_DEBUG: '0'
1717
RUSTFLAGS: "-D warnings -W rust-2021-compatibility"
18-
REPO_APT_RELEASE_URL: https://repo.stackable.tech/repository/deb-release
19-
REPO_RPM_RELEASE_URL: https://repo.stackable.tech/repository/rpm-release
18+
REPO_HELM_STABLE_URL: https://repo.stackable.tech/repository/helm-stable
19+
CT_CONFIG: deploy/helm/ct.yaml
2020

2121
jobs:
22-
debian10:
23-
runs-on: debian10
22+
helm:
23+
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v2.4.0
26-
- name: Change version if is PR
27-
if: ${{ github.event_name == 'pull_request' }}
28-
# We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically
29-
# sorting packages by version. This means that when installing the package without specifying a version the
30-
# nighly version is considered more current than mr versions and installed by default
31-
run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' rust/operator-binary/Cargo.toml
32-
- name: Build
33-
run: ~/.cargo/bin/cargo +nightly build --verbose --release
34-
- name: Build apt package
35-
run: ~/.cargo/bin/cargo deb --manifest-path rust/operator-binary/Cargo.toml --no-build
36-
- name: Publish apt package
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
with:
28+
fetch-depth: 0
29+
- name: Set up Helm
30+
uses: azure/setup-helm@v1
31+
with:
32+
version: v3.6.2
33+
- name: Compile chart
34+
run: make compile-chart
35+
- name: Package Chart
36+
run: mkdir -p target/helm && helm package --destination target/helm deploy/helm/${{ env.PRODUCT_NAME }}-operator
37+
- name: Publish Chart
3738
env:
3839
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
39-
if: env.NEXUS_PASSWORD != null
4040
run: >-
4141
/usr/bin/curl
4242
--fail
4343
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
44-
-H "Content-Type: multipart/form-data"
45-
--data-binary "@./$(find target/debian/ -name *.deb)"
46-
"${{ env.REPO_APT_RELEASE_URL }}/"
47-
- name: Clean
48-
run: ~/.cargo/bin/cargo clean
49-
50-
centos:
51-
runs-on: centos${{ matrix.node }}
52-
strategy:
53-
matrix:
54-
node: [ 7, 8 ]
55-
steps:
56-
- uses: actions/checkout@v2.4.0
57-
- name: Change version if is PR
58-
if: ${{ github.event_name == 'pull_request' }}
59-
# We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically
60-
# sorting packages by version. This means that when installing the package without specifying a version the
61-
# nighly version is considered more current than mr versions and installed by default
62-
run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' rust/operator-binary/Cargo.toml
63-
- name: Build
64-
run: ~/.cargo/bin/cargo +nightly build --verbose --release
65-
- name: Build RPM package
66-
run: packaging/buildrpm.sh stackable-${{ env.PRODUCT_NAME }}-operator-binary stackable-${{ env.PRODUCT_NAME }}-operator
67-
- name: Publish RPM package
68-
env:
69-
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
70-
if: env.NEXUS_PASSWORD != null
71-
run: >-
72-
/usr/bin/curl
73-
--fail
74-
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
75-
--upload-file "./$(find target/rpm/RPMS/x86_64/ -name *.rpm)"
76-
"${{ env.REPO_RPM_RELEASE_URL }}/el${{ matrix.node }}/"
77-
- name: Clean
78-
run: ~/.cargo/bin/cargo clean
44+
--upload-file "./$(find target/helm/ -name *.tgz)"
45+
"${{ env.REPO_HELM_STABLE_URL }}/"

Makefile

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
1-
.PHONY: docker
1+
# =============
2+
# This file is automatically generated from the templates in stackabletech/operator-templating
3+
# DON'T MANUALLY EDIT THIS FILE
4+
# =============
5+
6+
.PHONY: docker chart-lint compile-chart
27

38
TAG := $(shell git rev-parse --short HEAD)
49

10+
VERSION := $(shell cargo metadata --format-version 1 | jq '.packages[] | select(.name=="stackable-hbase-operator") | .version')
11+
512
docker:
6-
docker build --force-rm -t "docker.stackable.tech/stackable/hbase-operator:${TAG}" -t "docker.stackable.tech/stackable/hbase-operator:latest" -f docker/Dockerfile .
13+
docker build --force-rm -t "docker.stackable.tech/stackable/hbase-operator:${VERSION}" -t "docker.stackable.tech/stackable/hbase-operator:latest" -f docker/Dockerfile .
714
echo "${NEXUS_PASSWORD}" | docker login --username github --password-stdin docker.stackable.tech
815
docker push --all-tags docker.stackable.tech/stackable/hbase-operator
16+
17+
## Chart related targets
18+
compile-chart: version crds config
19+
20+
chart-clean:
21+
rm -rf deploy/helm/hbase-operator/configs
22+
rm -rf deploy/helm/hbase-operator/templates/crds.yaml
23+
24+
version:
25+
yq eval -i '.version = ${VERSION} | .appVersion = ${VERSION}' deploy/helm/hbase-operator/Chart.yaml
26+
27+
28+
config: deploy/helm/hbase-operator/configs
29+
30+
deploy/helm/hbase-operator/configs:
31+
cp -r deploy/config-spec deploy/helm/hbase-operator/configs
32+
33+
crds: deploy/helm/hbase-operator/crds/crds.yaml
34+
35+
deploy/helm/hbase-operator/crds/crds.yaml:
36+
mkdir -p deploy/helm/hbase-operator/crds
37+
cat deploy/crd/*.yaml | yq e '.metadata.annotations["helm.sh/resource-policy"]="keep"' - > ${@}
38+
39+
chart-lint: compile-chart
40+
docker run -it -v $(shell pwd):/build/helm-charts -w /build/helm-charts quay.io/helmpack/chart-testing:v3.4.0 ct lint --config deploy/helm/chart_testing.yaml

deny.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ allow = [
3434
]
3535

3636
exceptions = [
37-
{ name = "stackable-opa-crd", allow = ["OSL-3.0"] },
38-
{ name = "stackable-zookeeper-crd", allow = ["OSL-3.0"] },
3937
{ name = "stackable-hbase-crd", allow = ["OSL-3.0"] },
4038
{ name = "stackable-hbase-operator", allow = ["OSL-3.0"] },
4139
{ name = "stackable-hbase-operator-binary", allow = ["OSL-3.0"] },
4240
{ name = "stackable-hdfs-crd", allow = ["OSL-3.0"] },
41+
{ name = "stackable-zookeeper-crd", allow = ["OSL-3.0"] },
4342
]
4443

4544
[[licenses.clarify]]

deploy/helm/chart_testing.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
remote: origin
2+
target-branch: main
3+
chart-dirs:
4+
- deploy/helm
5+
all: true

deploy/helm/hbase-operator/Chart.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# =============
2+
# This file is automatically generated from the templates in stackabletech/operator-templating
3+
# DON'T MANUALLY EDIT THIS FILE
4+
# =============
5+
6+
apiVersion: v2
7+
name: hbase-operator
8+
description: The Stackable Operator for Apache HBase
9+
10+
# A chart can be either an 'application' or a 'library' chart.
11+
#
12+
# Application charts are a collection of templates that can be packaged into versioned archives
13+
# to be deployed.
14+
#
15+
# Library charts provide useful utilities or functions for the chart developer. They're included as
16+
# a dependency of application charts to inject those utilities and functions into the rendering
17+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
18+
type: application
19+
20+
maintainers:
21+
- name: stackable
22+
url: github.com/stackabletech
23+
24+
# This is the chart version. This version number should be incremented each time you make changes
25+
# to the chart and its templates, including the app version.
26+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
27+
version: <version_placeholder>
28+
29+
# This is the version number of the application being deployed. This version number should be
30+
# incremented each time you make changes to the application. Versions are not expected to
31+
# follow Semantic Versioning. They should reflect the version the application is using.
32+
# It is recommended to use it with quotes.
33+
appVersion: <version_placeholder>

deploy/helm/hbase-operator/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[]: # =============
2+
[]: # This file is automatically generated from the templates in stackabletech/operator-templating
3+
[]: # DON'T MANUALLY EDIT THIS FILE
4+
[]: # =============
5+
6+
# Helm Chart for Stackable Operator for Apache HBase
7+
8+
This Helm Chart can be used to install Custom Resource Definitions and the Operator for Apache HBase provided by Stackable.
9+
10+
11+
## Requirements
12+
13+
- Create a [Kubernetes Cluster](../Readme.md)
14+
- Install [Helm](https://helm.sh/docs/intro/install/)
15+
16+
17+
## Install the Stackble Operator for Apache HBase
18+
19+
```bash
20+
# From the root of the operator repository
21+
make compile-chart
22+
23+
helm install hbase-operator deploy/helm/hbase-operator
24+
```
25+
26+
27+
28+
29+
## Create a Apache HBase Cluster
30+
31+
as described [here](https://docs.stackable.tech/hbase/index.html)
32+
33+
34+
35+
The operator has example requests included in the [`/examples`](https://github.com/stackabletech/hbase/operator/tree/main/examples) directory that can be used to spin up a cluster.
36+
37+
38+
## Links
39+
40+
https://github.com/stackabletech/hbase-operator
41+
42+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "operator.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-operator" }}
6+
{{- end }}
7+
8+
{{/*
9+
Expand the name of the chart.
10+
*/}}
11+
{{- define "operator.appname" -}}
12+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
13+
{{- end }}
14+
15+
{{/*
16+
Create a default fully qualified app name.
17+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
18+
If release name contains chart name it will be used as a full name.
19+
*/}}
20+
{{- define "operator.fullname" -}}
21+
{{- if .Values.fullnameOverride }}
22+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
23+
{{- else }}
24+
{{- $name := default .Chart.Name .Values.nameOverride }}
25+
{{- if contains $name .Release.Name }}
26+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
27+
{{- else }}
28+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
29+
{{- end }}
30+
{{- end }}
31+
{{- end }}
32+
33+
{{/*
34+
Create chart name and version as used by the chart label.
35+
*/}}
36+
{{- define "operator.chart" -}}
37+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
38+
{{- end }}
39+
40+
{{/*
41+
Common labels
42+
*/}}
43+
{{- define "operator.labels" -}}
44+
helm.sh/chart: {{ include "operator.chart" . }}
45+
{{ include "operator.selectorLabels" . }}
46+
{{- if .Chart.AppVersion }}
47+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
48+
{{- end }}
49+
app.kubernetes.io/managed-by: {{ .Release.Service }}
50+
{{- end }}
51+
52+
{{/*
53+
Selector labels
54+
*/}}
55+
{{- define "operator.selectorLabels" -}}
56+
app.kubernetes.io/name: {{ include "operator.appname" . }}
57+
app.kubernetes.io/instance: {{ .Release.Name }}
58+
{{- end }}
59+
60+
{{/*
61+
Create the name of the service account to use
62+
*/}}
63+
{{- define "operator.serviceAccountName" -}}
64+
{{- if .Values.serviceAccount.create }}
65+
{{- default (include "operator.fullname" .) .Values.serviceAccount.name }}
66+
{{- else }}
67+
{{- default "default" .Values.serviceAccount.name }}
68+
{{- end }}
69+
{{- end }}
70+
71+
{{/*
72+
Labels for Kubernetes objects created by helm test
73+
*/}}
74+
{{- define "operator.testLabels" -}}
75+
helm.sh/test: {{ include "operator.chart" . }}
76+
{{- end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# =============
2+
# This file is automatically generated from the templates in stackabletech/operator-templating
3+
# DON'T MANUALLY EDIT THIS FILE
4+
# =============
5+
apiVersion: v1
6+
data:
7+
{{ (.Files.Glob "configs/*").AsConfig | indent 2 }}
8+
kind: ConfigMap
9+
metadata:
10+
name: {{ include "operator.fullname" . }}-configspec
11+
labels:
12+
{{- include "operator.labels" . | nindent 4 }}

0 commit comments

Comments
 (0)