Skip to content

Commit

Permalink
ddex yaml time (#8515)
Browse files Browse the repository at this point in the history
  • Loading branch information
stereosteve authored May 20, 2024
1 parent 665938a commit 981954f
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 85 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ workflows:
packages/ddex/webapp/.* run-ddex-webapp-workflow true
packages/ddex/webapp/.* run-ddex-e2e-workflow true
packages/ddex/ingester/.* run-ddex-e2e-workflow true
packages/ddex/processor/.* run-ddex-processor-workflow true
packages/ddex/publisher/.* run-ddex-publisher-workflow true
eth-contracts/.* run-eth-contracts-workflow true
monitoring/healthz/.* run-healthz-workflow true
Expand All @@ -487,6 +488,7 @@ workflows:
.circleci/.* run-protocol-dashboard-workflow true
.circleci/.* run-ddex-webapp-workflow true
.circleci/.* run-ddex-e2e-workflow true
.circleci/.* run-ddex-processor-workflow true
.circleci/.* run-ddex-publisher-workflow true
.circleci/.* run-healthz-workflow true
.circleci/.* run-contracts-workflow true
Expand Down Expand Up @@ -515,6 +517,7 @@ workflows:
packages/libs/.* run-identity-workflow true
packages/libs/.* run-protocol-dashboard-workflow true
packages/libs/.* run-ddex-webapp-workflow true
packages/libs/.* run-ddex-processor-workflow true
packages/libs/.* run-ddex-publisher-workflow true
packages/libs/.* run-sdk-workflow true
packages/libs/.* run-web-workflow true
Expand Down Expand Up @@ -564,6 +567,7 @@ workflows:
packages/ddex/webapp/.* run-ddex-webapp-workflow true
packages/ddex/webapp/.* run-ddex-e2e-workflow true
packages/ddex/ingester/.* run-ddex-e2e-workflow true
packages/ddex/processor/.* run-ddex-processor-workflow true
packages/ddex/publisher/.* run-ddex-publisher-workflow true
packages/create-audius-app/.* run-create-audius-app-workflow true
protocol-dashboard/.* run-protocol-dashboard-workflow true
Expand Down
3 changes: 3 additions & 0 deletions .circleci/src/@continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ parameters:
run-ddex-webapp-workflow:
type: boolean
default: false
run-ddex-processor-workflow:
type: boolean
default: false
run-ddex-publisher-workflow:
type: boolean
default: false
Expand Down
10 changes: 9 additions & 1 deletion .circleci/src/commands/@docker-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ docker-tag-images:
enum: ['prerelease', 'edge', 'current', '__version__']
service:
type: enum
enum: ['discovery-provider', 'creator-node', 'identity-service', 'ddex', 'all']
enum:
[
'discovery-provider',
'creator-node',
'identity-service',
'ddex',
'all'
]
steps:
- run:
name: Get crane
Expand Down Expand Up @@ -58,6 +65,7 @@ docker-tag-images:
ddex=(
ddex-ingester
ddex-publisher
ddex-processor
ddex-web
)
Expand Down
29 changes: 29 additions & 0 deletions .circleci/src/jobs/@ddex-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,32 @@ ddex-publisher-init:
- node_modules
- packages/ddex/node_modules
- packages/ddex/publisher/node_modules

ddex-processor-init:
working_directory: ~/audius-protocol
docker:
- image: cimg/node:18.17
steps:
- checkout
- attach_workspace:
at: ./

# Download and cache dependencies
- create_concatenated_patch_file:
filename: combined-patch-file.txt

- restore_cache:
keys:
- cache-{{ checksum "package-lock.json" }}-{{ checksum "combined-patch-file.txt" }}

- run:
name: lint & typecheck
command: |
npx turbo run verify --filter=@audius/ddex-processor
- persist_to_workspace:
root: ./
paths:
- node_modules
- packages/ddex/node_modules
- packages/ddex/processor/node_modules
3 changes: 3 additions & 0 deletions .circleci/src/workflows/ddex-processor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
when: << pipeline.parameters.run-ddex-processor-workflow >>
jobs:
- ddex-processor-init
7 changes: 7 additions & 0 deletions .circleci/src/workflows/ddex-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
filters:
branches:
only: main
- push-docker-image:
name: push-ddex-processor
context: [Vercel, dockerhub]
service: ddex-processor
filters:
branches:
only: main
- push-docker-image:
name: push-ddex-publisher
context: [Vercel, dockerhub]
Expand Down
8 changes: 8 additions & 0 deletions .circleci/src/workflows/discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ jobs:
filters:
branches:
only: main
- push-docker-image:
name: push-ddex-processor
context: [Vercel, dockerhub]
service: ddex-processor
filters:
branches:
only: main
- push-docker-image:
name: push-ddex-publisher
context: [Vercel, dockerhub]
Expand Down Expand Up @@ -306,6 +313,7 @@ jobs:
- push-healthz
- push-ddex-web
- push-ddex-ingester
- push-ddex-processor
- push-ddex-publisher
# uncomment when arm builds are stable
# - push-discovery-provider-arm
Expand Down
6 changes: 6 additions & 0 deletions .circleci/src/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ jobs:
context: [GCP, dockerhub, slack-secrets]
service: ddex-ingester
notify_slack_on_failure: true
- push-docker-image:
name: push-ddex-processor
context: [GCP, dockerhub, slack-secrets]
service: ddex-processor
notify_slack_on_failure: true
- push-docker-image:
name: push-ddex-publisher
context: [GCP, dockerhub, slack-secrets]
Expand Down Expand Up @@ -227,6 +232,7 @@ jobs:
- push-uptime
- push-ddex-web
- push-ddex-ingester
- push-ddex-processor
- push-ddex-publisher
# uncomment these when arm builds are stable
# - push-identity-service-arm
Expand Down
17 changes: 17 additions & 0 deletions dev-tools/compose/docker-compose.ddex.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
version: '3.9'

services:
ddex-processor:
container_name: ddex-processor
build:
context: ${PROJECT_ROOT}
dockerfile: ${PROJECT_ROOT}/packages/ddex/processor/Dockerfile
args:
app_name: ddex-processor
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
env_file: .env
ports:
- "8889:8989"
networks:
- ddex-network
profiles:
- ddex

ddex-web:
container_name: ddex-web
build:
Expand Down
9 changes: 9 additions & 0 deletions dev-tools/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ services:
profiles:
- ddex

ddex-processor:
extends:
file: docker-compose.ddex.yml
service: ddex-processor
container_name: ddex-processor
<<: *common
profiles:
- ddex

ddex-publisher:
extends:
file: docker-compose.ddex.yml
Expand Down
81 changes: 1 addition & 80 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 packages/ddex/processor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ USER nodejs

WORKDIR /app
COPY --from=app-builder --chown=nodejs:nodejs /app .
WORKDIR /app/packages/ddex/publisher
WORKDIR /app/packages/ddex/processor

EXPOSE 9001
CMD ["npm", "run", "start:prod"]
4 changes: 2 additions & 2 deletions packages/ddex/processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "tsx watch cli.ts server",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint --fix src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"verify": "concurrently \"npm:build\" \"npm:lint\"",
"verify": "tsc --noEmit",
"test": "SQLITE_URL=:memory: vitest run",
"test:watch": "SQLITE_URL=:memory: vitest"
},
Expand All @@ -27,7 +27,7 @@
"commander": "12.0.0",
"decompress": "4.2.1",
"dotenv": "16.3.1",
"file-type": "19.0.0",
"file-type": "16.5.3",
"hono": "4.2.5",
"web3": "4.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ddex/processor/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dotenv/config'

import { serve } from '@hono/node-server'
import { fileTypeFromBuffer } from 'file-type'
import { fromBuffer as fileTypeFromBuffer } from 'file-type'
import { Context, Hono } from 'hono'
import { deleteCookie, getSignedCookie, setSignedCookie } from 'hono/cookie'
import { html } from 'hono/html'
Expand Down

0 comments on commit 981954f

Please sign in to comment.