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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb8d5a2c761b7af3519398e178be8480e60a9a62a2dd2a4960c8b75b30dfc739
4
- data.tar.gz: 47ba6935d2a7bc51bfa794c16ee6a46c8a7ea6afb83e5ef05e52a1559bef0cf4
3
+ metadata.gz: 9845f6e1aefaf682189aa6f969971df25575e05691c415d9cc0c5ca51b208106
4
+ data.tar.gz: 7e6fb8a52b7086fdf77a94af8a4c0f04da6fdb2d0fad8c53e31012f1b0a88c14
5
5
  SHA512:
6
- metadata.gz: 7ac77afbaccabe3835d13e8212f5ee5e8c7b52a83ceeb4fefe4b92d13fd7288e0412acd802a9134d1213e3d9ac07fb111a1a6a478b1b17b54547db83cbb4bcb0
7
- data.tar.gz: b7ef645d0a38c8caee5306d3366fbca533e3cb3ab0921f848d5e93fab225200126f9d18981f41465cb4030e8cdef8103114667a3c4fa373bb816f50e68f2a2b1
6
+ metadata.gz: 4c8196fba32d76652f11cda8b211c3b93959f5ea7cc256398122bbeec509d668304a6a4c50b66c718f27a83e8911e98aa58cba27a1ece02a274b6fd658a8628d
7
+ data.tar.gz: 93e729f4c54254e58fbc990ef77d5aa0eb2e4250fa7dcb68f2cae002f1926c70ecc6530a352bbc63203b86b17ad4316b9264cf9eba563396cbf57b9be72fa83f
@@ -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.multi do |transaction|
67
- transaction.lrem(key_for_queued, 1, id)
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.multi do |transaction|
75
- transaction.lrem(key_for_queued, 1, id)
76
- transaction.lrem(key_for_locked, 1, id)
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.multi do |transaction|
99
- transaction.lrem(key_for_queued, 1, id)
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
@@ -1,3 +1,3 @@
1
1
  module ExercismConfig
2
- VERSION = '0.125.0'.freeze
2
+ VERSION = '0.128.0'.freeze
3
3
  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: 'mongodb://127.0.0.1:27017'
64
- mongodb_database_name: 'exercism'
67
+ mongodb_url: "mongodb://127.0.0.1:27017"
68
+ mongodb_database_name: "exercism"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exercism-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.125.0
4
+ version: 0.128.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker