Skip to content

Commit

Permalink
feat: DH-18086: grpc transport (#202)
Browse files Browse the repository at this point in the history
DH-18086: Use custom grpc transport. Note that this shouldn't introduce
any functional changes. It just enables the http based gRPC transport to
be used which will set us up for Envoy support but is also a preferred
transport to websockets.

### Testing
I've tested the following scenarios:
* Non-envoy connections should work
* Community http connections should work
* Community https connections should work if self-signed certs are
properly configured via `NODE_EXTRA_CA_CERTS`

Confirmed that setting `debug: true` shows gRPC transport logs
  • Loading branch information
bmingles authored Jan 21, 2025
1 parent 4fd2604 commit 48ee7a9
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 61 deletions.
116 changes: 65 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@
"dependencies": {
"@deephaven-enterprise/auth-nodejs": "^1.20240723.124-beta",
"@deephaven-enterprise/query-utils": "^1.20240723.124-beta",
"@deephaven/jsapi-nodejs": "0.102.0",
"@deephaven/jsapi-nodejs": "^0.103.0",
"nanoid": "^5.0.7"
},
"devDependencies": {
Expand Down
18 changes: 9 additions & 9 deletions src/controllers/ExtensionController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import * as vscode from 'vscode';
import type { dh as DhcType } from '@deephaven/jsapi-types';
import type { EnterpriseDhType as DheType } from '@deephaven-enterprise/jsapi-types';
import {
createClient as createDheClient,
getWsUrl,
type AuthenticatedClient as DheAuthenticatedClient,
type UnauthenticatedClient as DheUnauthenticatedClient,
} from '@deephaven-enterprise/auth-nodejs';
import { NodeHttp2gRPCTransport } from '@deephaven/jsapi-nodejs';
import {
CLEAR_SECRET_STORAGE_CMD,
CREATE_NEW_TEXT_DOC_CMD,
Expand Down Expand Up @@ -76,12 +83,6 @@ import { ConnectionController } from './ConnectionController';
import { PipServerController } from './PipServerController';
import { PanelController } from './PanelController';
import { UserLoginController } from './UserLoginController';
import {
createClient as createDheClient,
getWsUrl,
type AuthenticatedClient as DheAuthenticatedClient,
type UnauthenticatedClient as DheUnauthenticatedClient,
} from '@deephaven-enterprise/auth-nodejs';

const logger = new Logger('ExtensionController');

Expand Down Expand Up @@ -343,9 +344,8 @@ export class ExtensionController implements Disposable {
const dhc = await this._coreJsApiCache.get(url);

const client = new dhc.CoreClient(url.toString(), {
// `useWebsockets: true` is needed for 0.37.x servers until we enable
// the http2 based gRPC transport DH-18086
useWebsockets: true,
debug: false, // Set `debug` to true to see debug logs for gRPC transport
transportFactory: NodeHttp2gRPCTransport.factory,
}) as CoreUnauthenticatedClient;

// Attach a dispose method so that client caches can dispose of the client
Expand Down

0 comments on commit 48ee7a9

Please sign in to comment.