exercism-config 0.76.0 → 0.80.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/exercism_config.gemspec +1 -0
- data/lib/exercism/tooling_job.rb +7 -4
- 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
- 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: 9028a8ef38a64c4fbc99ebf5830082b4d01eb5fcd57f3ba3c71be173abacb50c
|
4
|
+
data.tar.gz: 704f3be682e8151296104648540bb0153fe5725449593d2702c807ea41dbc3b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e688f9269fd4408fb898d9b516783a4cac653a5729bd702bbeccf84e4bec5e239a915c8ca5acd68ca0dc43dc204b8f955efa18583ac1845b68f07952ff5985c
|
7
|
+
data.tar.gz: 5c8340deea246d5588a82a167c33f64219590d7d1168b4839ceec89486109666db6683018e74294bb7d52ca4fd678fb7292fbec5adfe11b24f260c59182e9acc
|
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
@@ -5,9 +5,11 @@ module Exercism
|
|
5
5
|
|
6
6
|
extend Mandate::Memoize
|
7
7
|
|
8
|
-
def self.create!(type, submission_uuid, language, exercise,
|
8
|
+
def self.create!(type, submission_uuid, language, exercise,
|
9
|
+
run_in_background: false,
|
10
|
+
**data)
|
9
11
|
job_id = SecureRandom.uuid.tr('-', '')
|
10
|
-
data
|
12
|
+
data.merge!(
|
11
13
|
id: job_id,
|
12
14
|
submission_uuid: submission_uuid,
|
13
15
|
type: type,
|
@@ -16,13 +18,14 @@ module Exercism
|
|
16
18
|
created_at: Time.now.utc.to_i
|
17
19
|
)
|
18
20
|
|
21
|
+
queue_key = run_in_background ? key_for_queued_for_background_processing : key_for_queued
|
19
22
|
redis = Exercism.redis_tooling_client
|
20
23
|
redis.multi do
|
21
24
|
redis.set(
|
22
25
|
"job:#{job_id}",
|
23
26
|
data.to_json
|
24
27
|
)
|
25
|
-
redis.rpush(
|
28
|
+
redis.rpush(queue_key, job_id)
|
26
29
|
redis.set("submission:#{submission_uuid}:#{type}", job_id)
|
27
30
|
end
|
28
31
|
new(job_id, data)
|
@@ -164,7 +167,7 @@ module Exercism
|
|
164
167
|
Exercism.config.aws_tooling_jobs_bucket
|
165
168
|
end
|
166
169
|
|
167
|
-
%w[queued locked executed cancelled].each do |key|
|
170
|
+
%w[queued queued_for_background_processing locked executed cancelled].each do |key|
|
168
171
|
ToolingJob.singleton_class.class_eval do
|
169
172
|
define_method "key_for_#{key}" do
|
170
173
|
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:
|
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.80.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-12-02 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
|