Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pay-2448-filter-trans…
Browse files Browse the repository at this point in the history
…actions-api

* origin/main:
  [PROTO-1644] Healthz displays audius-d managed status and icon (#7436)
  DDEX local dev  (#7435)
  [PAY-2407][PAY-2441] Route withdraw transactions through user bank (#7388)
  Convert history page sagas to ts (#7431)
  Convert search page sagas to ts (#7434)
  Convert trending page sagas to ts (#7433)
  [PAY-2373][PAY-2406][PAY-2374] Support file sizes for stems / downloads (#7421)
  [PAY-2413] Export private key (#7425)
  [PROTO-1636] Make ddex UI upload zip files to S3 (#7430)
  ONC-1: add metrics backfill (#7422)
  • Loading branch information
schottra committed Feb 2, 2024
2 parents 75e0961 + e68c3b7 commit 031e79a
Show file tree
Hide file tree
Showing 71 changed files with 3,987 additions and 221 deletions.
6 changes: 5 additions & 1 deletion dev-tools/audius-compose
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ audius-protocol-solana-test-validator-1 \
audius-protocol-eth-ganache-1 \
audius-protocol-poa-ganache-1 \
audius-protocol-pedalboard \
audius-protocol-anti-abuse-oracle-1
audius-protocol-anti-abuse-oracle-1 \
ddex-mongo
"""


Expand Down Expand Up @@ -447,6 +448,7 @@ def load_env(protocol_dir, service, environment):
help="Bring up the pedalboard containers",
)
@click.option("--comms", is_flag=True, help="Bring up comms/dms containers")
@click.option("--ddex", is_flag=True, help="Bring up ddex containers")
@click.option("-a", "--args", type=str, multiple=True)
@click.option(
"--prod",
Expand All @@ -466,6 +468,7 @@ def up(
notifs,
pedalboard,
comms,
ddex,
args,
prod,
services,
Expand Down Expand Up @@ -498,6 +501,7 @@ def up(
*(["--profile=notifications"] if notifs else []),
*(["--profile=pedalboard"] if pedalboard else []),
*(["--profile=comms"] if comms else []),
*(["--profile=ddex"] if ddex else []),
*(["--profile=storage"]),
*(["--profile=libs"]),
*(["--profile=solana"]),
Expand Down
5 changes: 4 additions & 1 deletion dev-tools/compose/docker-compose.ddex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ services:
app_name: ddex-web
TURBO_TEAM: '${TURBO_TEAM}'
TURBO_TOKEN: '${TURBO_TOKEN}'
environment:
- DDEX_PORT=9000
- DDEX_MONGODB_URL=mongodb://mongo:mongo@ddex-mongo:27017/ddex?authSource=admin&replicaSet=rs0
ports:
- "9000:9000"
networks:
Expand Down Expand Up @@ -92,7 +95,7 @@ services:
restart: always
volumes:
- ddex-mongo-db:/data/db
- ${PROJECT_ROOT}/packages/ddex/ingester/mongo-keyfile:/etc/mongo-keyfile
- ${PROJECT_ROOT}/packages/ddex/mongo-keyfile:/etc/mongo-keyfile
environment:
- MONGO_INITDB_ROOT_USERNAME=mongo
- MONGO_INITDB_ROOT_PASSWORD=mongo
Expand Down
2 changes: 2 additions & 0 deletions mediorum/server/serve_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type healthCheckResponseData struct {
Version string `json:"version"`
Service string `json:"service"` // used by registerWithDelegate()
IsSeeding bool `json:"isSeeding"`
IsAudiusdManaged bool `json:"isAudiusdManaged"`
BuiltAt string `json:"builtAt"`
StartedAt time.Time `json:"startedAt"`
SPID int `json:"spID"`
Expand Down Expand Up @@ -85,6 +86,7 @@ func (ss *MediorumServer) serveHealthCheck(c echo.Context) error {
Version: ss.Config.VersionJson.Version,
Service: ss.Config.VersionJson.Service,
IsSeeding: ss.isSeeding,
IsAudiusdManaged: ss.isAudiusdManaged,
BuiltAt: vcsBuildTime,
StartedAt: ss.StartedAt,
SPID: ss.Config.SPID,
Expand Down
2 changes: 1 addition & 1 deletion mediorum/server/serve_health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestHealthCheck(t *testing.T) {
TrustedNotifierID: 1,
}

expected := `{"audiusDockerCompose":"123456","autoUpgradeEnabled":true,"blobStorePrefix":"file","builtAt":"","databaseSize":99999,"dbSizeErr":"","dir":"/dir","env":"DEV","failsPeerReachability":false,"git":"123456","healthy":true,"isDbLocalhost":false,"isSeeding":false,"lastSuccessfulCleanup":{"AbortedReason":"","CleanupMode":false,"ContentSize":0,"Counters":null,"CursorI":0,"CursorQmCID":"","CursorUploadID":"","Duration":0,"FinishedAt":"0001-01-01T00:00:00Z","StartedAt":"0001-01-01T00:00:00Z","UpdatedAt":"0001-01-01T00:00:00Z"},"lastSuccessfulRepair":{"AbortedReason":"","CleanupMode":false,"ContentSize":777777,"Counters":null,"CursorI":0,"CursorQmCID":"","CursorUploadID":"","Duration":0,"FinishedAt":"0001-01-01T00:00:00Z","StartedAt":"0001-01-01T00:00:00Z","UpdatedAt":"0001-01-01T00:00:00Z"},"listenPort":"1991","mediorumPathSize":888888888,"mediorumPathUsed":88888,"moveFromBlobStorePrefix":"","peerHealths":null,"replicationFactor":3,"self":{"host":"test1.com","wallet":"0xtest1"},"service":"content-node","signers":[{"host":"test2.com","wallet":"0xtest2"}],"spID":1,"spOwnerWallet":"0xtest1","startedAt":"2023-06-07T08:25:30Z","storeAll":false,"trustedNotifier":{"email":"dmca@notifier.com","endpoint":"http://notifier.com","wallet":"0xnotifier"},"trustedNotifierId":1,"unreachablePeers":null,"uploadsCount":0,"uploadsCountErr":"","version":"1.0.0","wallet_is_registered":false}`
expected := `{"audiusDockerCompose":"123456","autoUpgradeEnabled":true,"blobStorePrefix":"file","builtAt":"","databaseSize":99999,"dbSizeErr":"","dir":"/dir","env":"DEV","failsPeerReachability":false,"git":"123456","healthy":true,"isAudiusdManaged":false,"isDbLocalhost":false,"isSeeding":false,"lastSuccessfulCleanup":{"AbortedReason":"","CleanupMode":false,"ContentSize":0,"Counters":null,"CursorI":0,"CursorQmCID":"","CursorUploadID":"","Duration":0,"FinishedAt":"0001-01-01T00:00:00Z","StartedAt":"0001-01-01T00:00:00Z","UpdatedAt":"0001-01-01T00:00:00Z"},"lastSuccessfulRepair":{"AbortedReason":"","CleanupMode":false,"ContentSize":777777,"Counters":null,"CursorI":0,"CursorQmCID":"","CursorUploadID":"","Duration":0,"FinishedAt":"0001-01-01T00:00:00Z","StartedAt":"0001-01-01T00:00:00Z","UpdatedAt":"0001-01-01T00:00:00Z"},"listenPort":"1991","mediorumPathSize":888888888,"mediorumPathUsed":88888,"moveFromBlobStorePrefix":"","peerHealths":null,"replicationFactor":3,"self":{"host":"test1.com","wallet":"0xtest1"},"service":"content-node","signers":[{"host":"test2.com","wallet":"0xtest2"}],"spID":1,"spOwnerWallet":"0xtest1","startedAt":"2023-06-07T08:25:30Z","storeAll":false,"trustedNotifier":{"email":"dmca@notifier.com","endpoint":"http://notifier.com","wallet":"0xnotifier"},"trustedNotifierId":1,"unreachablePeers":null,"uploadsCount":0,"uploadsCountErr":"","version":"1.0.0","wallet_is_registered":false}`
dataBytes, err := json.Marshal(data)
if err != nil {
t.Error(err)
Expand Down
27 changes: 17 additions & 10 deletions mediorum/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ type MediorumServer struct {
uploadsCount int64
uploadsCountErr string

isSeeding bool
isSeeding bool
isAudiusdManaged bool

peerHealthsMutex sync.RWMutex
peerHealths map[string]*PeerHealth
Expand Down Expand Up @@ -127,6 +128,11 @@ func New(config MediorumConfig) (*MediorumServer, error) {
config.Env = env
}

var isAudiusdManaged bool
if audiusdGenerated := os.Getenv("AUDIUS_D_GENERATED"); audiusdGenerated != "" {
isAudiusdManaged = true
}

if config.VersionJson == (VersionJson{}) {
log.Fatal(".version.json is required to be bundled with the mediorum binary")
}
Expand Down Expand Up @@ -249,15 +255,16 @@ func New(config MediorumConfig) (*MediorumServer, error) {
echoServer.Use(middleware.Gzip())

ss := &MediorumServer{
echo: echoServer,
bucket: bucket,
crud: crud,
pgPool: pgPool,
reqClient: reqClient,
logger: logger,
quit: make(chan os.Signal, 1),
trustedNotifier: &trustedNotifier,
isSeeding: config.Env == "stage" || config.Env == "prod",
echo: echoServer,
bucket: bucket,
crud: crud,
pgPool: pgPool,
reqClient: reqClient,
logger: logger,
quit: make(chan os.Signal, 1),
trustedNotifier: &trustedNotifier,
isSeeding: config.Env == "stage" || config.Env == "prod",
isAudiusdManaged: isAudiusdManaged,

peerHealths: map[string]*PeerHealth{},
redirectCache: imcache.New(imcache.WithMaxEntriesOption[string, string](50_000)),
Expand Down
55 changes: 55 additions & 0 deletions monitoring/healthz/src/images/audius_d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion monitoring/healthz/src/pages/Nodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import { SP, useServiceProviders } from '../useServiceProviders'
import { RelTime, timeSince, nanosToReadableDuration } from '../misc'
import './Nodes.css'
const audiusdSvg = new URL('../images/audius_d.svg', import.meta.url).href
const autoUpgradeSvg = new URL('../images/auto_upgrade.svg', import.meta.url).href
const dockerSvg = new URL('../images/docker.svg', import.meta.url).href
const fileBackendSvg = new URL('../images/file_disk.svg', import.meta.url).href
Expand Down Expand Up @@ -173,6 +174,7 @@ function HealthRow({ isContent, sp, isStaging }: { isContent: boolean; sp: SP, i
const isDbLocalhost = health.database_is_localhost || health.isDbLocalhost
const autoUpgradeEnabled =
health.auto_upgrade_enabled || health.autoUpgradeEnabled
const audiusdManaged = health.audius_d_managed || health.isAudiusdManaged
const getPeers = (str: string | undefined) => {
if (str === undefined) return 'chain health undefined'
const match = str.match(/Peers: (\d+)\./)
Expand Down Expand Up @@ -225,7 +227,11 @@ function HealthRow({ isContent, sp, isStaging }: { isContent: boolean; sp: SP, i
<td className="whitespace-nowrap px-3 py-5 text-sm flex flex-col">
<div className="flex items-center">
<span className="h-5 w-5 flex-shrink-0">
{autoUpgradeEnabled && <img
{audiusdManaged && <img
className="h-5 w-5"
src={audiusdSvg}
alt="audius-d"
/> || autoUpgradeEnabled && <img
className="h-5 w-5 dark:filter dark:invert"
src={autoUpgradeSvg}
alt="Auto-upgrade"
Expand Down
Loading

0 comments on commit 031e79a

Please sign in to comment.