Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UHS performance-tests target and JS test code #329

Merged
merged 13 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ KIND_VERSION ?= latest
MINIKUBE ?= $(LOCALBIN_TOOLING)/minikube
MINIKUBE_VERSION ?= latest

# The release version of Yunikorn images
# used in integration and performance tests.
YK_VERSION=fab384e
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a small question.
So, we have to change this version every time we release a YK image.
Why don't we release with the latest tag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always wonder that!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will change this to latest after we unleash our first v1.6.0-1-gr0 (or whatever) image release, and @pavlovic-ivan can also make a latest tag alias to that.


##@ General

# The help target prints out all targets with their descriptions organized
Expand Down Expand Up @@ -261,16 +265,16 @@ performance-tests: k6 ## start dependencies and run performance tests.
@echo "Run unicorn history server"
@mkdir -p test-reports/performance
$(MAKE) clean build
bin/app/unicorn-history-server \
--config config/unicorn-history-server/local.yml > test-reports/performance/uhs.log & disown
nohup bin/app/unicorn-history-server \
--config config/unicorn-history-server/local.yml > test-reports/performance/uhs.log & 2>&1
UHS_SERVER=$${UHS_SERVER:-http://localhost:8989}
@echo "UHS_SERVER is $${UHS_SERVER}"
@echo "**********************************"
@echo "Waiting for unicorn history server to start"
@echo "**********************************"
while true; do
echo "Sending request to unicorn history server..."
URL="$${UHS_SERVER}/ws/v1/health/readiness"
URL="$${UHS_SERVER}/api/v1/health/readiness"
http_status=`curl --write-out %{http_code} --silent --output /dev/null $${URL} || true`
if [ $$http_status -eq 200 ] ; then
echo "Unicorn history server is up and running."
Expand Down Expand Up @@ -423,8 +427,23 @@ wait-for-dependencies: ## wait for dependencies to be ready.
install-and-patch-yunikorn: helm-install-yunikorn patch-yunikorn-service ## install yunikorn and patch Service to expose NodePorts.

.PHONY: helm-install-yunikorn
.ONESHELL:
helm-install-yunikorn: ## install yunikorn using helm.
$(HELM) upgrade --install yunikorn yunikorn/yunikorn --namespace $(NAMESPACE) --create-namespace
@echo "\nLoading Local Docker images into kind cluster..."
$(KIND) load docker-image ${IMAGE_REGISTRY}/yunikorn:admission-${ARCH}-${YK_VERSION} --name ${CLUSTER_NAME}
$(KIND) load docker-image ${IMAGE_REGISTRY}/yunikorn:scheduler-plugin-${ARCH}-${YK_VERSION} --name ${CLUSTER_NAME}
$(KIND) load docker-image ${IMAGE_REGISTRY}/yunikorn:scheduler-${ARCH}-${YK_VERSION} --name ${CLUSTER_NAME}
$(HELM) upgrade --install yunikorn yunikorn/yunikorn --namespace $(NAMESPACE) --create-namespace \
--set image.repository=${IMAGE_REGISTRY}/yunikorn \
--set image.tag=scheduler-${ARCH}-${YK_VERSION} \
--set image.pullPolicy=IfNotPresent \
--set pluginImage.repository=${IMAGE_REGISTRY}/yunikorn \
--set pluginImage.tag=scheduler-plugin-${ARCH}-${YK_VERSION} \
--set pluginImage.pullPolicy=IfNotPresent \
--set admissionController.image.repository=${IMAGE_REGISTRY}/yunikorn \
--set admissionController.image.tag=admission-${ARCH}-${YK_VERSION} \
--set admissionController.image.pullPolicy=IfNotPresent


.PHONY: helm-uninstall-yunikorn
helm-uninstall-yunikorn: ## uninstall yunikorn using helm.
Expand Down Expand Up @@ -455,7 +474,7 @@ helm-uninstall-uhs-local:
.PHONY: helm-repos
helm-repos: helm
$(HELM) repo add gresearch https://g-research.github.io/charts
helm repo add yunikorn https://apache.github.io/yunikorn-release
$(HELM) repo add yunikorn https://apache.github.io/yunikorn-release
$(HELM) repo add bitnami https://charts.bitnami.com/bitnami
$(HELM) repo update

Expand Down
4 changes: 2 additions & 2 deletions test/performance/event_handler_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const appAddCounter = new Counter('app_add_counter');
const namespace = __ENV.NAMESPACE || 'default';
const uhsServer = __ENV.UHS_SERVER || 'http://localhost:8989';

const EVENT_STATISTICS_PATH = '/ws/v1/event-statistics';
const EVENT_STATISTICS_PATH = '/api/v1/event-statistics';
const jobTemplate = {
apiVersion: 'batch/v1',
kind: 'Job',
Expand Down Expand Up @@ -56,7 +56,7 @@ function createJob(kubernetes) {
function getStats() {
const res = http.get(`${uhsServer}${EVENT_STATISTICS_PATH}`);
if (res.status !== 200) {
console.error(`Failed to fetch statistics: ${res.status} ${res.statusText}`);
console.error(`Failed to fetch statistics: ${res.status} ${res.status_text}`);
return null;
}
return JSON.parse(res.body);
Expand Down