Skip to content

Initial perf tests #120

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

Merged
merged 9 commits into from
Apr 30, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/build-compatability-v1-1412.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
coherenceVersion:
- 14.1.2-0-1
- 14.1.2-0-2
- 14.1.2-0-2-SNAPSHOT
go-version:
- 1.23.x
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/build-perf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Copyright 2022, 2025 Oracle Corporation and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl.

# ---------------------------------------------------------------------------
# Coherence Go Client GitHub Actions CI Perf Tests
# ---------------------------------------------------------------------------
name: CI Perf Tests

on:
workflow_dispatch:
push:
branches-ignore:
- gh-pages
schedule:
# Every day at midnight
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
coherenceVersion:
- 14.1.2-0-2
- 25.03.1
go-version:
- 1.23.x
- 1.24.x


# Checkout the source, we need a depth of zero to fetch all of the history otherwise
# the copyright check cannot work out the date of the files from Git.
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'

- name: Cache Go Modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mods-

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go-version }}'

- name: Run Perf Test
shell: bash
run: |
curl -sL https://raw.githubusercontent.com/oracle/coherence-cli/main/scripts/install.sh | bash
COHERENCE_CLIENT_REQUEST_TIMEOUT=200000 COHERENCE_VERSION=${{ matrix.coherenceVersion }} make test-perf

- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
path: build/_output/test-logs

- uses: actions/upload-artifact@v4
with:
name: test-result-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
path: test/e2e/perf/results.txt
31 changes: 22 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MVN_VERSION ?= 1.0.0
SHELL := /bin/bash

# Coherence CE version to run base tests against
COHERENCE_VERSION ?= 22.06.11
COHERENCE_VERSION ?= 22.06.12
COHERENCE_GROUP_ID ?= com.oracle.coherence.ce
COHERENCE_WKA1 ?= server1
COHERENCE_WKA2 ?= server1
Expand Down Expand Up @@ -207,8 +207,8 @@ golangci: $(TOOLS_BIN)/golangci-lint ## Go code review
.PHONY: generate-proto
generate-proto: $(TOOLS_BIN)/protoc ## Generate Proto Files
mkdir -p $(PROTO_DIR) || true
curl -o $(PROTO_DIR)/services.proto https://raw.githubusercontent.com/oracle/coherence/22.06.11/prj/coherence-grpc/src/main/proto/services.proto
curl -o $(PROTO_DIR)/messages.proto https://raw.githubusercontent.com/oracle/coherence/22.06.11/prj/coherence-grpc/src/main/proto/messages.proto
curl -o $(PROTO_DIR)/services.proto https://raw.githubusercontent.com/oracle/coherence/22.06.12/prj/coherence-grpc/src/main/proto/services.proto
curl -o $(PROTO_DIR)/messages.proto https://raw.githubusercontent.com/oracle/coherence/22.06.12/prj/coherence-grpc/src/main/proto/messages.proto
echo "" >> $(PROTO_DIR)/services.proto
echo "" >> $(PROTO_DIR)/messages.proto
echo 'option go_package = "github.com/oracle/coherence-go-client/proto";' >> $(PROTO_DIR)/services.proto
Expand All @@ -221,11 +221,11 @@ generate-proto: $(TOOLS_BIN)/protoc ## Generate Proto Files
.PHONY: generate-proto-v1
generate-proto-v1: $(TOOLS_BIN)/protoc ## Generate Proto Files v1
mkdir -p $(PROTOV1_DIR) || true
curl -o $(PROTOV1_DIR)/proxy_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/proxy_service_messages_v1.proto
curl -o $(PROTOV1_DIR)/proxy_service_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/proxy_service_v1.proto
curl -o $(PROTOV1_DIR)/common_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/common_messages_v1.proto
curl -o $(PROTOV1_DIR)/cache_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/cache_service_messages_v1.proto
curl -o $(PROTOV1_DIR)/queue_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/queue_service_messages_v1.proto
curl -o $(PROTOV1_DIR)/proxy_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/proxy_service_messages_v1.proto
curl -o $(PROTOV1_DIR)/proxy_service_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/proxy_service_v1.proto
curl -o $(PROTOV1_DIR)/common_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/common_messages_v1.proto
curl -o $(PROTOV1_DIR)/cache_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/cache_service_messages_v1.proto
curl -o $(PROTOV1_DIR)/queue_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/queue_service_messages_v1.proto
echo "" >> $(PROTOV1_DIR)/proxy_service_messages_v1.proto
echo "" >> $(PROTOV1_DIR)/proxy_service_v1.proto
echo "" >> $(PROTOV1_DIR)/common_messages_v1.proto
Expand Down Expand Up @@ -389,6 +389,19 @@ test-discovery: test-clean gotestsum $(BUILD_PROPS) ## Run Discovery tests with
-- $(GO_TEST_FLAGS) -v ./test/e2e/discovery/...
make test-coherence-shutdown

# ----------------------------------------------------------------------------------------------------------------------
# Executes the Go perf tests for standalone Coherence
# ----------------------------------------------------------------------------------------------------------------------
.PHONY: test-perf
test-perf: test-clean gotestsum $(BUILD_PROPS) ## Run Discovery tests with Coherence
./scripts/perf-cluster.sh $(TEST_LOGS_DIR)/cli $(COHERENCE_VERSION) stop || true
mkdir -p $(TEST_LOGS_DIR)/cli
./scripts/perf-cluster.sh $(TEST_LOGS_DIR)/cli $(COHERENCE_VERSION) start
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/cohctl-test-perf.xml \
-- $(GO_TEST_FLAGS) -v ./test/e2e/perf/...
./scripts/perf-cluster.sh $(TEST_LOGS_DIR)/cli $(COHERENCE_VERSION) stop || true
rm -rf $(TEST_LOGS_DIR)/cli/*

# ----------------------------------------------------------------------------------------------------------------------
# Executes the Go resolver tests for standalone Coherence
# ----------------------------------------------------------------------------------------------------------------------
Expand All @@ -413,7 +426,7 @@ test-resolver-cluster: test-clean gotestsum $(BUILD_PROPS) ## Run Resolver tests
# ----------------------------------------------------------------------------------------------------------------------
$(TOOLS_BIN)/golangci-lint:
@mkdir -p $(TOOLS_BIN)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN) v1.61.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN) v1.64.8


# ----------------------------------------------------------------------------------------------------------------------
Expand Down
105 changes: 105 additions & 0 deletions scripts/perf-cluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/bin/bash

#
# Copyright (c) 2025 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl.
#

# Run Performance Test
# environment variables COM accepted
# Arguments:
# 1 - directory for cohctl config
# 2 - coherence version
# 3 - start or stop
pwd

if [ $# -ne 3 ] ; then
echo "Usage: $0 directory Coherence-Version [start|stop]"
exit
fi

CONFIG_DIR=$1
VERSION=$2
COMMAND=$3

if [ ! -d $CONFIG_DIR ]; then
echo "${CONFIG_DIR} is not a directory"
exit 1
fi

DIR=`pwd`
OUTPUT=`mktemp`

mkdir -p ${CONFIG_DIR}
trap "rm -rf ${OUTPUT}" EXIT SIGINT

echo
echo "Config Dir: ${CONFIG_DIR}"
echo "Version: ${VERSION}"
echo "Commercial: ${COM}"
echo

type cohctl
ret=$?
if [ $ret -ne 0 ]; then
echo "cohctl must be in path"
exit 1
fi

# Build the Java project so we get any deps downloaded

COHERENCE_GROUP_ID=com.oracle.coherence.ce
if [ ! -z "$COM" ] ; then
COHERENCE_GROUP_ID=com.oracle.coherence
fi

# Default command
COHCTL="cohctl --config-dir ${CONFIG_DIR}"

function pause() {
echo "sleeping..."
sleep 5
}

function message() {
echo "========================================================="
echo "$*"
}

function save_logs() {
mkdir -p build/_output/test-logs
cp ${CONFIG_DIR}/logs/local/*.log build/_output/test-logs || true
}

function runCommand() {
echo "========================================================="
echo "Running command: cohctl $*"
$COHCTL $* > $OUTPUT 2>&1
ret=$?
cat $OUTPUT
if [ $ret -ne 0 ] ; then
echo "Command failed"
# copy the log files
save_logs
exit 1
fi
}

runCommand version
runCommand set debug on

if [ "${COMMAND}" == "start" ]; then
# Create a cluster
message "Create Cluster"
runCommand create cluster local -y -v $VERSION $COM -S com.tangosol.net.Coherence -a coherence-grpc,coherence-grpc-proxy --machine machine1 -M 2g
runCommand monitor health -n localhost:7574 -I -T 120 -w
elif [ "${COMMAND}" == "stop" ]; then
runCommand stop cluster local -y
runCommand remove cluster local -y
elif [ "${COMMAND}" == "status" ]; then
runCommand get members
else
echo "Invalid command ${COMMAND}"
exit 1
fi
Loading
Loading