stores files and stuff
If you want to move data between providers (e.g., from your disk to AWS or GCS), do the following:
- Set
AUDIUS_STORAGE_DRIVER_URL_MOVE_FROM
(inaudius-docker-compose/creator-node/override.env
) to your current provider (most likely local disk -"file:///tmp/mediorum/blobs"
). - Set
AUDIUS_STORAGE_DRIVER_URL
to the new provider (see below for configuration and to make sure you have the right credentials). - Start the server and monitor logs for errors. Once you see the message "Finished moving files between buckets" and the health check responds again, then the migration is complete. NOTE: this may take hours to complete.
- Remove the
AUDIUS_STORAGE_DRIVER_URL_MOVE_FROM
env var and restart the server. You're good to go!
- Createa new Service Account and JSON key for it.
scp
the key onto your server andmv
the key to/var/k8s/mediorum/google-application-credentials.json
. - Create a GCS bucket:
- Non-public access (enforce public access prevention)
- Uniform access control
- No protection tools
- In the bucket permissions, grant access for Storage Legacy Bucket Owner and Storage Legacy Object Owner for the Service Account (set the principal to the Service Account’s email).
- Set these env vars in
audius-docker-compose/creator-node/override.env
:GOOGLE_APPLICATION_CREDENTIALS="/tmp/mediorum/google-application-credentials.json"
AUDIUS_STORAGE_DRIVER_URL="gs://<your bucket's name>"
- Ensure that you block public access for your bucket.
- Create an IAM policy for the bucket with these minimum permissions:
- Under
Read
chooseGetObject
andGetObjectAttributes
. - Under
Write
chooseDeleteObject
andPutObject
. - Under
List
chooseListBucket
. - Click
Add Arn
, enter the bucket name, and check the box forAny object name
.
- Under
- Make an IAM user and group with this policy, and in the user/group click “Create access key” and select “Third-party service.”
- Set the environment variables in your node’s
audius-docker-compose/creator-node/override.env
file accordingly:AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION
AUDIUS_STORAGE_DRIVER_URL="s3://<your_bucket_name>"
-
make tools
- install tools (make sure~/go/bin
is in path) -
make pg.bounce
- starts postgres via docker-compose -
make
- starts single process dev cluster -
make test
visit http://localhost:1991/
with make dev2
you can use goreman
to start and stop servers:
make dev2
- starts servers as separate processesgoreman run stop m2
goreman run start m2
Uploading a test file:
curl -v -XPOST -F template=audio -F files=@steve_drunk_bass.mp3 http://localhost:1991/uploads
docker build . -t mediorum
docker run -it -p 1991:1991 mediorum
make build.fast