Skip to content

Add AUDIUSD_CORE_ONLY for full discovery nodes - #10892

Merged
endline merged 3 commits into
mainfrom
endl/audiusd-health-check
Jan 3, 2025
Merged

Add AUDIUSD_CORE_ONLY for full discovery nodes#10892
endline merged 3 commits into
mainfrom
endl/audiusd-health-check

Conversation

@endline

@endlineendline commented Jan 2, 2025

Copy link
Copy Markdown
Contributor

RELATED: AudiusProject/audius-docker-compose#565

Unified /health-check (note the intentional - because /health_check is fugly).
Also add AUDIUSD_CORE_ONLY mode to replace the audius/core docker image.

Upstream (proxied) health check response routes to be deprecated after this takes over.

LOCAL TEST

# test core only mode
make build-audiusd-local && docker run --rm -ti -p 80:80 -e AUDIUSD_CORE_ONLY=true audius/audiusd:local
curl -s http://localhost/health-check | jq .
# test storage mode
make build-audiusd-local && docker run --rm -ti -p 80:80 -e creatorNodeEndpoint=http://localhost audius/audiusd:local
curl -s http://localhost/health-check | jq .
open http://localhost/console

STAGE TEST

Tested this docker compose commit on stage dn5...

# test unified /health-check
$ curl -s https://discoveryprovider5.staging.audius.co/health-check | jq .
{
"core": {
"chainId": "audius-testnet-18",
"cometAddress": "C9B1ED3D3040E0C2AC70E3215F0EA9B16B401BCA",
"errors": [],
"ethAddress": "0x8311f59B72522e728231dC60226359A51878F9A1",
"healthy": true,
"totalBlocks": 213392,
"totalTransactions": 618
},
"git": "14ccb0c1c33d18d791788048e74d1c0f7ec2f376",
"hostname": "discoveryprovider5.staging.audius.co",
"storage": {
"enabled": false
},
"timestamp": "2025-01-03T17:42:39.214279832Z",
"uptime": "15m25.009814239s"
}
# test standard /health_check - partially omitted for brevity
$ curl -s https://discoveryprovider5.staging.audius.co/health_check | jq .
{
"comms": {
"booted": "2025-01-03T17:27:13Z",
"built": "",
"commit": "",
"errors": null,
"healthy": true,
"host": "https://discoveryprovider5.staging.audius.co",
"is_registered_wallet": true,
"wallet": "0x8311f59B72522e728231dC60226359A51878F9A1",
"websocket_error": null
},
"data": {
"audius-docker-compose": "888c4892a94b79e19de8d92e41210d87a42558fe",
"audius_d_managed": true,
"auto_upgrade_enabled": true,
"block_difference": 0,
....
"signer": "0x8311f59B72522e728231dC60226359A51878F9A1",
"success": true,
"version": {
"service": "discovery-node",
"version": "0.7.67"
}
}
# test console and core routes
$ open https://discoveryprovider5.staging.audius.co/console/overview
$ curl -s https://discoveryprovider5.staging.audius.co/core/debug/comet/status | jq .
{
"jsonrpc": "2.0",
"id": -1,
"result": {
"node_info": {
"protocol_version": {
"p2p": "9",
"block": "11",
"app": "0"
},
"id": "c9b1ed3d3040e0c2ac70e3215f0ea9b16b401bca",
"listen_addr": "tcp://0.0.0.0:26656",
"network": "audius-testnet-18",
"version": "1.0.0",
"channels": "402021222330386061",
"moniker": "48fb51e7476b",
"other": {
"tx_index": "on",
"rpc_address": "tcp://0.0.0.0:26657"
}
},
"sync_info": {
"latest_block_hash": "BBC3C6FFEFAF5FA2E52B79DEF1E3EA8815A153850B2DD8130E9C51EEED4E8BA5",
"latest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"latest_block_height": "213475",
"latest_block_time": "2025-01-03T17:44:34.480328824Z",
"earliest_block_hash": "FA3C8B2066270FB066642A3C54692682B0829B1523FC93537A0CBEE0B7A19730",
"earliest_app_hash": "",
"earliest_block_height": "1",
"earliest_block_time": "2024-08-09T00:00:00Z",
"catching_up": false
},
"validator_info": {
"address": "C9B1ED3D3040E0C2AC70E3215F0EA9B16B401BCA",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "mj5kYzxWEG7iAnHAiJoUiJoPIOItBOEdr6W5sGTf0iY="
},
"voting_power": "10"
}
}
}

@changeset-bot

changeset-botBot commented Jan 2, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2de7e88

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gitguardian

gitguardianBot commented Jan 2, 2025

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian idGitGuardian statusSecretCommitFilename
2460751TriggeredGeneric High Entropy Secret8319194cmd/audiusd/env/prod.envView secret
2416686TriggeredGeneric High Entropy Secret8319194cmd/audiusd/env/stage.envView secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

audius_core_root_dir=/audius-core
uptimeDataDir=/bolt

AUDIUSD_STORAGE_ENABLED=true

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set in docker compose

audius_core_root_dir=/audius-core
uptimeDataDir=/bolt

AUDIUSD_STORAGE_ENABLED=true

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set in docker compose

Comment threadcmd/audiusd/main.go Outdated
@@ -206,16 +209,69 @@ func startEchoProxyWithOptionalTLS(hostUrl *url.URL, logger *common.Logger) erro
e.Use(middleware.Logger(), middleware.Recover())

healthCheckResponse := func() map[string]interface{} {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a big deal, but should this just be a separate function at this point? The only data I see injected into it is hostUrl, which could easily be a parameter

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool. done.

@endline
endlineforce-pushed the endl/audiusd-health-check branch 4 times, most recently from 27761f0 to 630f6f8CompareJanuary 3, 2025 03:56
Also add AUDIUSD_CORE_ONLY mode to replace the audius/core docker image.
@endline
endlineforce-pushed the endl/audiusd-health-check branch from 630f6f8 to 8319194CompareJanuary 3, 2025 04:00
@endline
endlineforce-pushed the endl/audiusd-health-check branch from 3e757be to 1c6fd22CompareJanuary 3, 2025 04:11
@endlineendline changed the title Add top level aggregate /health-checkAllow removal of core imageJan 3, 2025
@endline
endlineforce-pushed the endl/audiusd-health-check branch 4 times, most recently from dfab247 to 14ccb0cCompareJanuary 3, 2025 17:14
@endlineendline changed the title Allow removal of core imageUse AUDIUSD_CORE_ONLY for full discovery nodesJan 3, 2025
@endlineendline changed the title Use AUDIUSD_CORE_ONLY for full discovery nodesAdd AUDIUSD_CORE_ONLY for full discovery nodesJan 3, 2025
@endline
endlineforce-pushed the endl/audiusd-health-check branch from 14ccb0c to 2de7e88CompareJanuary 3, 2025 17:38
@endline
endlineforce-pushed the endl/audiusd-health-check branch from 2de7e88 to ca55317CompareJanuary 3, 2025 17:39
@endline
endline merged commit 2b9ccfa into mainJan 3, 2025
@endline
endline deleted the endl/audiusd-health-check branch January 3, 2025 17:57
audius-infra pushed a commit that referenced this pull request Jan 6, 2025
[20ed92e] Update tcr cron (#10908) Raymond Jacobson
[fd2da0c] Switch react-lottie for lottie-react (#10905) Raymond Jacobson
[2b9ccfa] Add AUDIUSD_CORE_ONLY for full discovery nodes (#10892) endline
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@endline@phelpsdb