-
Notifications
You must be signed in to change notification settings - Fork 0
/
recombine-zips.rb
26 lines (24 loc) · 6.23 KB
/
recombine-zips.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'yaml'
require 'docker'
input = ["auto-grader-capstone/tlyman_test-assignment_2238968_1547314076-ta-new", "auto-grader-capstone/nkubatin_test-assignment_2238844_1547314075-ta-new", "auto-grader-capstone/alanadvorkin_test-assignment_2238911_1547314073-ta-new", "auto-grader-capstone/bscott_test-assignment_2238949_1547314078-ta-new", "auto-grader-capstone/aaronstone_test-assignment_2238832_1547314079-ta-new", "auto-grader-capstone/ataber_test-assignment_2238882_1547314079-ta-new", "auto-grader-capstone/jialinzh_test-assignment_2238835_1547314080-ta-new", "auto-grader-capstone/eberleant_test-assignment_2238936_1547314072-ta-new", "auto-grader-capstone/ztbartolome_test-assignment_2238874_1547314072-ta-new", "auto-grader-capstone/djcurley_test-assignment_2238880_1547314073-ta-new", "auto-grader-capstone/jbrandon_test-assignment_2238823_1547314072-ta-new", "auto-grader-capstone/arjunalbert_test-assignment_2238943_1547314072-ta-new", "auto-grader-capstone/matthewchen_test-assignment_2238887_1547314072-ta-new", "auto-grader-capstone/cjadams698_test-assignment_2238955_1547314071-ta-new", "auto-grader-capstone/mdev_test-assignment_2238842_1547314073-ta-new", "auto-grader-capstone/yaeleiger_test-assignment_2238815_1547314073-ta-new", "auto-grader-capstone/aevans21_test-assignment_2238849_1547314073-ta-new", "auto-grader-capstone/aevard_test-assignment_2238869_1547314073-ta-new", "auto-grader-capstone/elazare_test-assignment_2238950_1547314073-ta-new", "auto-grader-capstone/mgadgil_test-assignment_2238941_1547314074-ta-new", "auto-grader-capstone/jcfreedman_test-assignment_2238881_1547314074-ta-new", "auto-grader-capstone/achandaghosh_test-assignment_2238836_1547314074-ta-new", "auto-grader-capstone/nkenon_test-assignment_2238929_1547314075-ta-new", "auto-grader-capstone/elag98_test-assignment_2238888_1547314074-ta-new", "auto-grader-capstone/afleishaker_test-assignment_2238885_1547314073-ta-new", "auto-grader-capstone/kougasiana_test-assignment_2238895_1547314075-ta-new", "auto-grader-capstone/mkim99_test-assignment_2238868_1547314075-ta-new", "auto-grader-capstone/casperlk_test-assignment_2238932_1547314076-ta-new", "auto-grader-capstone/egreszes_test-assignment_2238970_1547314075-ta-new", "auto-grader-capstone/dennisli_test-assignment_2238919_1547314076-ta-new", "auto-grader-capstone/jiangzhiyun_test-assignment_2238859_1547314075-ta-new", "auto-grader-capstone/fredmendoza_test-assignment_2238962_1547314077-ta-new", "auto-grader-capstone/epatt_test-assignment_2238813_1547314077-ta-new", "auto-grader-capstone/dlay_test-assignment_2238822_1547314076-ta-new", "auto-grader-capstone/apitha_test-assignment_2238953_1547314077-ta-new", "auto-grader-capstone/dsastry_test-assignment_2238867_1547314078-ta-new", "auto-grader-capstone/ar226_test-assignment_2238845_1547314077-ta-new", "auto-grader-capstone/msilveira66_test-assignment_2238969_1547314078-ta-new", "auto-grader-capstone/drubio_test-assignment_2238853_1547314078-ta-new", "auto-grader-capstone/jaspervhr_test-assignment_2238923_1547314077-ta-new", "auto-grader-capstone/jsmith2021_test-assignment_2238964_1547314078-ta-new", "auto-grader-capstone/jsoohoo_test-assignment_2238918_1547314078-ta-new", "auto-grader-capstone/jtstamand_test-assignment_2238901_1547314079-ta-new", "auto-grader-capstone/astien97_test-assignment_2238847_1547314079-ta-new", "auto-grader-capstone/wangjiaqi2017_test-assignment_2238934_1547314079-ta-new", "auto-grader-capstone/yuewang_test-assignment_2238944_1547314080-ta-new", "auto-grader-capstone/bknesbitt_test-assignment_2238917_1547314077-ta-new", "auto-grader-capstone/danaxa_test-assignment_2238948_1547314072-ta-new", "auto-grader-capstone/mdodell_test-assignment_2238909_1547314073-ta-new", "auto-grader-capstone/alanh0860_test-assignment_2238898_1547314075-ta-new", "auto-grader-capstone/shuminchen_test-assignment_2238926_1547314073-ta-new", "auto-grader-capstone/afong_test-assignment_2238947_1547314073-ta-new", "auto-grader-capstone/nag1298_test-assignment_2238843_1547314074-ta-new", "auto-grader-capstone/emilykut_test-assignment_2238834_1547314076-ta-new", "auto-grader-capstone/ruoshiliu_test-assignment_2238811_1547314076-ta-new", "auto-grader-capstone/jamarkanthony_test-assignment_2238900_1547314076-ta-new", "auto-grader-capstone/vlauffer_test-assignment_2238826_1547314076-ta-new", "auto-grader-capstone/mmillendorf_test-assignment_2238925_1547314077-ta-new", "auto-grader-capstone/thomasj_test-assignment_2238928_1547314077-ta-new", "auto-grader-capstone/h20park_test-assignment_2238931_1547314077-ta-new", "auto-grader-capstone/apenso_test-assignment_2238884_1547314077-ta-new", "auto-grader-capstone/mitchellryan99_test-assignment_2238899_1547314077-ta-new", "auto-grader-capstone/sruditsky_test-assignment_2238871_1547314078-ta-new", "auto-grader-capstone/arubin_test-assignment_2238951_1547314078-ta-new", "auto-grader-capstone/bsiege_test-assignment_2238952_1547314078-ta-new", "auto-grader-capstone/tlsimala_test-assignment_2238897_1547314078-ta-new", "auto-grader-capstone/xinruis_test-assignment_2238837_1547314078-ta-new", "auto-grader-capstone/jspear_test-assignment_2238862_1547314079-ta-new", "auto-grader-capstone/michaelsun_test-assignment_2238920_1547314079-ta-new", "auto-grader-capstone/ctran_test-assignment_2238819_1547314079-ta-new", "auto-grader-capstone/zwang_test-assignment_2238940_1547314079-ta-new", "auto-grader-capstone/nwheeler_test-assignment_2238959_1547314080-ta-new", "auto-grader-capstone/engarde_test-assignment_2238908_1547314080-ta-new"]
YAML.load(File.open('local_env.yml')).each do |key, value|
ENV[key.to_s] = value
end
SECRET_KEY = ENV['SECRET_KEY']
ACCESS_KEY = ENV['ACCESS_KEY']
Excon.defaults[:write_timeout] = 1000
Excon.defaults[:read_timeout] = 1000
puts :loaded
Docker.url = 'tcp://localhost:2375'
image = Docker::Image.build_from_dir('./unzip-and-recombine') do |msg|
puts msg
end
puts :container_created
container = Docker::Container.create('Image' => image.id,
'Env' => ["AWS_SECRET_ACCESS_KEY=#{SECRET_KEY}", "AWS_ACCESS_KEY_ID=#{ACCESS_KEY}"],
'Cmd' => ['bash', 'unzip-and-recombine.sh', 'testing', 'auto-grader-capstone'] + input)
puts :container_starting
# container.tap(&:start).attach { |stream, chunk| puts "#{stream}: #{chunk}" }
thread = Thread.new { container.attach { |stream, chunk| puts "#{stream}: #{chunk}" } }
container.start
thread.join