Skip to content

Commit

Permalink
Merge branch 'main' into chore/fix-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nayutah authored Apr 12, 2023
2 parents 428223d + f126115 commit 2dac306
Show file tree
Hide file tree
Showing 532 changed files with 16,325 additions and 17,737 deletions.
47 changes: 47 additions & 0 deletions .github/utils/feature_triage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

REMOTE_URL=$(git config --get remote.origin.url)
OWNER=$(dirname ${REMOTE_URL} | awk -F ":" '{print $2}')
REPO=$(basename -s .git ${REMOTE_URL})
MILESTONE_ID=${MILESTONE_ID:-5}

# GH list issues API ref: https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues
ISSUE_LIST=$(gh api \
--header 'Accept: application/vnd.github+json' \
--method GET \
/repos/${OWNER}/${REPO}/issues \
-F per_page=100 \
-f milestone=${MILESTONE_ID} \
-f labels=kind/feature \
-f state=all)

ROWS=$(echo ${ISSUE_LIST}| jq -r '. | sort_by(.state,.number)| .[].number')


printf "%s | %s | %s | %s | %s | %s\n" "Feature Title" "Assignees" "Issue State" "Code PR Merge Status" "Feature Doc. Status" "Extra Notes"
echo "---|---|---|---|---|---"
for ROW in $ROWS
do
ISSUE_ID=$(echo $ROW | awk -F "," '{print $1}')
# GH get issue API ref: https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#get-an-issue
ISSUE_BODY=$(gh api \
--header 'Accept: application/vnd.github+json' \
--method GET \
/repos/${OWNER}/${REPO}/issues/${ISSUE_ID})
URL=$(echo $ISSUE_BODY| jq -r '.url')
TITLE=$(echo $ISSUE_BODY| jq -r '.title')
ASSIGNEES=$(echo $ISSUE_BODY| jq -r '.assignees[]?.login')
ASSIGNEES_PRINTABLE=
for ASSIGNEE in $ASSIGNEES
do
ASSIGNEES_PRINTABLE="${ASSIGNEES_PRINTABLE},${ASSIGNEE}"
done
ASSIGNEES_PRINTABLE=${ASSIGNEES_PRINTABLE#,}
STATE=$(echo $ISSUE_BODY| jq -r '.state')
PR=$(echo $ISSUE_BODY| jq -r '.pull_request?.url')
printf "[%s](%s) #%s | %s | %s | | | \n" "$TITLE" $URL $ISSUE_ID "$ASSIGNEES_PRINTABLE" "$STATE"
done
1 change: 0 additions & 1 deletion .github/utils/get_release_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
githubEnv.write("WITH_RELEASE_NOTES=true\n")
else:
print("{} is not found".format(releaseNotePath))
sys.exit(1)
print("Release build from {} ...".format(gitRef))

githubEnv.write("REL_VERSION={}\n".format(releaseVersion))
2 changes: 1 addition & 1 deletion .github/workflows/cicd-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
name: check helm
needs: trigger-mode
if: needs.trigger-mode.outputs.trigger-mode == '[deploy]'
uses: apecloud/apecd/.github/workflows/[email protected].0
uses: apecloud/apecd/.github/workflows/[email protected].2
with:
MAKE_OPS: "bump-chart-ver"
VERSION: "v0.4.0-check"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cicd-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
check-helm:
needs: trigger-mode
if: ${{ contains(needs.trigger-mode.outputs.trigger-mode, '[deploy]') && github.ref_name != 'main' }}
uses: apecloud/apecd/.github/workflows/[email protected].0
uses: apecloud/apecd/.github/workflows/[email protected].2
with:
MAKE_OPS: "bump-chart-ver"
VERSION: "v0.4.0-check"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
release-chart:
needs: chart-version
uses: apecloud/apecd/.github/workflows/[email protected].0
uses: apecloud/apecd/.github/workflows/[email protected].2
with:
MAKE_OPS: "bump-chart-ver"
VERSION: "${{ needs.chart-version.outputs.chart-version }}"
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/release-image-lb.yml

This file was deleted.

59 changes: 34 additions & 25 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,35 +67,46 @@ jobs:
uses: bruceadams/[email protected]

- name: make build
env:
CLI_BINARY: ${{ env.CLI_NAME }}-${{ matrix.os }}-${{ env.TAG_NAME }}.tar.gz
run: |
mkdir -p ${{ matrix.os }}
run: |
CLI_OS_ARCH=`bash ${{ github.workspace }}/.github/utils/utils.sh \
--tag-name ${{ matrix.os }} \
--type 2`
RELEASE_VERSION=`bash ${{ github.workspace }}/.github/utils/utils.sh \
--tag-name ${{ env.TAG_NAME }} \
--type 1`
--type 1`
VERSION=$RELEASE_VERSION make bin/${{ env.CLI_NAME }}.$CLI_OS_ARCH
mv bin/${{ env.CLI_NAME }}.$CLI_OS_ARCH ${{ matrix.os }}/${{ env.CLI_NAME }}
tar -zcvf ${{ env.CLI_BINARY }} ${{ matrix.os }}
mv ${{ env.CLI_BINARY }} bin/
mkdir -p ${{ matrix.os }}
echo "CLI_OS_ARCH=${CLI_OS_ARCH}" >> $GITHUB_ENV
echo "CLI_FILENAME=${{ env.CLI_NAME }}-${{ matrix.os }}-${{ env.TAG_NAME }}" >> $GITHUB_ENV
echo "CLI_DIR=${{ matrix.os }}" >> $GITHUB_ENV
- name: make zip
if: matrix.os == 'windows-amd64'
run: |
mv bin/${{ env.CLI_NAME }}.${{ env.CLI_OS_ARCH }} ${{ matrix.os }}/${{ env.CLI_NAME }}.exe
zip -r -o ${{ env.CLI_FILENAME }}.zip ${{ env.CLI_DIR }}
file ${{ env.CLI_FILENAME }}.zip # for debug
mv ${{ env.CLI_FILENAME }}.zip bin/
echo "ASSET_NAME=${{ env.CLI_FILENAME }}.zip" >> $GITHUB_ENV
echo "ASSET_CONTENT_TYPE=application/zip" >> $GITHUB_ENV
- name: make tar
if: matrix.os != 'windows-amd64'
run: |
mv bin/${{ env.CLI_NAME }}.${{ env.CLI_OS_ARCH }} ${{ matrix.os }}/${{ env.CLI_NAME }}
tar -zcvf ${{ env.CLI_FILENAME }}.tar.gz ${{ env.CLI_DIR }}
file ${{ env.CLI_FILENAME }}.tar.gz # for debug
mv ${{ env.CLI_FILENAME }}.tar.gz bin/
echo "ASSET_NAME=${{ env.CLI_FILENAME }}.tar.gz" >> $GITHUB_ENV
echo "ASSET_CONTENT_TYPE=application/gzip" >> $GITHUB_ENV
- name: upload release asset ${{ matrix.os }}
uses: actions/upload-release-asset@main
env:
CLI_BINARY: ${{ env.CLI_NAME }}-${{ matrix.os }}-${{ env.TAG_NAME }}.tar.gz
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./bin/${{ env.CLI_BINARY }}
asset_name: ${{ env.CLI_BINARY }}
asset_content_type: application/zip
asset_path: ./bin/${{ env.ASSET_NAME }}
asset_name: ${{ env.ASSET_NAME }}
asset_content_type: ${{ env.ASSET_CONTENT_TYPE }}

- name: get release kbcli upload url
run: |
Expand All @@ -107,13 +118,11 @@ jobs:
- name: upload release kbcli asset ${{ matrix.os }}
uses: actions/upload-release-asset@main
env:
CLI_BINARY: ${{ env.CLI_NAME }}-${{ matrix.os }}-${{ env.TAG_NAME }}.tar.gz
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./bin/${{ env.CLI_BINARY }}
asset_name: ${{ env.CLI_BINARY }}
asset_content_type: application/zip
asset_path: ./bin/${{ env.ASSET_NAME }}
asset_name: ${{ env.ASSET_NAME }}
asset_content_type: ${{ env.ASSET_CONTENT_TYPE }}

- name: upload gitlab kbcli asset ${{ matrix.os }}
env:
Expand All @@ -123,6 +132,6 @@ jobs:
--type 2 \
--project-id ${{ env.GITLAB_KBCLI_PROJECT_ID }} \
--tag-name ${{ env.TAG_NAME }} \
--asset-path ./bin/${{ env.CLI_BINARY }} \
--asset-name ${{ env.CLI_BINARY }} \
--asset-path ./bin/${{ env.ASSET_NAME }} \
--asset-name ${{ env.ASSET_NAME }} \
--access-token ${{ secrets.GITLAB_ACCESS_TOKEN }}
47 changes: 25 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

.PHONY: all
all: manager kbcli probe reloader loadbalancer ## Make all cmd binaries.
all: manager kbcli probe reloader ## Make all cmd binaries.

##@ Development

Expand All @@ -121,7 +121,6 @@ manifests: test-go-generate controller-gen ## Generate WebhookConfiguration, Clu
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:generateEmbeddedObjectMeta=true webhook paths="./cmd/manager/...;./apis/...;./controllers/...;./internal/..." output:crd:artifacts:config=config/crd/bases
@cp config/crd/bases/* $(CHART_PATH)/crds
@cp config/rbac/role.yaml $(CHART_PATH)/config/rbac/role.yaml
$(CONTROLLER_GEN) rbac:roleName=loadbalancer-role paths="./cmd/loadbalancer/..." output:dir=config/loadbalancer

.PHONY: preflight-manifests
preflight-manifests: generate ## Generate external Preflight API
Expand Down Expand Up @@ -158,20 +157,20 @@ cue-fmt: cuetool ## Run cue fmt against code.
git ls-files --exclude-standard | grep "\.cue$$" | xargs $(CUE) fmt
git ls-files --exclude-standard | grep "\.cue$$" | xargs $(CUE) fix

.PHONY: fast-lint
fast-lint: golangci staticcheck vet # [INTERNAL] fast lint
.PHONY: lint-fast
lint-fast: golangci staticcheck vet # [INTERNAL] fast lint
$(GOLANGCILINT) run ./...

.PHONY: lint
lint: test-go-generate generate ## Run golangci-lint against code.
$(MAKE) fast-lint
$(MAKE) lint-fast

.PHONY: staticcheck
staticcheck: staticchecktool ## Run staticcheck against code.
$(STATICCHECK) ./...

.PHONY: build-checks
build-checks: generate fmt vet goimports fast-lint ## Run build checks.
build-checks: generate fmt vet goimports lint-fast ## Run build checks.

.PHONY: mod-download
mod-download: ## Run go mod download against go modules.
Expand Down Expand Up @@ -270,7 +269,6 @@ kbcli-doc: generate ## generate CLI command reference manual.
$(GO) run ./hack/docgen/cli/main.go ./docs/user_docs/cli



##@ Operator Controller Manager

.PHONY: manager
Expand Down Expand Up @@ -302,8 +300,6 @@ ARGUMENTS=
DEBUG_PORT=2345
run-delve: manifests generate fmt vet ## Run Delve debugger.
dlv --listen=:$(DEBUG_PORT) --headless=true --api-version=2 --accept-multiclient debug $(GO_PACKAGE) -- $(ARGUMENTS)


##@ Deployment

ifndef ignore-not-found
Expand All @@ -313,12 +309,10 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
($(KUSTOMIZE) build config/crd | kubectl replace -f -) || ($(KUSTOMIZE) build config/crd | kubectl create -f -)
$(KUSTOMIZE) build $(shell $(GO) env GOPATH)/pkg/mod/github.com/kubernetes-csi/external-snapshotter/client/[email protected]/config/crd | kubectl apply -f -

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
$(KUSTOMIZE) build $(shell $(GO) env GOPATH)/pkg/mod/github.com/kubernetes-csi/external-snapshotter/client/[email protected]/config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
Expand Down Expand Up @@ -357,18 +351,26 @@ fix-license-header: ## Run license header fix.

##@ Helm Chart Tasks

bump-single-chart-appver.%: chart=$(word 2,$(subst ., ,$@))
bump-single-chart-appver.%:
ifeq ($(GOOS), darwin)
sed -i '' "s/^appVersion:.*/appVersion: $(VERSION)/" deploy/$(chart)/Chart.yaml
else
sed -i "s/^appVersion:.*/appVersion: $(VERSION)/" deploy/$(chart)/Chart.yaml
endif

bump-single-chart-ver.%: chart=$(word 2,$(subst ., ,$@))
bump-single-chart-ver.%:
ifeq ($(GOOS), darwin)
sed -i '' "s/^version:.*/version: $(VERSION)/" deploy/$(chart)/Chart.yaml
sed -i '' "s/^appVersion:.*/appVersion: $(VERSION)/" deploy/$(chart)/Chart.yaml
else
sed -i "s/^version:.*/version: $(VERSION)/" deploy/$(chart)/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: $(VERSION)/" deploy/$(chart)/Chart.yaml
endif

.PHONY: bump-chart-ver
bump-chart-ver: bump-single-chart-ver.helm \
bump-chart-ver: \
bump-single-chart-ver.helm \
bump-single-chart-appver.helm \
bump-single-chart-ver.apecloud-mysql \
bump-single-chart-ver.apecloud-mysql-cluster \
bump-single-chart-ver.apecloud-mysql-scale \
Expand All @@ -380,25 +382,26 @@ bump-chart-ver: bump-single-chart-ver.helm \
bump-single-chart-ver.mongodb \
bump-single-chart-ver.mongodb-cluster \
bump-single-chart-ver.nyancat \
bump-single-chart-appver.nyancat \
bump-single-chart-ver.postgresql \
bump-single-chart-ver.postgresql-cluster \
bump-single-chart-ver.postgresql-patroni-ha \
bump-single-chart-ver.postgresql-patroni-ha-cluster \
bump-single-chart-ver.redis \
bump-single-chart-ver.redis-cluster
bump-single-chart-ver.redis-cluster \
bump-single-chart-ver.milvus \
bump-single-chart-ver.qdrant \
bump-single-chart-ver.qdrant-cluster \
bump-single-chart-ver.weaviate \
bump-single-chart-ver.weaviate-cluster \
bump-single-chart-ver.chatgpt-retrieval-plugin
bump-chart-ver: ## Bump helm chart version.

LOADBALANCER_CHART_VERSION=

.PHONY: helm-package
helm-package: bump-chart-ver ## Do helm package.
## it will pull down the latest charts that satisfy the dependencies, and clean up old dependencies.
## this is a hack fix: decompress the tgz from the depend-charts directory to the charts directory
## before dependency update.
# cd $(CHART_PATH)/charts && ls ../depend-charts/*.tgz | xargs -n1 tar xf
#$(HELM) dependency update --skip-refresh $(CHART_PATH)
$(HELM) package deploy/loadbalancer
mv loadbalancer-*.tgz deploy/helm/depend-charts/
$(HELM) package deploy/apecloud-mysql
mv apecloud-mysql-*.tgz deploy/helm/depend-charts/
$(HELM) package deploy/postgresql
Expand Down Expand Up @@ -742,7 +745,7 @@ endif
.PHONY: render-smoke-testdata-manifests
render-smoke-testdata-manifests: ## Update E2E test dataset
$(HELM) template mycluster deploy/apecloud-mysql-cluster > test/e2e/testdata/smoketest/wesql/00_wesqlcluster.yaml
$(HELM) template mycluster deploy/postgresqlcluster > test/e2e/testdata/smoketest/postgresql/00_postgresqlcluster.yaml
$(HELM) template mycluster deploy/postgresql-cluster > test/e2e/testdata/smoketest/postgresql/00_postgresqlcluster.yaml
$(HELM) template mycluster deploy/redis > test/e2e/testdata/smoketest/redis/00_rediscluster.yaml
$(HELM) template mycluster deploy/redis-cluster >> test/e2e/testdata/smoketest/redis/00_rediscluster.yaml

Expand Down
10 changes: 8 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,22 @@ resources:
crdVersion: v1
namespaced: true
domain: troubleshoot.sh
group:
kind: HostPreflight
path: github.com/apecloud/kubeblocks/externalapis/preflight/v1beta2
version: v1beta2
- api:
crdVersion: v1
namespaced: true
domain: troubleshoot.sh
group:
kind: Preflight
path: github.com/apecloud/kubeblocks/externalapis/preflight/v1beta2
version: v1beta2
- api:
crdVersion: v1
namespaced: true
domain: kubeblocks.io
group: apps
kind: ClassFamily
path: github.com/apecloud/kubeblocks/apis/apps/v1alpha1
version: v1alpha1
version: "3"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@


## What is KubeBlocks
KubeBlocks is an open-source tool designed to help developers and platform engineers build and manage stateful workloads, such as databases and analytics, on Kubernetes. It is cloud-neutral and supports multiple public cloud providers. KubeBlocks provides a unified and declarative approach to increace productivity in DevOps practices.
KubeBlocks is an open-source tool designed to help developers and platform engineers build and manage stateful workloads, such as databases and analytics, on Kubernetes. It is cloud-neutral and supports multiple public cloud providers, providing a unified and declarative approach to increase productivity in DevOps practices.

The name KubeBlocks is derived from Kubernetes and building blocks, which indicates that standardizing databases and analytics on Kubernetes can be both enjoyable and productive, like playing with construction toys. KubeBlocks combines the large-scale production experiences of top public cloud providers with enhanced usability and stability.
The name KubeBlocks is derived from Kubernetes and building blocks, which indicates that standardizing databases and analytics on Kubernetes can be both productive and enjoyable, like playing with construction toys. KubeBlocks combines the large-scale production experiences of top public cloud providers with enhanced usability and stability.

### Why you need KubeBlocks

Expand Down
Loading

0 comments on commit 2dac306

Please sign in to comment.