- add script to query matterhorn for status on ingest and processing
- add sample cron script to process matterhorn
This commit is contained in:
parent
d31cb4d258
commit
e9f9079827
@ -1,3 +1,4 @@
|
||||
scripts_dir: /home/firstuser/dev/source/bigbluebutton/record-and-playback/rap/scripts
|
||||
recording_dir: /var/bigbluebutton/recording
|
||||
raw_audio_src: /var/freeswitch/meetings
|
||||
raw_video_src: /usr/share/red5/webapps/video/streams
|
||||
|
67
record-and-playback/rap/scripts/ingest-status.rb
Executable file
67
record-and-playback/rap/scripts/ingest-status.rb
Executable file
@ -0,0 +1,67 @@
|
||||
# -------------------------------------------------------------
|
||||
# To run this script we need:
|
||||
# --------------------------------------------------------------
|
||||
# - Mediapackage parameters like title, creator and subject
|
||||
# to search workflows in Matterhorn and get their status.
|
||||
#
|
||||
# - Matterhorn server url, user and password.
|
||||
#
|
||||
# -------------------------------------------------------------
|
||||
# Script output:
|
||||
# --------------------------------------------------------------
|
||||
# STATUS: INSTANTIATED
|
||||
# STATUS: RUNNING
|
||||
# STATUS: SUCCEEDED
|
||||
#
|
||||
|
||||
require "rubygems"
|
||||
require "curb"
|
||||
require "nokogiri"
|
||||
require "cgi"
|
||||
require 'trollop'
|
||||
require 'yaml'
|
||||
|
||||
opts = Trollop::options do
|
||||
opt :title, :type => String
|
||||
opt :creator, :type => String
|
||||
opt :subject, :type => String
|
||||
end
|
||||
|
||||
title = opts[:title]
|
||||
creator = opts[:creator]
|
||||
subject = opts[:subject]
|
||||
|
||||
# This script lives in scripts while matterhorn.yml lives in scripts/
|
||||
matt_props = YAML::load(File.open('matterhorn.yml'))
|
||||
rest_server = matt_props['rest_server']
|
||||
|
||||
#Zipped file parameters to search a workflow in Matterhorn
|
||||
title = "Business Ecosystem"
|
||||
creator = "Richard Alam"
|
||||
subject = "TTMG 5001"
|
||||
|
||||
#Create URI
|
||||
encoded_params = CGI.escape("sort=DATE_CREATED_DESC&title=#{title}&creator=#{creator}&subject=#{subject}")
|
||||
|
||||
#Request Authentication
|
||||
c = Curl::Easy.new("#{rest_server}/workflow/instances.xml?#{encoded_params}")
|
||||
c.http_auth_types = :digest
|
||||
c.username = 'matterhorn_system_account'
|
||||
c.password = 'CHANGE_ME'
|
||||
c.headers["X-Requested-Auth"] = "Digest"
|
||||
|
||||
#Ask for workflow status to Matterhorn.
|
||||
#Stops when status is SUCCEEDED.
|
||||
state = ""
|
||||
begin
|
||||
sleep 20
|
||||
tmp = state
|
||||
c.perform
|
||||
xml_response = c.body_str
|
||||
xml_doc = Nokogiri::XML(xml_response)
|
||||
workflow = xml_doc.xpath("//workflow")
|
||||
state = workflow[-1].attribute('state')
|
||||
if !tmp.to_str.eql? state.to_str
|
||||
puts "STATUS: " + state
|
||||
end
|
||||
end while !state.to_str.eql? "SUCCEEDED"
|
@ -1,3 +1,6 @@
|
||||
matterhorn_server: root@ec2-50-16-8-19.compute-1.amazonaws.com
|
||||
matterhorn_inbox: /opt/matterhorn/felix/inbox/
|
||||
matterhorn_key: /home/firstuser/.ssh/matt_id_rsa
|
||||
scp_server: ec2-50-16-8-19.compute-1.amazonaws.com
|
||||
scp_user: root
|
||||
scp_key: /home/firstuser/.ssh/matt_id_rsa
|
||||
scp_inbox: /opt/matterhorn/felix/inbox/
|
||||
rest_server: http://ec2-50-16-8-19.compute-1.amazonaws.com:8080
|
||||
|
||||
|
9
record-and-playback/rap/scripts/process-cron.sh
Executable file
9
record-and-playback/rap/scripts/process-cron.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
cd /home/firstuser/dev/source/bigbluebutton/record-and-playback/rap/scripts
|
||||
ruby process/matterhorn.rb -m 2364d22e-b650-40b4-9c7c-e72f66b093ef
|
||||
ruby publish/matterhorn.rb -m 2364d22e-b650-40b4-9c7c-e72f66b093ef
|
||||
|
@ -12,9 +12,10 @@ meeting_id = opts[:meeting_id]
|
||||
# This script lives in scripts/archive/steps while matterhorn.yaml lives in scripts/
|
||||
bbb_props = YAML::load(File.open('bigbluebutton.yml'))
|
||||
matt_props = YAML::load(File.open('matterhorn.yml'))
|
||||
matt_server = matt_props['matterhorn_server']
|
||||
matt_inbox = matt_props['matterhorn_inbox']
|
||||
matt_key = matt_props['matterhorn_key']
|
||||
scp_server = matt_props['scp_server']
|
||||
scp_inbox = matt_props['scp_inbox']
|
||||
scp_key = matt_props['scp_key']
|
||||
scp_user = matt_props['scp_user']
|
||||
recording_dir = bbb_props['recording_dir']
|
||||
|
||||
process_dir = "#{recording_dir}/process/matterhorn/#{meeting_id}"
|
||||
@ -37,7 +38,7 @@ Dir.chdir(target_dir) do
|
||||
end
|
||||
puts Dir.pwd
|
||||
|
||||
cmd = "scp -i #{matt_key} #{target_dir}/#{meeting_id}.zip #{matt_server}:#{matt_inbox}"
|
||||
cmd = "scp -i #{scp_key} #{target_dir}/#{meeting_id}.zip #{scp_user}@#{scp_server}:#{scp_inbox}"
|
||||
puts cmd
|
||||
Open3.popen3(cmd) do | stdin, stdout, stderr|
|
||||
p $?.exitstatus
|
||||
|
Loading…
Reference in New Issue
Block a user