From 0b6d68c0925895deb9f6ce14083c7a24c40c46f9 Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Wed, 3 Jan 2024 15:59:35 -0800 Subject: [PATCH] Prepare for PR --- .github/workflows/ci.yml | 1 + docker-compose.yml | 2 +- runner/src/server/runner-client.ts | 15 --------------- runner/src/server/runner-server.ts | 4 ++-- 4 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 runner/src/server/runner-client.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fadb8aa2b..8d2b35c2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + # TODO: Move this to New Coordinator's CI Workflow - name: Install Protoc uses: arduino/setup-protoc@v2 - name: Run check diff --git a/docker-compose.yml b/docker-compose.yml index a501b066a..a17e03ae7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,7 +41,7 @@ services: PORT: 9180 AWS_ACCESS_KEY_ID: AWS_SECRET_ACCESS_KEY: - RUNNER_HOST: runner + RUNNER_HOST: localhost RUNNER_PORT: 6001 redis: diff --git a/runner/src/server/runner-client.ts b/runner/src/server/runner-client.ts deleted file mode 100644 index e803b43b9..000000000 --- a/runner/src/server/runner-client.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as grpc from '@grpc/grpc-js'; -import * as protoLoader from '@grpc/proto-loader'; -import { type ProtoGrpcType } from '../generated/runner'; -import { type RunnerClient } from '../generated/runner/Runner'; - -// TODO: Remove this client when coordinator can make calls - -const PROTO_PATH = 'protos/runner.proto'; - -const packageDefinition = protoLoader.loadSync(PROTO_PATH); -const runner = (grpc.loadPackageDefinition(packageDefinition) as unknown) as ProtoGrpcType; -const serverIp = (process.env.RUNNER_HOST ?? 'undefined') + ':' + (process.env.RUNNER_PORT ?? 'undefined'); -const runnerClient: RunnerClient = new runner.runner.Runner(serverIp, grpc.credentials.createInsecure()); - -export default runnerClient; diff --git a/runner/src/server/runner-server.ts b/runner/src/server/runner-server.ts index 23a5eb94f..50ebf9db8 100644 --- a/runner/src/server/runner-server.ts +++ b/runner/src/server/runner-server.ts @@ -15,10 +15,10 @@ export default function startRunnerServer (): grpc.Server { const server = new grpc.Server(); server.addService(runnerProto.runner.Runner.service, getRunnerService(StreamHandler)); const credentials = grpc.ServerCredentials; - const serverIp = (process.env.RUNNER_HOST ?? 'undefined') + ':' + (process.env.RUNNER_PORT ?? 'undefined'); + const serverIpAddress = `${(process.env.RUNNER_HOST ?? 'undefined')}:${(process.env.RUNNER_PORT ?? 'undefined')}`; server.bindAsync( - serverIp, + serverIpAddress, credentials.createInsecure(), // TODO: Use secure credentials with allow for Coordinator (err: Error | null, port: number) => { if (err) {