From 97509c7e606c94abdaf300e0c3e9ed7bfa50d19c Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 3 Dec 2024 16:39:43 -0800 Subject: [PATCH 1/9] remove unnecessary logging --- src/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0164064..7e50057 100644 --- a/src/index.ts +++ b/src/index.ts @@ -650,8 +650,6 @@ const main = async (): Promise => { const depth = Math.min(parseInt(adjustedDepth as string) ?? 1, 100); redisL2['bids'] = redisL2['bids']?.slice(0, depth); redisL2['asks'] = redisL2['asks']?.slice(0, depth); - console.log(redisL2['slot']); - console.log(SLOT_STALENESS_TOLERANCE); if ( redisL2 && dlobProvider.getSlot() - redisL2['slot'] < SLOT_STALENESS_TOLERANCE From 3e386d714d62c6a0738345a91f28e5d4c3d45879 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 00:29:03 +0000 Subject: [PATCH 2/9] Bumping drift-common to 4af2fa69cb4aaaa2f648e249e9477f755cda7dc7 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 0303c32..4af2fa6 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 0303c32d038e1ea1c9c21fc5c31f16730eed5fc3 +Subproject commit 4af2fa69cb4aaaa2f648e249e9477f755cda7dc7 From 9eccf208e7a79c573ffa1eb9c5b5c994bc4b86fc Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 00:33:32 +0000 Subject: [PATCH 3/9] Bumping drift-common to abc42f06ec04c2996707f5a2eda721d55e5d9939 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 4af2fa6..abc42f0 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 4af2fa69cb4aaaa2f648e249e9477f755cda7dc7 +Subproject commit abc42f06ec04c2996707f5a2eda721d55e5d9939 From 4a7aff665bdfb60a35ecdc5d55ec41b1e852ebfd Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 00:59:08 +0000 Subject: [PATCH 4/9] Bumping drift-common to 4782e540b42ff5000b761de8ef1fb00454e67ead --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index abc42f0..4782e54 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit abc42f06ec04c2996707f5a2eda721d55e5d9939 +Subproject commit 4782e540b42ff5000b761de8ef1fb00454e67ead From 302ef36eec0ca68a2580726e89769a37de5de36a Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 01:41:52 +0000 Subject: [PATCH 5/9] Bumping drift-common to 78cb08e848cffa103a4c382948237f8f5113b967 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 4782e54..78cb08e 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 4782e540b42ff5000b761de8ef1fb00454e67ead +Subproject commit 78cb08e848cffa103a4c382948237f8f5113b967 From 9271bd8fd660503370d0ee948be5f3e58d36c603 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Wed, 4 Dec 2024 19:37:11 -0800 Subject: [PATCH 6/9] use grpc for drift client for dlob publishers --- drift-common | 2 +- src/publishers/dlobPublisher.ts | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drift-common b/drift-common index 78cb08e..0303c32 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 78cb08e848cffa103a4c382948237f8f5113b967 +Subproject commit 0303c32d038e1ea1c9c21fc5c31f16730eed5fc3 diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 05f86a7..dbd29ec 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -324,7 +324,24 @@ const main = async () => { let accountSubscription: DriftClientSubscriptionConfig; let slotSource: SlotSource; - if (!useWebsocket) { + // USE_GRPC=true will override websocket + if (useGrpc) { + accountSubscription = { + type: 'grpc', + resubTimeoutMs: 30_000, + grpcConfigs: { + endpoint, + token, + }, + }; + + slotSubscriber = new SlotSubscriber(connection); + await slotSubscriber.subscribe(); + + slotSource = { + getSlot: () => slotSubscriber!.getSlot(), + }; + } else if (!useWebsocket) { bulkAccountLoader = new BulkAccountLoader( connection, stateCommitment, From 2bb423053b641e93ea5f11335b76bc7b940b5c9c Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Wed, 4 Dec 2024 19:39:11 -0800 Subject: [PATCH 7/9] bump common --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 0303c32..78cb08e 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 0303c32d038e1ea1c9c21fc5c31f16730eed5fc3 +Subproject commit 78cb08e848cffa103a4c382948237f8f5113b967 From 37b80aeeb7a94217337f31fd3d9409b497dc3d98 Mon Sep 17 00:00:00 2001 From: Jack Waller Date: Thu, 5 Dec 2024 15:15:59 +1100 Subject: [PATCH 8/9] chore: add GH pipeline to dlob --- .github/workflows/master.yml | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/master.yml diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..4663795 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,70 @@ +# non-prod +name: DLOB Build Image And Deploy + +on: + push: + branches: [master, staging] + +jobs: + build: + runs-on: ubicloud + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@master + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_NON_PROD }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_NON_PROD }} + aws-region: ${{ secrets.EKS_NON_PROD_REGION }} + + - name: Log in to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build and push + uses: docker/build-push-action@v6 + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: dlob-server + IMAGE_TAG: ${{ github.sha }} + BRANCH_NAME: ${{ github.ref_name }} + with: + context: . + push: true + tags: | + ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} + ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest-${{ env.BRANCH_NAME }}-amd64 + + deploy: + runs-on: ubicloud + needs: [build] + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@master + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_NON_PROD }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_NON_PROD }} + aws-region: ${{ secrets.EKS_NON_PROD_REGION }} + + - name: Install kubectl + uses: azure/setup-kubectl@v3 + with: + version: 'v1.30.0' + + - name: Configure AWS EKS Credentials + run: aws eks update-kubeconfig --name ${{ secrets.EKS_NON_PROD_CLUSTER_NAME }} --region ${{ secrets.EKS_NON_PROD_REGION }} --role-arn ${{ secrets.EKS_NON_PROD_DEPLOY_ROLE }} + + - name: Restart deployment + env: + BRANCH_NAME: ${{ github.ref_name }} + run: | + kubectl get deployments -n $BRANCH_NAME -o name | grep '^deployment.apps/dlob-publisher-app' | xargs -I {} kubectl rollout restart {} -n $BRANCH_NAME + kubectl rollout restart -n $BRANCH_NAME deployment/dlob-server-app + kubectl rollout restart -n $BRANCH_NAME deployment/dlob-server-lite-app + kubectl rollout restart -n $BRANCH_NAME deployment/dlob-ws-connection-manager-app + kubectl rollout restart -n $BRANCH_NAME deployment/dlob-trades-publisher-app + kubectl rollout restart -n $BRANCH_NAME deployment/dlob-priority-fees-publisher-app \ No newline at end of file From 9eb204cc74a04122e627cd38866d161f273a2fca Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:45:54 +0000 Subject: [PATCH 9/9] Bumping drift-common to f4a3b72f6e9a383b3dd0b4313f69bd3512c25373 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 78cb08e..f4a3b72 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 78cb08e848cffa103a4c382948237f8f5113b967 +Subproject commit f4a3b72f6e9a383b3dd0b4313f69bd3512c25373