Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move es-indexer to separate pacakge #6841

Merged
merged 7 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- ./packages/common/node_modules
- ./packages/libs/node_modules
- ./packages/identity-service/node_modules
- ./packages/discovery-provider/es-indexer/node_modules
- ./packages/es-indexer/node_modules

generate-release-branch:
working_directory: ~/audius-protocol
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
curl --request POST \
"https://circleci.com/api/v2/workflow/$workflow_id/approve/$job_id" \
--header "Circle-Token: $CIRCLE_DAILY_DEPLOY_API_TOKEN"

# Record approval for the Slack message
echo "<${job_url}|release-v$VERSION>" > /tmp/job_url.txt
fi
Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
curl -f -X POST -H 'Content-type: application/json' \
--data "$json_content" \
$SLACK_DAILY_DEPLOY_WEBHOOK

exit 1
fi
- run:
Expand All @@ -245,7 +245,7 @@ jobs:
failure_content+="{ \"type\": \"section\", \"text\": { \"type\": \"plain_text\", \"text\": \"Failed to find job for today's SP release. If this was not intentional, please check for 'release-audius-docker-compose-trigger' in today's release branch.\n\" } }"
failure_content+="]}"
echo "Sending error message to Slack: $failure_content"

# Send Slack failure message
curl -f -X POST -H 'Content-type: application/json' \
--data "$failure_content" \
Expand All @@ -260,7 +260,7 @@ jobs:
git fetch --all
VERSION=$(jq -r .version packages/discovery-provider/.version.json)
cd ..

# Get the pipeline for the most recent commit on the release branch
response=$(curl --request GET \
--url "https://circleci.com/api/v2/project/gh/AudiusProject/audius-protocol/pipeline?branch=release-v$VERSION" \
Expand Down Expand Up @@ -290,7 +290,7 @@ jobs:
json_content+="{ \"type\": \"section\", \"text\": { \"type\": \"mrkdwn\", \"text\": \"Release v$VERSION is ready for SPs! Please approve <$job_url|release-audius-docker-compose-trigger> and react to this message with :white_check_mark:\n\" } }"
json_content+="]}"
echo "Text to send to slack: $json_content"

# Send Slack message
curl -f -X POST -H 'Content-type: application/json' \
--data "$json_content" \
Expand Down
1 change: 0 additions & 1 deletion .circleci/src/jobs/@discovery-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ lint-discovery-provider:
root: ./
paths:
- node_modules
- packages/discovery-provider/es-indexer/node_modules

test-discovery-api:
working_directory: ~/audius-protocol
Expand Down
7 changes: 7 additions & 0 deletions .circleci/src/workflows/discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ jobs:
filters:
branches:
only: main
- push-docker-image:
name: push-es-indexer
context: [Vercel, dockerhub]
service: es-indexer
filters:
branches:
only: main
- push-docker-image:
name: push-trpc
context: [Vercel, dockerhub]
Expand Down
5 changes: 5 additions & 0 deletions .circleci/src/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
context: [Vercel, dockerhub, slack-secrets]
service: comms
notify_slack_on_failure: true
- push-docker-image:
name: push-es-indexer
context: [Vercel, dockerhub, slack-secrets]
service: es-indexer
notify_slack_on_failure: true
- push-docker-image:
name: push-trpc
context: [Vercel, dockerhub, slack-secrets]
Expand Down
4 changes: 4 additions & 0 deletions dev-tools/compose/docker-compose.discovery.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ services:
file: docker-compose.discovery.prod.yml
service: comms

es-indexer:
extends:
file: docker-compose.discovery.prod.yml
service: es-indexer
trpc:
extends:
file: docker-compose.discovery.prod.yml
Expand Down
9 changes: 9 additions & 0 deletions dev-tools/compose/docker-compose.discovery.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ services:
db:
condition: service_healthy

es-indexer:
build:
context: ${PROJECT_ROOT}/packages/es-indexer
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
db:
condition: service_healthy

discovery-provider-elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.1.0
environment:
Expand Down
3 changes: 2 additions & 1 deletion dev-tools/compose/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ services:
- tests
- notifications

# todo: this will need es-indexer container running for tests to pass..
# unless we just skip all the search tests for now
test-discovery-provider:
extends:
file: docker-compose.yml
Expand All @@ -240,7 +242,6 @@ services:
audius_elasticsearch_run_indexer: 'true'
volumes:
- ${PROJECT_ROOT}/packages/discovery-provider:/audius-discovery-provider
- /audius-discovery-provider/es-indexer/node_modules
depends_on:
discovery-provider-elasticsearch:
condition: service_healthy
Expand Down
Loading