exercism-config 0.74.0 → 0.78.0
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/README.md +2 -0
- data/exercism_config.gemspec +1 -0
- data/lib/exercism/tooling_job.rb +36 -9
- data/lib/exercism-config.rb +17 -0
- data/lib/exercism_config/version.rb +1 -1
- data/settings/ci.yml +3 -0
- data/settings/docker.yml +3 -0
- data/settings/local.yml +3 -0
- data/settings/secrets.yml +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37e5adfdefe004d2528a29254e0e0f2ba872c846f43ef4f87df2e7a5c9fca1f4
|
|
4
|
+
data.tar.gz: ec9223378a44a65942dfe91c26cc3ab900058071a1a5a31ccca1895dcb755d61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c20da1f12c29cd611d92d73c7e6dcf847dbb577601dcaa3d728d1642fb8ca9b58761114c9f2e4063f9b018412d400be9daf466f7ca37e1ece726aae212793783
|
|
7
|
+
data.tar.gz: 5aa552a5137910b03e564775868cb52ee7afcbbba2162d32721bfaf864a1008b3be172e51c168fd3fec71e9565c73dd00f1dc965718d93992b6b42818df385a6
|
data/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Exercism.config.mysql_port
|
|
|
23
23
|
Exercism.config.spi_url
|
|
24
24
|
Exercism.config.tooling_orchestrator_url
|
|
25
25
|
Exercism.config.language_server_url
|
|
26
|
+
Exercism.config.opensearch_host
|
|
26
27
|
|
|
27
28
|
# Secrets
|
|
28
29
|
Exercism.secrets.github_access_token
|
|
@@ -37,6 +38,7 @@ Exercism.dynamodb_client
|
|
|
37
38
|
Exercism.s3_client
|
|
38
39
|
Exercism.ecr_client
|
|
39
40
|
Exercism.octokit_client
|
|
41
|
+
Exercism.opensearch_client
|
|
40
42
|
```
|
|
41
43
|
|
|
42
44
|
## Explanation
|
data/exercism_config.gemspec
CHANGED
|
@@ -40,5 +40,6 @@ Gem::Specification.new do |spec|
|
|
|
40
40
|
# own Gemfile when using this.
|
|
41
41
|
spec.add_development_dependency 'aws-sdk-ecr'
|
|
42
42
|
spec.add_development_dependency 'aws-sdk-s3'
|
|
43
|
+
spec.add_development_dependency 'elasticsearch', '6.8.3'
|
|
43
44
|
spec.add_development_dependency 'redis'
|
|
44
45
|
end
|
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}"
|
data/lib/exercism-config.rb
CHANGED
|
@@ -69,4 +69,21 @@ module Exercism
|
|
|
69
69
|
c.auto_paginate = true
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
|
+
|
|
73
|
+
def self.opensearch_client
|
|
74
|
+
require 'elasticsearch'
|
|
75
|
+
|
|
76
|
+
# For now, we're using the ElasticSearch client, but this needs to be
|
|
77
|
+
# changed to the OpenSearch client once it becomes available
|
|
78
|
+
Elasticsearch::Client.new(
|
|
79
|
+
url: ENV.fetch("OPENSEARCH_HOST", config.opensearch_host),
|
|
80
|
+
user: ENV.fetch("OPENSEARCH_USER", Exercism.env.production? ? nil : "admin"),
|
|
81
|
+
password: ENV.fetch("OPENSEARCH_PASSWORD", Exercism.env.production? ? nil : "admin"),
|
|
82
|
+
transport_options: {
|
|
83
|
+
ssl: {
|
|
84
|
+
verify: Exercism.env.production?
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
end
|
|
72
89
|
end
|
data/settings/ci.yml
CHANGED
|
@@ -37,6 +37,9 @@ efs_repositories_mount_point: "/tmp/exercism/efs/repos"
|
|
|
37
37
|
github_organization: fake-exercism
|
|
38
38
|
github_bot_username: exercism-bot
|
|
39
39
|
|
|
40
|
+
# OpenSearch
|
|
41
|
+
opensearch_host: https://127.0.0.1:9200
|
|
42
|
+
|
|
40
43
|
# Extra things not used in development, but here
|
|
41
44
|
# so that this file can provide a reference
|
|
42
45
|
website_assets_host:
|
data/settings/docker.yml
CHANGED
|
@@ -37,6 +37,9 @@ efs_repositories_mount_point: "/tmp/exercism/efs/repos"
|
|
|
37
37
|
github_organization: fake-exercism
|
|
38
38
|
github_bot_username: exercism-bot
|
|
39
39
|
|
|
40
|
+
# OpenSearch
|
|
41
|
+
opensearch_host: https://opensearch:9200
|
|
42
|
+
|
|
40
43
|
# Extra things not used in development, but here
|
|
41
44
|
# so that this file can provide a reference
|
|
42
45
|
website_assets_host:
|
data/settings/local.yml
CHANGED
|
@@ -37,6 +37,9 @@ efs_repositories_mount_point: "/tmp/exercism/efs/repos"
|
|
|
37
37
|
github_organization: fake-exercism
|
|
38
38
|
github_bot_username: exercism-bot
|
|
39
39
|
|
|
40
|
+
# OpenSearch
|
|
41
|
+
opensearch_host: https://localhost:9200
|
|
42
|
+
|
|
40
43
|
# Extra things not used in development, but here
|
|
41
44
|
# so that this file can provide a reference
|
|
42
45
|
website_assets_host:
|
data/settings/secrets.yml
CHANGED
|
@@ -9,3 +9,4 @@ stripe_secret_key: "sk_test_51IDGMXEoOT0Jqx0UMSRriKkjutiuKVsv8GWUQWqhz4df03e4fuH
|
|
|
9
9
|
stripe_publishable_key: "pk_test_51IDGMXEoOT0Jqx0UcoKlkvB7O0VDvFdCBvOCiWiKv6CkSnkZn7IG6cIHuCWg7cegGogYJSy8WsaKzwFHQqN75T7b00d56MtilB"
|
|
10
10
|
stripe_endpoint_secret: "whsec_rgY246H0vSUw0A9KpDOqsDDgAakEdCCT"
|
|
11
11
|
stripe_recurring_product_id: "prod_Jw8Kqq4QQ0qio7"
|
|
12
|
+
slack_api_token: "some-token"
|
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.78.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-
|
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-dynamodb
|
|
@@ -150,6 +150,20 @@ dependencies:
|
|
|
150
150
|
- - ">="
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '0'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: elasticsearch
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - '='
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: 6.8.3
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - '='
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: 6.8.3
|
|
153
167
|
- !ruby/object:Gem::Dependency
|
|
154
168
|
name: redis
|
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|