You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2021/04/15 17:10:09 UTC
[solr-operator] branch main updated: Fixes for smoke testing.
This is an automated email from the ASF dual-hosted git repository.
houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-operator.git
The following commit(s) were added to refs/heads/main by this push:
new dedd594 Fixes for smoke testing.
dedd594 is described below
commit dedd5947419adce9ca148d2f7ad0318afdfc65ee
Author: Houston Putman <ho...@apache.org>
AuthorDate: Thu Apr 15 11:36:39 2021 -0500
Fixes for smoke testing.
---
Makefile | 1 +
api/v1beta1/solrbackup_types.go | 1 +
api/v1beta1/solrcloud_types.go | 1 +
api/v1beta1/solrprometheusexporter_types.go | 1 +
hack/release/smoke_test/smoke_test.sh | 6 +++---
hack/release/smoke_test/test_cluster.sh | 6 +++---
hack/release/smoke_test/test_source.sh | 7 ++----
hack/release/smoke_test/verify_all.sh | 8 +++----
hack/release/smoke_test/verify_docker.sh | 2 +-
hack/release/wizard/releaseWizard.yaml | 33 +++++++++++++++++++++--------
10 files changed, 41 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index f439f15..330aa4c 100644
--- a/Makefile
+++ b/Makefile
@@ -87,6 +87,7 @@ generate:
# Generate manifests e.g. CRD, RBAC etc.
manifests:
+ rm -r config/crd/bases
controller-gen $(CRD_OPTIONS) rbac:roleName=solr-operator-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
./hack/helm/copy_crds_roles_helm.sh
diff --git a/api/v1beta1/solrbackup_types.go b/api/v1beta1/solrbackup_types.go
index 576ad78..e2aad5b 100644
--- a/api/v1beta1/solrbackup_types.go
+++ b/api/v1beta1/solrbackup_types.go
@@ -287,6 +287,7 @@ func (sb *SolrBackup) PersistenceJobName() string {
// SolrBackup is the Schema for the solrbackups API
// +kubebuilder:categories=all
// +kubebuilder:subresource:status
+// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Cloud",type="string",JSONPath=".spec.solrCloud",description="Solr Cloud"
// +kubebuilder:printcolumn:name="Finished",type="boolean",JSONPath=".status.finished",description="Whether the backup has finished"
// +kubebuilder:printcolumn:name="Successful",type="boolean",JSONPath=".status.successful",description="Whether the backup was successful"
diff --git a/api/v1beta1/solrcloud_types.go b/api/v1beta1/solrcloud_types.go
index 2182e73..7aade22 100644
--- a/api/v1beta1/solrcloud_types.go
+++ b/api/v1beta1/solrcloud_types.go
@@ -748,6 +748,7 @@ type SolrNodeStatus struct {
// +kubebuilder:categories=all
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.readyReplicas,selectorpath=.status.podSelector
+// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version",description="Solr Version of the cloud"
// +kubebuilder:printcolumn:name="TargetVersion",type="string",JSONPath=".status.targetVersion",description="Target Solr Version of the cloud"
// +kubebuilder:printcolumn:name="DesiredNodes",type="integer",JSONPath=".spec.replicas",description="Number of solr nodes configured to run in the cloud"
diff --git a/api/v1beta1/solrprometheusexporter_types.go b/api/v1beta1/solrprometheusexporter_types.go
index bf0757e..9f99396 100644
--- a/api/v1beta1/solrprometheusexporter_types.go
+++ b/api/v1beta1/solrprometheusexporter_types.go
@@ -180,6 +180,7 @@ type SolrPrometheusExporterStatus struct {
// SolrPrometheusExporter is the Schema for the solrprometheusexporters API
// +kubebuilder:resource:shortName=solrmetrics
// +kubebuilder:subresource:status
+// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Ready",type="boolean",JSONPath=".status.ready",description="Whether the prometheus exporter is ready"
// +kubebuilder:printcolumn:name="Scrape Interval",type="integer",JSONPath=".spec.scrapeInterval",description="Scrape interval for metrics (in ms)"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
diff --git a/hack/release/smoke_test/smoke_test.sh b/hack/release/smoke_test/smoke_test.sh
index 084b9ba..119eb4c 100755
--- a/hack/release/smoke_test/smoke_test.sh
+++ b/hack/release/smoke_test/smoke_test.sh
@@ -70,8 +70,8 @@ fi
PULL_PASS_THROUGH=""
# If LOCATION is a URL, we want to pull the Docker image
-if (echo "${LOCATION}" | grep -E "http"); then
- PULL_PASS_THROUGH=" -p"
+if (echo "${LOCATION}" | grep "http"); then
+ PULL_PASS_THROUGH="-p"
fi
GIT_SHA_PASS_THROUGH=()
@@ -80,7 +80,7 @@ if [[ -n "${GIT_SHA:-}" ]]; then
fi
./hack/release/smoke_test/verify_all.sh -v "${VERSION}" -l "${LOCATION}"
-./hack/release/smoke_test/verify_docker.sh -v "${VERSION}" -i "${IMAGE}""${PULL_PASS_THROUGH}" "${GIT_SHA_PASS_THROUGH[@]}"
+./hack/release/smoke_test/verify_docker.sh -v "${VERSION}" -i "${IMAGE}" "${GIT_SHA_PASS_THROUGH[@]}" "${PULL_PASS_THROUGH}"
./hack/release/smoke_test/test_source.sh -v "${VERSION}" -l "${LOCATION}"
./hack/release/smoke_test/test_cluster.sh -v "${VERSION}" -i "${IMAGE}" -l "${LOCATION}"
diff --git a/hack/release/smoke_test/test_cluster.sh b/hack/release/smoke_test/test_cluster.sh
index 8b70bed..b9e3fd0 100755
--- a/hack/release/smoke_test/test_cluster.sh
+++ b/hack/release/smoke_test/test_cluster.sh
@@ -66,7 +66,7 @@ if [[ -z "${LOCATION:-}" ]]; then
fi
# If LOCATION is not a URL, then get the absolute path
-if ! (echo "${LOCATION}" | grep -E "http"); then
+if ! (echo "${LOCATION}" | grep "http"); then
LOCATION=$(cd "${LOCATION}"; pwd)
LOCATION=${LOCATION%%/}
@@ -177,10 +177,10 @@ kubectl port-forward service/example-solr-metrics 8984:80 || true &
sleep 15
printf "\nQuery the prometheus exporter, test for 'http://example-solrcloud-0.example-solrcloud-headless.default:8983/solr' URL being scraped.\n"
-curl --silent "http://localhost:8984/metrics" | grep http://example-solrcloud-0.example-solrcloud-headless.default:8983/solr > /dev/null
+curl --silent "http://localhost:8984/metrics" | grep 'http://example-solrcloud-.*.example-solrcloud-headless.default:8983/solr' > /dev/null
# If LOCATION is a URL, then remove the helm repo at the end
-if (echo "${LOCATION}" | grep -E "http"); then
+if (echo "${LOCATION}" | grep "http"); then
helm repo remove "apache-solr-test-${VERSION}"
fi
diff --git a/hack/release/smoke_test/test_source.sh b/hack/release/smoke_test/test_source.sh
index 683e406..836d31e 100755
--- a/hack/release/smoke_test/test_source.sh
+++ b/hack/release/smoke_test/test_source.sh
@@ -62,7 +62,7 @@ fi
TMP_DIR=$(mktemp -d --tmpdir "solr-operator-smoke-test-source-XXXXXXXX")
# If LOCATION is not a URL, then get the absolute path
-if ! (echo "${LOCATION}" | grep -E "http"); then
+if ! (echo "${LOCATION}" | grep "http"); then
LOCATION=$(cd "${LOCATION}"; pwd)
fi
@@ -71,12 +71,9 @@ echo "Download source artifact, verify and run 'make check'"
(
cd "${TMP_DIR}"
- if (echo "${LOCATION}" | grep -E "http"); then
+ if (echo "${LOCATION}" | grep "http"); then
# Download source
wget "${LOCATION}/solr-operator-${VERSION}.tgz"
-
- # Pull docker image, since we are working with remotely staged artifacts
- docker pull "apache/solr-operator:${TAG}"
else
cp "${LOCATION}/solr-operator-${VERSION}.tgz" .
fi
diff --git a/hack/release/smoke_test/verify_all.sh b/hack/release/smoke_test/verify_all.sh
index 2be8838..21a6ff0 100755
--- a/hack/release/smoke_test/verify_all.sh
+++ b/hack/release/smoke_test/verify_all.sh
@@ -63,7 +63,7 @@ fi
TMP_DIR=$(mktemp -d --tmpdir "solr-operator-smoke-test-source-XXXXXX")
# If LOCATION is not a URL, then get the absolute path
-if ! (echo "${LOCATION}" | grep -E "http://"); then
+if ! (echo "${LOCATION}" | grep "http"); then
LOCATION=$(cd "${LOCATION}"; pwd)
fi
@@ -78,7 +78,7 @@ echo "Download all artifacts and verify signatures"
(
cd "${TMP_DIR}"
- if (echo "${LOCATION}" | grep -E "http"); then
+ if (echo "${LOCATION}" | grep "http"); then
# Download Source files from the staged location
wget -r -np -nH -nd --level=1 "${LOCATION}/"
@@ -95,7 +95,7 @@ echo "Download all artifacts and verify signatures"
(
cd "${artifact_directory}"
- for artifact in $(find * -type f -maxdepth 0 ! \( -name '*.asc' -o -name '*.sha512' -o -name '*.prov' \) ); do
+ for artifact in $(find * -type f -maxdepth 0 ! \( -name '*.asc' -o -name '*.sha512' -o -name '*.prov' -o -name '*.html*' -o -name '*.txt*' \) ); do
echo "Veryifying: ${artifact_directory}/${artifact}"
sha512sum -c "${artifact}.sha512" \
|| { echo "Invalid sha512 for ${artifact}. Aborting!"; exit 1; }
@@ -110,7 +110,7 @@ echo "Download all artifacts and verify signatures"
)
done
- for artifact in $(find * -type f -maxdepth 0 ! \( -name '*.asc' -o -name '*.sha512' -o -name '*.prov' \) ); do
+ for artifact in $(find * -type f -maxdepth 0 ! \( -name '*.asc' -o -name '*.sha512' -o -name '*.prov' -o -name '*.html*' -o -name '*.txt*' \) ); do
echo "Veryifying: ${artifact}"
sha512sum -c "${artifact}.sha512" \
|| { echo "Invalid sha512 for ${artifact}. Aborting!"; exit 1; }
diff --git a/hack/release/smoke_test/verify_docker.sh b/hack/release/smoke_test/verify_docker.sh
index 7b7af92..0d9832b 100755
--- a/hack/release/smoke_test/verify_docker.sh
+++ b/hack/release/smoke_test/verify_docker.sh
@@ -67,7 +67,7 @@ fi
# Pull the image, if requested
if [[ ${PULL_FIRST:-} ]]; then
- docker pull "apache/solr-operator:${IMAGE}"
+ docker pull "${IMAGE}"
fi
echo "Verify the Docker image ${IMAGE}"
diff --git a/hack/release/wizard/releaseWizard.yaml b/hack/release/wizard/releaseWizard.yaml
index cfbbb3d..0a7dd54 100644
--- a/hack/release/wizard/releaseWizard.yaml
+++ b/hack/release/wizard/releaseWizard.yaml
@@ -62,7 +62,7 @@ templates:
.Mail template {% if passed %}successful{% else %}failed{% endif %} vote
----
To: dev@solr.apache.org
- Subject: [{% if passed %}RESULT{% else %}FAILED{% endif %}] [VOTE] Release the Solr Operator {{ release_version }} RC{{ rc_number }}
+ Subject: [Operator] [{% if passed %}RESULT{% else %}FAILED{% endif %}] [VOTE] Release the Solr Operator {{ release_version }} RC{{ rc_number }}
It's been >72h since the vote was initiated and the result is:
@@ -98,7 +98,7 @@ templates:
.Mail template
----
To: dev@solr.apache.org, users@solr.apache.org
- Subject: [ANNOUNCE] Apache Solr Operator {{ release_version }} released
+ Subject: [Operator] [ANNOUNCE] Apache Solr Operator {{ release_version }} released
(( template=announce_solr_operator_mail_body ))
----
@@ -648,6 +648,11 @@ groups:
- !Todo
id: build_rc
title: Build the release candidate and issue final commit
+ description: |-
+ The release branch "{{ release_branch }}" will have all local changes wiped before the final commit is made.
+ Therefore any local commits or unstaged changes you might have in the release wizard checkout will be lost.
+ If you want to test with local changes, either change the git repo you are using in the release wizard
+ or uncomment the command to remove local changes below.
depends:
- run_tests
- helm_change_log
@@ -681,6 +686,10 @@ groups:
cmd: git pull --ff-only
tee: true
- !Command
+ cmd: git reset --hard origin/{{ release_branch }}
+ comment: Make sure checkout is the same as the remote branch. The release candidate should only have one local commit, the version change.
+ tee: true
+ - !Command
cmd: make clean
tee: true
- !Command
@@ -770,7 +779,7 @@ groups:
commands_text: Here we'll verify that the staged artifacts are downloadable and hash/signatures match.
commands:
- !Command
- cmd: ./hack/release/smoke_test/smoke_test.sh -p -v "{{ release_version }}" -s "{{ build_rc.git_sha | default("<git_sha>", True) }}" -i "{{ docker_image }}" -l "{{ dist_url }}"
+ cmd: ./hack/release/smoke_test/smoke_test.sh -v "{{ release_version }}" -s "{{ build_rc.git_sha | default("<git_sha>", True) }}" -i "{{ docker_image }}" -l "{{ dist_url }}"
logfile: smoketest_staged.log
- !TodoGroup
id: voting
@@ -788,13 +797,18 @@ groups:
.Mail template
----
To: dev@solr.apache.org
- Subject: [VOTE] Release the Solr Operator {{ release_version }} RC{{ rc_number }}
+ Subject: [Operator] [VOTE] Release the Solr Operator {{ release_version }} RC{{ rc_number }}
Please vote for release candidate {{ rc_number }} for the Solr Operator {{ release_version }}
The artifacts can be downloaded from:
https://dist.apache.org/repos/dist/dev/solr/solr-operator/{{ build_rc.rc_folder | default("<rc_folder>", True) }}
+ You can run the full smoke tester, with instructions below.
+ However, it is also encouraged to go and use the artifacts yourself in a test Kubernetes cluster.
+ The smoke tester does not require you to download or install the RC artifacts before running.
+ If you plan on just running the smoke tests, then ignore all other instructions.
+
The artifacts are layed out in the following way:
* solr-operator-{{ release_version }}.tgz - Contains the source release
* crds/ - Contains the CRD files
@@ -806,21 +820,22 @@ groups:
The RC Helm repo can be added with:
helm repo add solr-operator-rc https://dist.apache.org/repos/dist/dev/solr/solr-operator/{{ build_rc.rc_folder | default("<rc_folder>", True) }}/helm-charts
- Install the RC Solr Operator and CRDs with:
+ You can install the RC Solr Operator and CRDs with:
kubectl create -f https://dist.apache.org/repos/dist/dev/solr/solr-operator/{{ build_rc.rc_folder | default("<rc_folder>", True) }}/crds/all-with-dependencies.yaml
helm install --verify solr-operator solr-operator-rc/solr-operator --set image.tag={{ release_version }}-rc{{ rc_number }}
- You can run the smoke tester directly with this command:
+ You can run the full smoke tester directly with this command:
- ./hack/release/smoke_test/smoke_test.sh -p -v "{{ release_version }}" -s "{{ build_rc.git_sha | default("<git_sha>", True) }}" -i "apache/solr-operator:{{ release_version }}-rc{{ rc_number }}" \
+ ./hack/release/smoke_test/smoke_test.sh -v "{{ release_version }}" -s "{{ build_rc.git_sha | default("<git_sha>", True) }}" -i "apache/solr-operator:{{ release_version }}-rc{{ rc_number }}" \
-l 'https://dist.apache.org/repos/dist/dev/solr/solr-operator/{{ build_rc.rc_folder | default("<rc_folder>", True) }}'
Make sure you have the following installed before running the smoke test:
- - Docker
+ - Docker (Give it enough memory and CPU to run ~12 containers, 3 of which are Solr nodes)
- Go 1.16
- Kubectl
- GnuPG
- - Helm
+ - Helm v3.4.0+
+ - Kustomize (v4.0.0+) This will be installed for you, but NOT upgraded if a lower version is already installed.
- yq
- jq