Skip to content

Commit

Permalink
Revert "Make DN a thin container when running locally, add createSend…
Browse files Browse the repository at this point in the history
…er on DN start (#6335)"

This reverts commit 0ca4675.
  • Loading branch information
isaacsolo committed Dec 1, 2023
1 parent c9ce79b commit 2beb5ec
Show file tree
Hide file tree
Showing 20 changed files with 2,541 additions and 1,838 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
- ./packages/common/node_modules
- ./packages/libs/node_modules
- ./packages/identity-service/node_modules
- ./packages/discovery-provider/es-indexer/node_modules

generate-release-branch:
working_directory: ~/audius-protocol
Expand Down
16 changes: 0 additions & 16 deletions .circleci/src/jobs/@discovery-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ lint-discovery-provider:
steps:
- checkout

- attach_workspace:
at: ./

- create_concatenated_patch_file:
filename: combined-patch-file.txt

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

- restore_cache:
key: python-requirements-{{ checksum "packages/discovery-provider/requirements.txt" }}

Expand Down Expand Up @@ -45,12 +35,6 @@ lint-discovery-provider:
cd packages/discovery-provider
mypy .
- persist_to_workspace:
root: ./
paths:
- node_modules
- packages/discovery-provider/es-indexer/node_modules

test-discovery-api:
working_directory: ~/audius-protocol
executor: newman/postman-newman-docker
Expand Down
8 changes: 3 additions & 5 deletions .circleci/src/jobs/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
parameters:
service:
description: 'Service to test'
description: "Service to test"
type: string
machine: true
resource_class: audiusproject/gcp-n2-standard-4
working_directory: ~/audius-protocol
steps:
- checkout
- attach_workspace:
at: ./
- checkout:
path: '~/audius-protocol'
- run: AUDIUS_DEV=false bash ~/audius-protocol/dev-tools/setup.sh
- run:
name: test run "<< parameters.service >>"
Expand Down
6 changes: 3 additions & 3 deletions dev-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ If you still run into issues, you may execute a `docker system prune` to free ad

## Docker services

- Every Docker service is defined in one of the audius-protocol root-level .yml files (e.g., `docker-compose.discovery.prod.yml` for services related to Discovery Node), and then it's imported into `docker-compose.yml` using [extends](https://docs.docker.com/compose/extends/#understand-the-extends-configuration) syntax
- Every Docker service is defined in one of the audius-protocol root-level .yml files (e.g., `docker-compose.discovery.yml` for services related to Discovery Node), and then it's imported into `docker-compose.yml` using [extends](https://docs.docker.com/compose/extends/#understand-the-extends-configuration) syntax
- This pattern prevents the top-level `docker-compose.yml` file from growing too large and allows every service to have standardized logging, `extra_hosts` (allows the containers to talk to each other), and memory limits (makes `docker stats` more readable) by using the `<<: *common` property. This property is YAML's "merge key" syntax which essentially adds every field from the `common` variable defined at the top of the file
- `docker-compose.test.yml` also imports `docker-compose.yml` services for building images and testing in CI

Expand All @@ -122,8 +122,8 @@ If you still run into issues, you may execute a `docker system prune` to free ad

## Adding a service

1. Configure the service in its own .yml file, either using an existing one (e.g., use `docker-compose.discovery.prod.yml` if it's a Discovery-related service) or by creating a new one
- The typical pattern here is to have a `Dockerfile` in the service's directory, and then when configuring the service (e.g., in top-level `docker-compose.discovery.prod.yml`) use:
1. Configure the service in its own .yml file, either using an existing one (e.g., use `docker-compose.discovery.yml` if it's a Discovery-related service) or by creating a new one
- The typical pattern here is to have a `Dockerfile` in the service's directory, and then when configuring the service (e.g., in top-level `docker-compose.discovery.yml`) use:
```
service-name:
build:
Expand Down
37 changes: 0 additions & 37 deletions dev-tools/compose/docker-compose.discovery.dev.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ services:
discovery-provider:
build:
context: ${PROJECT_ROOT}/packages/discovery-provider
dockerfile: ${PROJECT_ROOT}/packages/discovery-provider/Dockerfile.prod
args:
git_sha: '${GIT_COMMIT}'
command: sh -c ". /tmp/dev-tools/startup/startup.sh && scripts/start.sh"
Expand Down
12 changes: 6 additions & 6 deletions dev-tools/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,39 +107,39 @@ services:

discovery-provider-redis:
extends:
file: docker-compose.discovery.${DOCKERCOMPOSE_ENV_TYPE:-dev}.yml
file: docker-compose.discovery.yml
service: discovery-provider-redis
<<: *common

discovery-provider-notifications:
extends:
file: docker-compose.discovery.${DOCKERCOMPOSE_ENV_TYPE:-dev}.yml
file: docker-compose.discovery.yml
service: discovery-provider-notifications
<<: *common

discovery-provider-elasticsearch:
extends:
file: docker-compose.discovery.${DOCKERCOMPOSE_ENV_TYPE:-dev}.yml
file: docker-compose.discovery.yml
service: discovery-provider-elasticsearch
<<: *common

discovery-provider:
extends:
file: docker-compose.discovery.${DOCKERCOMPOSE_ENV_TYPE:-dev}.yml
file: docker-compose.discovery.yml
service: discovery-provider
<<: *common

comms:
# Used for pushing to docker hub in CI
extends:
file: docker-compose.discovery.${DOCKERCOMPOSE_ENV_TYPE:-dev}.yml
file: docker-compose.discovery.yml
service: comms
<<: *common

trpc:
# Used for pushing to docker hub in CI
extends:
file: docker-compose.discovery.${DOCKERCOMPOSE_ENV_TYPE:-dev}.yml
file: docker-compose.discovery.yml
service: trpc
<<: *common

Expand Down
5 changes: 1 addition & 4 deletions dev-tools/startup/discovery-provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ if nslookup "$elasticsearch_host" >/dev/null 2>&1; then
export audius_elasticsearch_run_indexer="true"
fi

# Run register script in background
# Run register script in background as it waits for the node to be healthy
./scripts/register.py &

# Create sender for current DN
../../node_modules/.bin/ts-node ./scripts/createSender.ts ${replica} &
Loading

0 comments on commit 2beb5ec

Please sign in to comment.