...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
STOP. This page is deprecated. Go Here
Configuring Video Uploads1
- Start a sandbox building.
- Make sure to build with basic auth off.
- You'll need an AWS account:
- If you're not an admin, you will need to request EC2 access (full), S3 access (full), and a functioning ssh key pair.
- Login to AWS, go to S3 storage service.
- Create
threefour buckets.- All s3 buckets must have unique names, but theme the names roughly for storage, ingest, images, and delivery.
- Note the bucket names.
Under the ingest and delivery buckets'
Properties > Permissions > Edit CORS Configuration
, add this CORS configuration (making sure to change the ALLOWEDORIGIN field to the salient sandbox URL:Code Block <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>https://${SANDBOX STUDIO URL}</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>HEAD</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>*</AllowedHeader> </CORSRule> </CORSConfiguration>
- In your delivery bucket, under
'Properties' > 'Permissions'
, addGrantee: 'Everyone'
and check'List'
- If you have created a new AWS account, or wish to limit access, the following steps are recommended:
- In the AWS IAM security service, add a new user.
Add the new user to a new Group, with (at least) the
AmazonS3FullAccess
andAmazonEC2FullAccess
policy attached.- Retrieve the
IAM user key
andIAM user secret
, note them for later
- Once the sandbox is completed building, access your sandbox via ssh.
Change these settings in
/edx/app/edxapp/cms.env.json
Code Block "FEATURES": { ... "ENABLE_VIDEO_UPLOAD_PIPELINE": true, ... },
and
Code Block ... VIDEO_UPLOAD_PIPELINE = { "BUCKET": "${S3 bucket name}", "ROOT_PATH": "" // LEAVE THIS BLANK }, ...
and
Code Block ... "VIDEO_IMAGE_SETTINGS": { "DIRECTORY_PREFIX": "video-images/", ... "STORAGE_KWARGS": { "bucket": "${S3 bucket name}", "custom_domain": "s3.amazonaws.com/${S3 bucket name}", ... }, ... }, ... } ...
REMOVED:
Change these settings in/edx/app/edxapp/cms.auth.json
- While you're at it, create a superuser (The provided example sets 'staff' as a superuser, which is just fine)
- Restart your servers and workers.
Now log in, via web browser (utilizing a staff-access account) to your sandbox studio interface.
- Either create a unique course or navigate to one of the stock courses.
- In the course you wish to use, navigate to
Settings > Advanced Settings
At the bottom of the page, in the
"Video Upload Credentials"
field, add the following configuration (don't neglect the brackets).2Code Block { "course_video_upload_token": "xxxx" }
...
- If you haven't, access your sandbox via ssh and create a superuser.
- Log in to the django admin (usually ${YOUR_SANDBOX_URL}/admin)
Go to Oauth2 > Clients
- Click
'Add Clients'
(rounded button, upper right hand corner) - In the window, add the following information:
- User: Staff (usually pk=5, but the magnifying glass icon can help)
- Name: ${ANY RANDOM STRING} (e.g. 'veda_sandbox')
- URL: ${YOUR_SANDBOX_URL}/api/val/v0
- Redirect uris: ${YOUR_SANDBOX_URL}
- Client ID: autofilled, make note of this
- Client Secret: autofilled, make note of this
- Client Type: Confidential (Web Application)
- Logout URI: (can leave blank)
- Make Note of the Client ID and Client Secret, as these will be needed later
- Remember to Save!
...
- Launch an EC2 instance.
- Any Linux AMI will do, we recommend the free-tier eligible AWS linux instance (ami-0b33d91d).
- Be sure to have more than 6 GB of storage or so. The max upload size for a file is 5g, so you just need a li'l extra to deal with the various unmentionables in the codebase.
- Any size instance is acceptable, just be prepared to sit around and wait a little longer for your completed encodes if you go small.
- For production VEDA we use the g2.2XL GPU nodes, (many $$$) but for the purposes of a sandbox a t2.micro is just fine.
- Click through until you get to "Step 6: Configure Security Group".
- Allow ssh access from your IP
- Launch!
- Any Linux AMI will do, we recommend the free-tier eligible AWS linux instance (ami-0b33d91d).
- ssh into your newly launched instance.
Get the machine ready and clone the necessary repos:
Code Block language bash linenumbers true sudo yum -y update sudo yum -y install gcc sudo yum -y install git git clone https://github.com/yro/openveda git clone https://github.com/yro/v_videocompile git clone https://github.com/yro/vhls
Download and compile a static build of ffmpeg:
Code Block language bash linenumbers true cd v_videocompile sudo python setup.py install v_videocompile
Install the HLS dependencies:
Code Block language bash linenumbers true cd ~/vhls sudo python setup.py install
Finally, install openveda:
Code Block language bash linenumbers true cd ~/openveda # we're going to be altering the configurations, so this modified command: sudo python setup.py develop
Now we're ready to configure. Remember all of those keys, secret keys, passwords, and access tokens I asked you to take a note of? Now is where they shine. Openveda has a config wizard that should walk you through it:
Code Block language bash linenumbers true openveda -config
Follow the prompts. You will need the following information:
VEDA Working Directory (leave blank)
AWS S3 Storage Bucket Name
- Studio Ingest Bucket Name (this says 'optional', but for you it is not)
- AWS S3 Deliver Bucket Name (streaming bucket)
- AWS S3 Images Bucket Name
- VAL Token URL (this is also not optional) < "https://{YOUR_SANDBOX_URL}/oauth2/access_token"
- VAL API URL < "https://{YOUR_SANDBOX_URL}/api/val/v0/videos"
- VAL Username (This will be 'staff' if you have set staff as the authorized VAL user)
- VAL Password (Your authorized VAL user's studio password)
- VAL Client ID
- VAL Secret Key
...