Skip to content

Commit

Permalink
Change how to run the server for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karesti committed Jan 7, 2025
1 parent a912622 commit 9b7e5ef
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 306 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
name: Start 2 Cross-site Infinispan Servers Latest Version
shell: bash
run: |
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-e2e
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-e2e
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-e2e-lon -c infinispan-xsite.xml -c "/user-config/e2eTestsConfigLON.xml"
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xmll -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-e2e-nyc -c infinispan-xsite.xml -c "/user-config/e2eTestsConfigNYC.xml"
# Wait for server to startup
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/cache-managers/default/health/status > /dev/null
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31222/rest/v2/cache-managers/default/health/status > /dev/null
Expand Down
8 changes: 5 additions & 3 deletions run-server-for-e2e-container.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/usr/bin/env bash
#!/bin/bash
shopt -s expand_aliases
alias docker='podman'
set -e

ABSOLUTE_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo ${ABSOLUTE_PATH}
SERVER_IMAGE_URL="${SERVER_IMAGE_URL:-quay.io/infinispan-test/server:main}"

docker pull ${SERVER_IMAGE_URL}
docker run --name ispn-lon -d -p 11222:11222 -v ${ABSOLUTE_PATH}/scripts/identities.batch:/user-config/identities.batch -v ${ABSOLUTE_PATH}/dist:/opt/infinispan/static/console -v ${ABSOLUTE_PATH}/scripts/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" ${SERVER_IMAGE_URL} --node-name=infinispan-4-e2e
docker run --name ispn-nyc -d -p 31222:11222 -v ${ABSOLUTE_PATH}/scripts/identities.batch:/user-config/identities.batch -v ${ABSOLUTE_PATH}/dist:/opt/infinispan/static/console -v ${ABSOLUTE_PATH}/scripts/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" ${SERVER_IMAGE_URL} --node-name=infinispan-4-e2e
docker run --name ispn-lon -d -p 11222:11222 -v ${ABSOLUTE_PATH}/scripts/identities.batch:/user-config/identities.batch -v ${ABSOLUTE_PATH}/dist:/opt/infinispan/static/console -v ${ABSOLUTE_PATH}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" ${SERVER_IMAGE_URL} --node-name=infinispan-4-lon-e2e -c infinispan-xsite.xml -c "/user-config/e2eTestsConfigLON.xml"
docker run --name ispn-nyc -d -p 31222:11222 -v ${ABSOLUTE_PATH}/scripts/identities.batch:/user-config/identities.batch -v ${ABSOLUTE_PATH}/dist:/opt/infinispan/static/console -v ${ABSOLUTE_PATH}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" ${SERVER_IMAGE_URL} --node-name=infinispan-4-nyc-e2e -c infinispan-xsite.xml -c "/user-config/e2eTestsConfigNYC.xml"

#Adding nashorn libraries to both containers
for containerId in $(docker ps -q)
Expand Down
19 changes: 0 additions & 19 deletions run-server-for-e2e-podman.sh

This file was deleted.

65 changes: 65 additions & 0 deletions scripts/e2eTestsConfigLON.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<infinispan>
<cache-container name="default" statistics="true">
<metrics accurate-size="true"/>
<tracing collector-endpoint="http://localhost:4318"
enabled="true"
exporter-protocol="OTLP"
service-name="infinispan-server"
security="false" />
<security>
<authorization/>
</security>
<distributed-cache name="people" statistics="true">
<encoding media-type="application/x-protostream"/>
<transaction mode="NON_XA"/>
</distributed-cache>
<distributed-cache-configuration name="e2e-test-template">
<encoding media-type="application/x-protostream"/>
</distributed-cache-configuration>
<distributed-cache name="heap-test" statistics="true">
<encoding media-type="application/x-protostream"/>
<transaction mode="NON_XA"/>
<memory storage="HEAP" max-size="1.5GB"/>
</distributed-cache>
<distributed-cache name="off-heap-test" statistics="true">
<encoding media-type="application/x-protostream"/>
<transaction mode="NON_XA"/>
<memory storage="OFF_HEAP"/>
</distributed-cache>
<invalidation-cache name="invalidationCache" mode="SYNC" statistics="true">
<encoding media-type="application/x-protostream"/>
</invalidation-cache>
<distributed-cache name="a-rbac-test-cache" statistics="true">
<encoding media-type="application/x-protostream"/>
<security>
<authorization enabled="true" roles="admin application deployer"/>
</security>
<indexing enabled="true" startup-mode="reindex">
<indexed-entities>
<indexed-entity>org.infinispan.Car</indexed-entity>
</indexed-entities>
</indexing>
<persistence passivation="false">
<file-store>
<data path="data"/>
<index path="index"/>
</file-store>
</persistence>
<memory storage="HEAP" max-size="1.5GB"/>
</distributed-cache>
</cache-container>
<server>
<endpoints>
<endpoint socket-binding="default" security-realm="default" >
<hotrod-connector name="hotrod">
<authentication>
<sasl mechanisms="PLAIN" server-name="infinispan"/>
</authentication>
</hotrod-connector>
<rest-connector name="rest">
<authentication mechanisms="BASIC DIGEST"/>
</rest-connector>
</endpoint>
</endpoints>
</server>
</infinispan>
22 changes: 22 additions & 0 deletions scripts/e2eTestsConfigNYC.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<infinispan>
<cache-container name="default" statistics="true">
<metrics accurate-size="true"/>
<security>
<authorization/>
</security>
</cache-container>
<server>
<endpoints>
<endpoint socket-binding="default" security-realm="default" >
<hotrod-connector name="hotrod">
<authentication>
<sasl mechanisms="PLAIN" server-name="infinispan"/>
</authentication>
</hotrod-connector>
<rest-connector name="rest">
<authentication mechanisms="BASIC DIGEST"/>
</rest-connector>
</endpoint>
</endpoints>
</server>
</infinispan>
135 changes: 0 additions & 135 deletions scripts/infinispan-basic-auth.xml

This file was deleted.

Loading

0 comments on commit 9b7e5ef

Please sign in to comment.