-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/fix-typo
- Loading branch information
Showing
532 changed files
with
16,325 additions
and
17,737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }}" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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: | ||
|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
@@ -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. | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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. | ||
|
@@ -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 \ | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.