-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_sp2.rb
103 lines (85 loc) · 1.96 KB
/
run_sp2.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
def kick image, cmd, config_name, run_opt, noop
cmd = "docker run #{run_opt} --memory=6g --init --rm " +
# "--tmpfs /tmp:exec " +
"-v #{__dir__}/ruby:/home/ko1/ruby " +
"-v #{__dir__}/../:/home/ko1/build-ruby " +
# "-v /tmp:/tmp " +
"--name=#{config_name} --hostname=#{`hostname`.strip}-docker " +
"--cap-add=SYS_PTRACE " +
"-e BUILD_RUBY_WORKING_DIR=/tmp/ruby " +
"#{image} #{cmd}"
puts "kick: #{cmd}"
system cmd unless noop
end
def run image, config_name, noop = false
kick image, "ruby /home/ko1/ruby/boot.rb #{config_name} --incremental --process-num=4", config_name, '-d', noop
end
def run_interractive arg, noop = false
image = 'rubydev:jammy'
kick image, arg, "run_interractive.#{$$}", '-it', noop
end
if ARGV.empty?
# no memory...
# trunk-random3
# trunk-random-repeat
tests = {
'rubydev:jammy' => %w{
trunk-random0
trunk-random1
trunk-random2
trunk-repeat20
trunk-repeat20-asserts
trunk-repeat50
trunk-gc-asserts
trunk-asserts-nopara
trunk-iseq_binary
trunk-O0
trunk-jemalloc
trunk_gcc9
trunk_gcc10
trunk_gcc11
trunk_gcc12
trunk_clang_11
trunk_clang_12
trunk_clang_13
trunk_clang_14
trunk-yjit
master-no-rjit
},
# trunk-yjit-asserts
# master-rjit
}
# clean
if ENV['CLEAN_ALL'] == 'true'
tests.each{|image, tests|
tests.each{|test|
system("docker kill #{test}")
system("ruby ~/ruby/build-ruby/br.rb build #{test} --rm=all")
}
}
exit
end
if ENV['NOOP'] == 'true'
tests.each{|image, tests|
tests.each{|test|
run image, test, true
}
}
exit
end
ps = `docker ps --no-trunc`
tests.each{|image, tests|
tests.each{|test|
if /^(.+#{test}\s+.+)$/ =~ ps
STDERR.puts "#{test} is already launched: #{$1}"
else
run image, test
st = rand(30)
puts "sleep #{st}"
sleep rand(st)
end
}
}
else
run_interractive ARGV.join(' ')
end