Skip to content

Commit

Permalink
Revert "Revert "[INF-498] Leverage turborepo cache in docker builds i… (
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype authored Oct 17, 2023
1 parent a4506e3 commit 741a0a6
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .circleci/src/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ when: << pipeline.parameters.run-contracts-workflow >>
jobs:
- test:
name: test-contracts
context: GCP
context: Vercel
service: contracts
8 changes: 4 additions & 4 deletions .circleci/src/workflows/creator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ when: << pipeline.parameters.run-creator-workflow >>
jobs:
- push-docker-image:
name: push-mediorum
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: mediorum
filters:
branches:
only: main
- test:
name: test-mediorum
context: GCP
context: Vercel
service: mediorum
- test:
name: test-mediorum-unittests
context: GCP
context: Vercel
service: mediorum-unittests

# Deploy audius-protocol `main` branch (stage)
- deploy-stage-nodes:
name: deploy-stage-creator-node
Expand Down
18 changes: 9 additions & 9 deletions .circleci/src/workflows/discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@ when: << pipeline.parameters.run-discovery-workflow >>
jobs:
- push-docker-image:
name: push-discovery-provider
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: discovery-provider
filters:
branches:
only: main
- push-docker-image:
name: push-discovery-provider-notifications
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: discovery-provider-notifications
filters:
branches:
only: main
- push-docker-image:
name: push-pedalboard-trending-challenge-rewards
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: trending-challenge-rewards
filters:
branches:
only: main
- push-docker-image:
name: push-pedalboard-relay
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: relay
filters:
branches:
only: main
- push-docker-image:
name: push-pedalboard-sla-auditor
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: sla-auditor
filters:
branches:
only: main
- push-docker-image:
name: push-comms
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: comms
filters:
branches:
only: main
- push-docker-image:
name: push-trpc
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: trpc
filters:
branches:
Expand All @@ -62,13 +62,13 @@ jobs:

- test:
name: test-discovery-provider
context: GCP
context: Vercel
service: discovery-provider
requires:
- lint-discovery-provider
- test:
name: test-discovery-provider-notifications
context: GCP
context: Vercel
service: discovery-provider-notifications
requires:
- lint-discovery-provider
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/workflows/eth-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ when: << pipeline.parameters.run-eth-contracts-workflow >>
jobs:
- test:
name: test-eth-contracts
context: GCP
context: Vercel
service: eth-contracts
4 changes: 2 additions & 2 deletions .circleci/src/workflows/identity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:

- push-docker-image:
name: push-identity-service
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: identity-service
requires:
- identity-init
Expand All @@ -15,7 +15,7 @@ jobs:

- test:
name: test-identity-service
context: GCP
context: Vercel
service: identity-service
requires:
- identity-init
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
when: << pipeline.parameters.run-integration-workflow >>
jobs:
- test-audius-cmd:
context: GCP
context: Vercel
18 changes: 9 additions & 9 deletions .circleci/src/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ when: << pipeline.parameters.run-release-workflow >>
jobs:
- push-docker-image:
name: push-identity-service
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: identity-service
- push-docker-image:
name: push-mediorum
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: mediorum
- push-docker-image:
name: push-discovery-provider
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: discovery-provider
- push-docker-image:
name: push-discovery-provider-notifications
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: discovery-provider-notifications
- push-docker-image:
name: push-pedalboard-trending-challenge-rewards
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: trending-challenge-rewards
- push-docker-image:
name: push-pedalboard-relay
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: relay
- push-docker-image:
name: push-pedalboard-sla-auditor
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: sla-auditor
- push-docker-image:
name: push-comms
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: comms
- push-docker-image:
name: push-trpc
context: [GCP, dockerhub]
context: [Vercel, dockerhub]
service: trpc
- push-docker-image:
name: push-healthz
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ when: << pipeline.parameters.run-sdk-workflow >>
jobs:
- test:
name: test-audius-libs
context: GCP
context: Vercel
service: audius-libs

- test:
name: test-audius-sdk
context: GCP
context: Vercel
service: audius-sdk

# Patch via trigger
Expand Down
2 changes: 2 additions & 0 deletions dev-tools/compose/docker-compose.identity.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ services:
dockerfile: ${PROJECT_ROOT}/packages/identity-service/Dockerfile.prod
args:
git_sha: '${GIT_COMMIT}'
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
ports:
- '7000:7000'
- '9229:9229'
Expand Down
8 changes: 6 additions & 2 deletions dev-tools/compose/docker-compose.pedalboard.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ services:
dockerfile: ${PROJECT_ROOT}/packages/discovery-provider/plugins/pedalboard/docker/Dockerfile.prod
args:
app_name: trending-challenge-rewards
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
restart: always
profiles:
- pedalboard
Expand All @@ -35,7 +37,8 @@ services:
dockerfile: ${PROJECT_ROOT}/packages/discovery-provider/plugins/pedalboard/docker/Dockerfile.prod
args:
app_name: relay
git_sha: '${GIT_COMMIT}'
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
restart: always

sla-auditor:
Expand All @@ -45,7 +48,8 @@ services:
dockerfile: ${PROJECT_ROOT}/packages/discovery-provider/plugins/pedalboard/docker/Dockerfile.prod
args:
app_name: sla-auditor
git_sha: '${GIT_COMMIT}'
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
restart: always
profiles:
- pedalboard
8 changes: 7 additions & 1 deletion dev-tools/compose/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ services:
build:
context: ${PROJECT_ROOT}
dockerfile: ${PROJECT_ROOT}/packages/libs/Dockerfile
args:
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
# TODO: also run integration test current blocker is that integration tests
# use config.json which was removed with the addition of audius-compose
entrypoint: sh -c '[ "$$1" = "test" ] || sleep inf && (shift; npm run test:unit)' -
Expand All @@ -105,6 +108,9 @@ services:
build:
context: ${PROJECT_ROOT}
dockerfile: ${PROJECT_ROOT}/packages/libs/Dockerfile
args:
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
entrypoint: sh -c '[ "$$1" = "test" ] || sleep inf && (shift; npm run test:sdk)' -
logging: *default-logging
deploy:
Expand Down Expand Up @@ -325,7 +331,7 @@ services:
dbUrlTemplate: 'postgres://postgres:example@mediorum-db:5432/m%d'
devNetworkCount: '5'
healthcheck:
test: ["CMD", "curl", "http://localhost:1991/health_check"]
test: ['CMD', 'curl', 'http://localhost:1991/health_check']
interval: 10s
start_period: 60s
timeout: 5s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ ARG app_name
# set as env so we dont have to reset arg after multistage build
ENV APP_NAME=${app_name}

ARG TURBO_TEAM
ENV TURBO_TEAM=$TURBO_TEAM

ARG TURBO_TOKEN
ENV TURBO_TOKEN=$TURBO_TOKEN

FROM base AS builder

RUN echo "building ${APP_NAME}"
Expand Down
6 changes: 6 additions & 0 deletions packages/identity-service/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM node:18-alpine AS base

ARG TURBO_TEAM
ENV TURBO_TEAM=$TURBO_TEAM

ARG TURBO_TOKEN
ENV TURBO_TOKEN=$TURBO_TOKEN

# PRUNE DEPENDENCIES
FROM base AS builder
Expand Down
6 changes: 6 additions & 0 deletions packages/libs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM node:18.17-alpine as base

ARG TURBO_TEAM
ENV TURBO_TEAM=$TURBO_TEAM

ARG TURBO_TOKEN
ENV TURBO_TOKEN=$TURBO_TOKEN

# PRUNE DEPENDENCIES
FROM base AS builder

Expand Down

0 comments on commit 741a0a6

Please sign in to comment.