diff --git a/README.md b/README.md index 22280e7..6b7785f 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ let session = new Session(opts) ``` It's also possible to control the default address the session will bind to by providing -an address via the `COHERENCE_GRPC_PROXY_ADDRESS` environment variable. The format of the value would +an address via the `COHERENCE_SERVER_ADDRESS` environment variable. The format of the value would be the same as if you configured it programmatically as the above example shows. Once the session has been constructed, it will now be possible to create maps and caches. diff --git a/bin/docker-utils.sh b/bin/docker-utils.sh index 08df55f..e2c455e 100755 --- a/bin/docker-utils.sh +++ b/bin/docker-utils.sh @@ -16,7 +16,7 @@ echo ${TYPE} function coh_up() { echo "Starting test containers ..." - DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml up --force-recreate --renew-anon-volumes -d + DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker compose -f etc/docker-compose-2-members.yaml up --force-recreate --renew-anon-volumes -d SECONDS=0 echo "Waiting for Coherence to be healthy (within 60s) ..." while [ ${SECONDS} -le 60 ]; do @@ -29,14 +29,14 @@ function coh_up() { done node_version=$(node -v) filename="logs-startup-${VERSION}-${node_version}.txt" - DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml logs --no-color > "${filename}" + DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker compose -f etc/docker-compose-2-members.yaml logs --no-color > "${filename}" echo "Coherence failed to become healthy. See ${filename} for details." coh_down exit 1 } function coh_down() { - DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml down -v + DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker compose -f etc/docker-compose-2-members.yaml down -v } while getopts "ud" OPTION; do diff --git a/bin/test-cycle.sh b/bin/test-cycle.sh index 758b1bb..5f2d7fd 100755 --- a/bin/test-cycle.sh +++ b/bin/test-cycle.sh @@ -42,7 +42,7 @@ function run_tests() { function dump_logs() { node_version=$(node -v) - DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml logs --no-color > logs-"${1}"-test-"${VERSION}"-"${node_version}".txt + DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker compose -f etc/docker-compose-2-members.yaml logs --no-color > logs-"${1}"-test-"${VERSION}"-"${node_version}".txt } function cleanup() { diff --git a/package-lock.json b/package-lock.json index 284fedc..64a5a0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.2-SNAPSHOT", "license": "UPL-1.0", "dependencies": { - "@grpc/grpc-js": "^1.9", + "@grpc/grpc-js": "^1.11", "@grpc/proto-loader": "^0.7", "decimal.js": "^10.4", "google-protobuf": "^3.21" @@ -526,15 +526,16 @@ } }, "node_modules/@grpc/grpc-js": { - "version": "1.9.15", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz", - "integrity": "sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==", + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.11.3.tgz", + "integrity": "sha512-i9UraDzFHMR+Iz/MhFLljT+fCpgxZ3O6CxwGJ8YuNYHJItIHUzKJpW2LvoFZNnGPwqc9iWy9RAucxV0JoR9aUQ==", + "license": "Apache-2.0", "dependencies": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" }, "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=12.10.0" } }, "node_modules/@grpc/proto-loader": { @@ -738,6 +739,16 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", @@ -2995,20 +3006,31 @@ } }, "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, + "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", + "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, "engines": { - "node": ">= 10" + "node": ">=10" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" } }, "node_modules/test-exclude": { @@ -3806,12 +3828,12 @@ } }, "@grpc/grpc-js": { - "version": "1.9.15", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz", - "integrity": "sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==", + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.11.3.tgz", + "integrity": "sha512-i9UraDzFHMR+Iz/MhFLljT+fCpgxZ3O6CxwGJ8YuNYHJItIHUzKJpW2LvoFZNnGPwqc9iWy9RAucxV0JoR9aUQ==", "requires": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" } }, "@grpc/proto-loader": { @@ -3971,6 +3993,11 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==" + }, "@mapbox/node-pre-gyp": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", @@ -5668,17 +5695,25 @@ } }, "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", + "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true + } } }, "test-exclude": { diff --git a/package.json b/package.json index 69aa3ba..2aebdb4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "repository": "https://github.com/oracle/coherence-js-client", "dependencies": { "@grpc/proto-loader": "^0.7", - "@grpc/grpc-js": "^1.9", + "@grpc/grpc-js": "^1.11", "google-protobuf": "^3.21", "decimal.js": "^10.4" }, diff --git a/src/session.ts b/src/session.ts index efd5fb0..9eb6fcc 100644 --- a/src/session.ts +++ b/src/session.ts @@ -260,9 +260,16 @@ export class Options { * Construct a new {@link Options}. */ constructor () { - this._address = (process.env.grpc_proxy_address || process.env.COHERENCE_GRPC_PROXY_ADDRESS) + this._address = (process.env.grpc_proxy_address || + process.env.COHERENCE_GRPC_PROXY_ADDRESS || + process.env.COHERENCE_SERVER_ADDRESS) || Session.DEFAULT_ADDRESS + if (process.env.COHERENCE_GRPC_PROXY_ADDRESS !== undefined) { + console.warn("The COHERENCE_GRPC_PROXY_ADDRESS environment variable" + + " is deprecated. Please use COHERENCE_SERVER_ADDRESS instead.") + } + this._requestTimeoutInMillis = Session.DEFAULT_REQUEST_TIMEOUT this._readyTimeoutInMillis = Session.DEFAULT_READY_TIMEOUT this._format = Session.DEFAULT_FORMAT