exercism-config 0.75.0 → 0.76.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/exercism/tooling_job.rb +36 -9
- data/lib/exercism_config/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 382f12024996ba4f2a1485f87a77de080f1e472a2d7e46eee1cdbf0eb2893036
|
4
|
+
data.tar.gz: f8f5d09624c88131b6d1ba0183b26e4ecd355d9b3c48b85bef4f2fa5bc815529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8ce0815630303f05a29ee780512f7177fb0ec4eb8f6ffcbd88aa2e9a33b08fbfef972311a5b8aaba928596a8aabe189a38c5f8850bd18ba8ef8d660c4c6a342
|
7
|
+
data.tar.gz: e99dd955ba1143efbf1f8ac76257df59e386fc27cdd050b6508c9bb37ef4121f7098b8bdaa66d736158f9a911cf1a666c60d4893e33955540c32bfab07e8aee0
|
data/lib/exercism/tooling_job.rb
CHANGED
@@ -55,7 +55,7 @@ module Exercism
|
|
55
55
|
data.key?(meth) || super
|
56
56
|
end
|
57
57
|
|
58
|
-
def method_missing(meth)
|
58
|
+
def method_missing(meth, *args)
|
59
59
|
super unless respond_to_missing?(meth)
|
60
60
|
|
61
61
|
data[meth]
|
@@ -69,7 +69,7 @@ module Exercism
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
def executed!(status, output
|
72
|
+
def executed!(status, output)
|
73
73
|
redis = Exercism.redis_tooling_client
|
74
74
|
redis.multi do
|
75
75
|
redis.lrem(key_for_queued, 1, id)
|
@@ -80,8 +80,7 @@ module Exercism
|
|
80
80
|
"job:#{id}",
|
81
81
|
data.merge(
|
82
82
|
execution_status: status,
|
83
|
-
execution_output: output
|
84
|
-
execution_exception: exception
|
83
|
+
execution_output: output
|
85
84
|
).to_json
|
86
85
|
)
|
87
86
|
end
|
@@ -91,7 +90,8 @@ module Exercism
|
|
91
90
|
redis = Exercism.redis_tooling_client
|
92
91
|
redis.multi do
|
93
92
|
redis.lrem(key_for_executed, 1, id)
|
94
|
-
redis.
|
93
|
+
redis.del("job:#{id}")
|
94
|
+
redis.del("submission:#{data[:submission_uuid]}:#{data[:type]}")
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -107,17 +107,44 @@ module Exercism
|
|
107
107
|
id == other.id
|
108
108
|
end
|
109
109
|
|
110
|
-
def
|
111
|
-
|
110
|
+
def store_stdout!(content)
|
111
|
+
write_s3_file!(:stdout, content)
|
112
|
+
end
|
113
|
+
|
114
|
+
def store_stderr!(content)
|
115
|
+
write_s3_file!(:stderr, content)
|
116
|
+
end
|
117
|
+
|
118
|
+
def store_metadata!(content)
|
119
|
+
write_s3_file!('metadata.json', content.to_json)
|
112
120
|
end
|
113
121
|
|
114
122
|
def stdout
|
115
|
-
read_s3_file(
|
123
|
+
read_s3_file(:stdout)
|
124
|
+
end
|
125
|
+
|
126
|
+
def stderr
|
127
|
+
read_s3_file(:stderr)
|
128
|
+
end
|
129
|
+
|
130
|
+
def metadata
|
131
|
+
JSON.parse(read_s3_file('metadata.json'))
|
132
|
+
rescue JSON::ParserError
|
133
|
+
{}
|
116
134
|
end
|
117
135
|
|
118
136
|
private
|
119
137
|
attr_reader :data
|
120
138
|
|
139
|
+
def write_s3_file!(name, content)
|
140
|
+
Exercism.s3_client.put_object(
|
141
|
+
bucket: s3_bucket_name,
|
142
|
+
key: "#{s3_folder}/#{name}",
|
143
|
+
body: content,
|
144
|
+
acl: 'private'
|
145
|
+
)
|
146
|
+
end
|
147
|
+
|
121
148
|
def read_s3_file(name)
|
122
149
|
Exercism.s3_client.get_object(
|
123
150
|
bucket: s3_bucket_name,
|
@@ -137,7 +164,7 @@ module Exercism
|
|
137
164
|
Exercism.config.aws_tooling_jobs_bucket
|
138
165
|
end
|
139
166
|
|
140
|
-
%w[queued locked executed
|
167
|
+
%w[queued locked executed cancelled].each do |key|
|
141
168
|
ToolingJob.singleton_class.class_eval do
|
142
169
|
define_method "key_for_#{key}" do
|
143
170
|
Exercism.env.production? ? key : "#{Exercism.env}:#{key}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exercism-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.76.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Walker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-dynamodb
|