bitfab 0.63.0 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bitfab/cloudReplay.py +889 -707
- data/lib/bitfab/cloud_replay_cli.rb +12 -6
- data/lib/bitfab/replay_cli.rb +2 -2
- data/lib/bitfab/version.rb +1 -1
- metadata +1 -1
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
4
|
require "open3"
|
|
5
|
+
require "rbconfig"
|
|
5
6
|
require "tempfile"
|
|
6
7
|
|
|
7
8
|
module Bitfab
|
|
8
9
|
module CloudReplayCli
|
|
9
|
-
|
|
10
|
+
HINT = "Add --cloud to run the same replay on GitHub Actions; bitfab-replay --cloud --help explains it."
|
|
10
11
|
|
|
11
12
|
HELPER = File.expand_path("cloudReplay.py", __dir__)
|
|
13
|
+
REPLAY_EXECUTABLE = File.expand_path("../../exe/bitfab-replay", __dir__)
|
|
12
14
|
|
|
13
15
|
module_function
|
|
14
16
|
|
|
@@ -17,13 +19,13 @@ module Bitfab
|
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
def run(argv:, stdout:, stderr:, helper: HELPER)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
env = {
|
|
23
|
+
"BITFAB_REPLAY_COMMAND" => JSON.generate([RbConfig.ruby, REPLAY_EXECUTABLE]),
|
|
24
|
+
"BITFAB_SDK_LANGUAGE" => "ruby"
|
|
25
|
+
}
|
|
24
26
|
Tempfile.create("bitfab-cloud-output") do |file|
|
|
25
27
|
result_status = nil
|
|
26
|
-
Open3.popen3("python3", helper, *argv) do |input, output_stream, error_stream, thread|
|
|
28
|
+
Open3.popen3(env, "python3", helper, *argv) do |input, output_stream, error_stream, thread|
|
|
27
29
|
input.close
|
|
28
30
|
reader = Thread.new { IO.copy_stream(output_stream, file) }
|
|
29
31
|
error_stream.each_line { |line| stderr.write(line) }
|
|
@@ -36,6 +38,10 @@ module Bitfab
|
|
|
36
38
|
stdout.puts result_output unless result_output.strip.empty?
|
|
37
39
|
raise ArgumentError, "Cloud replay failed. See diagnostics; use the execution UUID to recover a dispatched job."
|
|
38
40
|
end
|
|
41
|
+
if argv.include?("--help") || argv.include?("-h")
|
|
42
|
+
stdout.write result_output
|
|
43
|
+
return {}
|
|
44
|
+
end
|
|
39
45
|
result = JSON.parse(result_output)
|
|
40
46
|
stdout.puts JSON.pretty_generate(result)
|
|
41
47
|
result
|
data/lib/bitfab/replay_cli.rb
CHANGED
|
@@ -7,7 +7,7 @@ module Bitfab
|
|
|
7
7
|
# Installed command that loads a project-owned registry module.
|
|
8
8
|
module ReplayCommand
|
|
9
9
|
USAGE = "Usage: bitfab-replay --registry <path> <pipeline> [replay options]"
|
|
10
|
-
HELP = "#{USAGE}\nRun bitfab-replay --registry <path> --help to list replay options.\n#{CloudReplayCli::
|
|
10
|
+
HELP = "#{USAGE}\nRun bitfab-replay --registry <path> --help to list replay options.\n#{CloudReplayCli::HINT}"
|
|
11
11
|
|
|
12
12
|
module_function
|
|
13
13
|
|
|
@@ -26,7 +26,7 @@ module Bitfab
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def main(argv: ARGV, stdout: $stdout, stderr: $stderr)
|
|
29
|
-
if (argv.include?("--help") || argv.include?("-h")) && !argv.include?("--registry")
|
|
29
|
+
if (argv.include?("--help") || argv.include?("-h")) && !argv.include?("--registry") && !CloudReplayCli.cloud?(argv)
|
|
30
30
|
stdout.puts HELP
|
|
31
31
|
return 0
|
|
32
32
|
end
|
data/lib/bitfab/version.rb
CHANGED