diff --git a/.asf.yaml b/.asf.yaml new file mode 100644 index 00000000..48467377 --- /dev/null +++ b/.asf.yaml @@ -0,0 +1,34 @@ +# note: documentation can be found here https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features + +github: + description: 'Apache Druid Operator: a Kubernetes operator for Apache Druid.' + homepage: https://druid.apache.org/ + + # Attempt to make the auto-generated github emails more easily readable in email clients. + # Configuration adapted from https://github.com/apache/plc4x/blob/develop/.asf.yaml. + custom_subjects: + new_pr: "[PR] {title} ({repository})" + close_pr: "Re: [PR] {title} ({repository})" + comment_pr: "Re: [PR] {title} ({repository})" + diffcomment: "Re: [PR] {title} ({repository})" + merge_pr: "Re: [PR] {title} ({repository})" + new_issue: "[I] {title} ({repository})" + comment_issue: "Re: [I] {title} ({repository})" + close_issue: "Re: [I] {title} ({repository})" + catchall: "[GH] {title} ({repository})" + new_discussion: "[D] {title} ({repository})" + edit_discussion: "Re: [D] {title} ({repository})" + close_discussion: "Re: [D] {title} ({repository})" + close_discussion_with_comment: "Re: [D] {title} ({repository})" + reopen_discussion: "Re: [D] {title} ({repository})" + new_comment_discussion: "Re: [D] {title} ({repository})" + edit_comment_discussion: "Re: [D] {title} ({repository})" + delete_comment_discussion: "Re: [D] {title} ({repository})" + +notifications: + commits: commits@druid.apache.org + issues: commits@druid.apache.org + discussions: commits@druid.apache.org + pullrequests_status: commits@druid.apache.org + pullrequests_comment: commits@druid.apache.org + pullrequests_bot_dependabot: commits@druid.apache.org diff --git a/.dockerignore b/.dockerignore index 0f046820..97a57a69 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file # Ignore build and test binaries. bin/ diff --git a/Makefile b/Makefile index 4027938b..75964331 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,8 @@ NAMESPACE_MINIO_OPERATOR ?= "minio-operator" MINIO_VERSION ?= "6.0.4" # NAMESPACE for druid app e2e NAMESPACE_DRUID ?= "druid" +# Set to false to skip the Apache RAT license audit +ENABLE_RAT ?= true # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.26.0 @@ -103,6 +105,22 @@ test: manifests generate fmt vet envtest ## Run tests. e2e: ## Runs e2e tests e2e/e2e.sh +ifeq ($(ENABLE_RAT),true) +.PHONY: rat +rat: rat-jar ## Run Apache RAT license audit (set ENABLE_RAT=false to skip). + java -jar $(RAT_JAR) \ + --input-exclude-std GIT \ + --input-exclude "**/*.png" \ + --input-exclude "**/*.sum" \ + --input-exclude "**/zz_generated.*.go" \ + --input-exclude "**/PROJECT" \ + -- . +else +.PHONY: rat +rat: ## Run Apache RAT license audit (set ENABLE_RAT=false to skip). + @echo "Skipping Apache RAT license audit (ENABLE_RAT=false)" +endif + .PHONY: docker-build-local-test docker-build-local-test: ## Build docker image with the manager for test on kind. docker build -t ${IMG_KIND}:${TEST_IMG_TAG} -f e2e/Dockerfile-testpod . @@ -111,6 +129,10 @@ docker-build-local-test: ## Build docker image with the manager for test on kind docker-push-local-test: ## Push docker image with the manager to kind registry. docker push ${IMG_KIND}:${TEST_IMG_TAG} +.PHONY: kind-load-local-test +kind-load-local-test: ## Load test docker image into kind cluster directly (no registry mirror needed). + kind load docker-image ${IMG_KIND}:${TEST_IMG_TAG} + .PHONY: deploy-testjob deploy-testjob: ## Run a wikipedia test pod kubectl create job wiki-test --image=${IMG_KIND}:${TEST_IMG_TAG} -- sh /wikipedia-test.sh @@ -176,6 +198,10 @@ docker-build-local: ## Build docker image with the manager for kind registry. docker-push-local: ## Push docker image with the manager to kind registry. docker push ${IMG_KIND}:${IMG_TAG} +.PHONY: kind-load-local +kind-load-local: ## Load docker image into kind cluster directly (no registry mirror needed). + kind load docker-image ${IMG_KIND}:${IMG_TAG} + # PLATFORMS defines the target platforms for the manager image be build to provide support to multiple # architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to: # - able to use docker buildx . More info: https://docs.docker.com/build/buildx/ @@ -247,11 +273,13 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen GEN_CRD_API_REFERENCE_DOCS = $(LOCALBIN)/gen-crd-api-reference-docs ENVTEST ?= $(LOCALBIN)/setup-envtest +RAT_JAR ?= $(LOCALBIN)/apache-rat.jar ## Tool Versions KUSTOMIZE_VERSION ?= v3.8.7 -CONTROLLER_TOOLS_VERSION ?= v0.14.0 +CONTROLLER_TOOLS_VERSION ?= v0.20.1 GEN_CRD_API_REF_VERSION ?= v0.3.0 +RAT_VERSION ?= 0.17 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize @@ -278,3 +306,13 @@ $(ENVTEST): $(LOCALBIN) gen-crd-api-reference-docs: $(GEN_CRD_API_REFERENCE_DOCS) $(GEN_CRD_API_REFERENCE_DOCS): $(LOCALBIN) GOBIN=$(LOCALBIN) go install github.com/ahmetb/gen-crd-api-reference-docs@$(GEN_CRD_API_REF_VERSION) + +.PHONY: rat-jar +rat-jar: $(RAT_JAR) ## Download Apache RAT jar locally if necessary. +$(RAT_JAR): $(LOCALBIN) + mkdir -p /tmp/rat-download && \ + curl -sSL "https://dlcdn.apache.org/creadur/apache-rat-$(RAT_VERSION)/apache-rat-$(RAT_VERSION)-bin.tar.gz" \ + -o /tmp/rat-download/rat.tar.gz && \ + tar -xzf /tmp/rat-download/rat.tar.gz -C /tmp/rat-download && \ + mv /tmp/rat-download/apache-rat-$(RAT_VERSION)/apache-rat-$(RAT_VERSION).jar $(RAT_JAR) && \ + rm -rf /tmp/rat-download diff --git a/chart/.helmignore b/chart/.helmignore index 0e8a0eb3..fa5198e3 100644 --- a/chart/.helmignore +++ b/chart/.helmignore @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + # Patterns to ignore when building packages. # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. diff --git a/e2e/druid-ingestion-test.sh b/e2e/druid-ingestion-test.sh old mode 100644 new mode 100755 diff --git a/e2e/e2e.sh b/e2e/e2e.sh old mode 100644 new mode 100755 index 9c0568fa..4696696c --- a/e2e/e2e.sh +++ b/e2e/e2e.sh @@ -20,7 +20,8 @@ set -o errexit set -x # Get Kind -go install sigs.k8s.io/kind@v0.21.0 +go install sigs.k8s.io/kind@v0.31.0 +export PATH="$(go env GOPATH)/bin:$PATH" # minio statefulset name MINIO_STS_NAME=myminio-minio # druid namespace @@ -33,12 +34,14 @@ make vet make kind # build local docker druid operator image make docker-build-local -# push to kind registry +# push to kind registry and load directly into kind cluster make docker-push-local +make kind-load-local # build local docker test image make docker-build-local-test -# push to kind registry +# push to kind registry and load directly into kind cluster make docker-push-local-test +make kind-load-local-test # try to install the CRD with make make install # install druid-operator diff --git a/e2e/kind.sh b/e2e/kind.sh old mode 100644 new mode 100755 index b7850e97..c23a93ea --- a/e2e/kind.sh +++ b/e2e/kind.sh @@ -36,14 +36,9 @@ then kubectl config use-context kind-kind else -# create a cluster with the local registry enabled in containerd cat <