exercism-config 0.125.0 → 0.128.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/lib/exercism/tooling_job.rb +11 -13
- data/lib/exercism.rb +11 -0
- data/lib/exercism_config/version.rb +1 -1
- data/settings/ci.yml +4 -0
- data/settings/local.yml +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9845f6e1aefaf682189aa6f969971df25575e05691c415d9cc0c5ca51b208106
|
4
|
+
data.tar.gz: 7e6fb8a52b7086fdf77a94af8a4c0f04da6fdb2d0fad8c53e31012f1b0a88c14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c8196fba32d76652f11cda8b211c3b93959f5ea7cc256398122bbeec509d668304a6a4c50b66c718f27a83e8911e98aa58cba27a1ece02a274b6fd658a8628d
|
7
|
+
data.tar.gz: 93e729f4c54254e58fbc990ef77d5aa0eb2e4250fa7dcb68f2cae002f1926c70ecc6530a352bbc63203b86b17ad4316b9264cf9eba563396cbf57b9be72fa83f
|
data/lib/exercism/tooling_job.rb
CHANGED
@@ -4,6 +4,10 @@ module Exercism
|
|
4
4
|
|
5
5
|
extend Mandate::Memoize
|
6
6
|
|
7
|
+
def self.git_cache_key(repo, sha, dir, filepath)
|
8
|
+
"#{repo}:#{sha}:#{dir}/#{filepath}"
|
9
|
+
end
|
10
|
+
|
7
11
|
def self.create!(
|
8
12
|
job_id, type, submission_uuid, efs_dir, language, exercise,
|
9
13
|
run_in_background: false,
|
@@ -63,19 +67,15 @@ module Exercism
|
|
63
67
|
|
64
68
|
def locked!
|
65
69
|
redis = Exercism.redis_tooling_client
|
66
|
-
redis.
|
67
|
-
|
68
|
-
transaction.rpush(key_for_locked, id)
|
69
|
-
end
|
70
|
+
redis.lrem(key_for_queued, 1, id)
|
71
|
+
redis.rpush(key_for_locked, id)
|
70
72
|
end
|
71
73
|
|
72
74
|
def executed!(status, output)
|
73
75
|
redis = Exercism.redis_tooling_client
|
74
|
-
redis.
|
75
|
-
|
76
|
-
|
77
|
-
transaction.rpush(key_for_executed, id)
|
78
|
-
end
|
76
|
+
redis.lrem(key_for_queued, 1, id)
|
77
|
+
redis.lrem(key_for_locked, 1, id)
|
78
|
+
redis.rpush(key_for_executed, id)
|
79
79
|
|
80
80
|
redis.set(
|
81
81
|
"job:#{id}",
|
@@ -95,10 +95,8 @@ module Exercism
|
|
95
95
|
|
96
96
|
def cancelled!
|
97
97
|
redis = Exercism.redis_tooling_client
|
98
|
-
redis.
|
99
|
-
|
100
|
-
transaction.rpush(key_for_cancelled, id)
|
101
|
-
end
|
98
|
+
redis.lrem(key_for_queued, 1, id)
|
99
|
+
redis.rpush(key_for_cancelled, id)
|
102
100
|
end
|
103
101
|
|
104
102
|
def ==(other)
|
data/lib/exercism.rb
CHANGED
@@ -24,6 +24,17 @@ module Exercism
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
def self.redis_git_cache_client
|
28
|
+
require 'redis'
|
29
|
+
require 'redis-clustering'
|
30
|
+
|
31
|
+
if Exercism.env.development? || Exercism.env.test?
|
32
|
+
Redis.new(url: config.git_cache_redis_url)
|
33
|
+
else
|
34
|
+
Redis::Cluster.new(nodes: [config.git_cache_redis_url])
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
27
38
|
def self.dynamodb_client
|
28
39
|
Aws::DynamoDB::Client.new(ExercismConfig::GenerateAwsSettings.())
|
29
40
|
end
|
data/settings/ci.yml
CHANGED
@@ -10,6 +10,10 @@ chatgpt_proxy_url: http://127.0.0.1:3026/ask_chatgpt
|
|
10
10
|
tooling_cloudwatch_jobs_log_group_name: "/tooling-jobs"
|
11
11
|
tooling_cloudwatch_jobs_log_stream_name: "general"
|
12
12
|
|
13
|
+
# Redis Caches
|
14
|
+
git_cache_redis_url: redis://127.0.0.1:6379/4
|
15
|
+
cache_redis_url: redis://127.0.0.1:6379/5
|
16
|
+
|
13
17
|
# DynamoDB config
|
14
18
|
dynamodb_tooling_jobs_table: tooling_jobs
|
15
19
|
dynamodb_tooling_language_groups_table: tooling_language_groups
|
data/settings/local.yml
CHANGED
@@ -10,6 +10,10 @@ chatgpt_proxy_url: http://local.exercism.io:3026/ask_chatgpt
|
|
10
10
|
tooling_cloudwatch_jobs_log_group_name: "/tooling-jobs"
|
11
11
|
tooling_cloudwatch_jobs_log_stream_name: "general"
|
12
12
|
|
13
|
+
# Redis Caches
|
14
|
+
git_cache_redis_url: redis://127.0.0.1:6379/4
|
15
|
+
cache_redis_url: redis://127.0.0.1:6379/5
|
16
|
+
|
13
17
|
# DynamoDB config
|
14
18
|
dynamodb_tooling_jobs_table: tooling_jobs
|
15
19
|
dynamodb_tooling_language_groups_table: tooling_language_groups
|
@@ -60,5 +64,5 @@ aws_attachments_region:
|
|
60
64
|
paypal_api_url: https://api-m.sandbox.paypal.com
|
61
65
|
paypal_url: https://www.sandbox.paypal.com
|
62
66
|
|
63
|
-
mongodb_url:
|
64
|
-
mongodb_database_name:
|
67
|
+
mongodb_url: "mongodb://127.0.0.1:27017"
|
68
|
+
mongodb_database_name: "exercism"
|