exercism-config 0.42.0 → 0.47.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/bin/setup_exercism_local_aws +84 -5
- data/lib/exercism-config.rb +1 -1
- data/lib/exercism/config.rb +1 -0
- data/lib/exercism_config/determine_environment.rb +4 -0
- data/lib/exercism_config/setup_ecr_client.rb +18 -0
- data/lib/exercism_config/version.rb +1 -1
- data/settings/ci.yml +3 -1
- data/settings/docker.yml +3 -1
- data/settings/local.yml +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f215c9b1370996326309bf6a6485628246cd2c6a2b652019e0544f9d11e5dfa
|
4
|
+
data.tar.gz: e96c5a571dab7965d6fab786288b69fa50433173be6a9010a37ae6d93eeeed88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2558572f643ad358802b5d00426630251abba2c30bac5f4f41eb0033ac5db312d13d32b039a06b4be19a9c44b037227dd0f84a8b3641c5bc48fd6cb3d25383ce
|
7
|
+
data.tar.gz: dfc9fe90709e5c4cd7da567a46aedbaa452ee01487ff26b07def6fa20bb5857e745e1ada7c5fa018d4a599b688f80c97ce32d13b8e0061215b6028543b7c94f6
|
@@ -15,7 +15,7 @@ Exercism.config.dynamodb_client = ExercismConfig::SetupDynamoDBClient.()
|
|
15
15
|
|
16
16
|
unless ENV["EXERCISM_SKIP_S3"]
|
17
17
|
[
|
18
|
-
Exercism.config.
|
18
|
+
Exercism.config.aws_submissions_bucket,
|
19
19
|
Exercism.config.aws_tooling_jobs_bucket,
|
20
20
|
].each do |bucket|
|
21
21
|
begin
|
@@ -28,10 +28,13 @@ unless ENV["EXERCISM_SKIP_S3"]
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
# Setup local dynamodb #
|
33
|
-
|
34
|
-
|
31
|
+
###########################################
|
32
|
+
# Setup local dynamodb tooling jobs table #
|
33
|
+
###########################################
|
34
|
+
[
|
35
|
+
Exercism.config.dynamodb_tooling_jobs_table,
|
36
|
+
Exercism.config.dynamodb_tooling_jobs_table + "-test"
|
37
|
+
].each do |table_name|
|
35
38
|
begin
|
36
39
|
Exercism.config.dynamodb_client.delete_table(
|
37
40
|
table_name: table_name
|
@@ -97,4 +100,80 @@ end
|
|
97
100
|
}
|
98
101
|
]
|
99
102
|
)
|
103
|
+
|
104
|
+
Exercism.config.dynamodb_client.update_table(
|
105
|
+
table_name: table_name,
|
106
|
+
attribute_definitions: [
|
107
|
+
{
|
108
|
+
attribute_name: "submission_uuid",
|
109
|
+
attribute_type: "S"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
attribute_name: "type",
|
113
|
+
attribute_type: "S"
|
114
|
+
}
|
115
|
+
],
|
116
|
+
global_secondary_index_updates: [
|
117
|
+
{
|
118
|
+
create: {
|
119
|
+
index_name: "submission_type", # required
|
120
|
+
key_schema: [ # required
|
121
|
+
{
|
122
|
+
attribute_name: "submission_uuid", # required
|
123
|
+
key_type: "HASH" # required, accepts HASH, RANGE
|
124
|
+
},
|
125
|
+
{
|
126
|
+
attribute_name: "type", # required
|
127
|
+
key_type: "RANGE" # required, accepts HASH, RANGE
|
128
|
+
}
|
129
|
+
],
|
130
|
+
projection: { # required
|
131
|
+
projection_type: "INCLUDE",
|
132
|
+
non_key_attributes: ["id", "job_status"]
|
133
|
+
},
|
134
|
+
provisioned_throughput: {
|
135
|
+
read_capacity_units: 1, # required
|
136
|
+
write_capacity_units: 1 # required
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
]
|
141
|
+
)
|
142
|
+
end
|
143
|
+
|
144
|
+
##############################################
|
145
|
+
# Setup local dynamodb language groups table #
|
146
|
+
##############################################
|
147
|
+
[
|
148
|
+
Exercism.config.dynamodb_tooling_language_groups_table,
|
149
|
+
Exercism.config.dynamodb_tooling_language_groups_table + "-test"
|
150
|
+
].each do |table_name|
|
151
|
+
begin
|
152
|
+
Exercism.config.dynamodb_client.delete_table(
|
153
|
+
table_name: table_name
|
154
|
+
)
|
155
|
+
rescue Aws::DynamoDB::Errors::ResourceNotFoundException
|
156
|
+
end
|
157
|
+
puts "[x] #{table_name}"
|
158
|
+
|
159
|
+
Exercism.config.dynamodb_client.create_table(
|
160
|
+
table_name: table_name,
|
161
|
+
attribute_definitions: [
|
162
|
+
{
|
163
|
+
attribute_name: "group",
|
164
|
+
attribute_type: "S"
|
165
|
+
}
|
166
|
+
],
|
167
|
+
key_schema: [
|
168
|
+
{
|
169
|
+
attribute_name: "group",
|
170
|
+
key_type: "HASH"
|
171
|
+
}
|
172
|
+
],
|
173
|
+
provisioned_throughput: {
|
174
|
+
read_capacity_units: 1,
|
175
|
+
write_capacity_units: 1
|
176
|
+
}
|
177
|
+
)
|
100
178
|
end
|
179
|
+
|
data/lib/exercism-config.rb
CHANGED
@@ -7,9 +7,9 @@ require_relative 'exercism_config/environment'
|
|
7
7
|
require_relative 'exercism_config/determine_environment'
|
8
8
|
require_relative 'exercism_config/generate_aws_settings'
|
9
9
|
require_relative 'exercism_config/setup_dynamodb_client'
|
10
|
+
require_relative 'exercism_config/setup_ecr_client'
|
10
11
|
require_relative 'exercism_config/setup_s3_client'
|
11
12
|
require_relative 'exercism_config/retrieve'
|
12
|
-
require_relative 'exercism_config/generate_aws_settings'
|
13
13
|
require_relative 'exercism_config/version'
|
14
14
|
|
15
15
|
require_relative 'exercism/config'
|
data/lib/exercism/config.rb
CHANGED
@@ -4,6 +4,10 @@ module ExercismConfig
|
|
4
4
|
|
5
5
|
def call
|
6
6
|
env = ENV['EXERCISM_ENV'] || ENV['RAILS_ENV'] || ENV['APP_ENV']
|
7
|
+
unless env
|
8
|
+
env = Rails.env.to_s if Object.const_defined?(:Rails) && Rails.respond_to?(:env)
|
9
|
+
end
|
10
|
+
|
7
11
|
raise Exercism::ConfigError, 'No environment set - set one of EXERCISM_ENV, RAILS_ENV or APP_ENV' unless env
|
8
12
|
|
9
13
|
Environment.new(env)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ExercismConfig
|
2
|
+
class SetupECRClient
|
3
|
+
include Mandate
|
4
|
+
|
5
|
+
def call
|
6
|
+
aws_settings = GenerateAwsSettings.().merge(
|
7
|
+
# endpoint: config_endpoint,
|
8
|
+
|
9
|
+
# We don't want a profile for this AWS service
|
10
|
+
# as we run it locally. But we do normally, so
|
11
|
+
# we locally override this here.
|
12
|
+
profile: nil
|
13
|
+
).select { |_k, v| v }
|
14
|
+
|
15
|
+
Aws::ECR::Client.new(aws_settings)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/settings/ci.yml
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
anycable_redis_url: redis://127.0.0.1:6379/1
|
2
2
|
anycable_rpc_host: 127.0.0.1:50051
|
3
|
-
|
3
|
+
aws_submissions_bucket: exercism-staging-submissions
|
4
4
|
aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
|
5
5
|
dynamodb_tooling_jobs_table: tooling_jobs
|
6
|
+
dynamodb_tooling_language_groups_table: tooling_language_groups
|
6
7
|
spi_url: http://127.0.0.1:3020
|
7
8
|
tooling_orchestrator_url: http://127.0.0.1:3021
|
9
|
+
git_server_url: http://127.0.0.1:3022
|
8
10
|
|
9
11
|
mysql_master_endpoint: 127.0.0.1
|
10
12
|
mysql_port: <%= ENV["MYSQL_PORT"] %>
|
data/settings/docker.yml
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
anycable_redis_url: redis://redis:6379/1
|
2
2
|
anycable_rpc_host: 0.0.0.0:50051
|
3
|
-
|
3
|
+
aws_submissions_bucket: exercism-staging-submissions
|
4
4
|
aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
|
5
5
|
dynamodb_tooling_jobs_table: tooling_jobs
|
6
|
+
dynamodb_tooling_language_groups_table: tooling_language_groups
|
6
7
|
mysql_master_endpoint: mysql
|
7
8
|
mysql_port: 3306
|
8
9
|
spi_url: http://website:3020
|
9
10
|
tooling_orchestrator_url: http://tooling-orchestrator:3021
|
11
|
+
git_server_url: http://git-server:3021
|
data/settings/local.yml
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
anycable_redis_url: redis://127.0.0.1:6379/1
|
2
2
|
anycable_rpc_host: 127.0.0.1:50051
|
3
|
-
|
3
|
+
aws_submissions_bucket: exercism-staging-submissions
|
4
4
|
aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
|
5
5
|
dynamodb_tooling_jobs_table: tooling_jobs
|
6
|
+
dynamodb_tooling_language_groups_table: tooling_language_groups
|
6
7
|
mysql_master_endpoint: localhost
|
7
8
|
mysql_socket: /tmp/mysql.sock
|
8
9
|
spi_url: http://127.0.0.1:3020
|
9
10
|
tooling_orchestrator_url: http://127.0.0.1:3021
|
11
|
+
git_server_url: http://127.0.0.1:3022
|
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.47.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: 2020-
|
11
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-dynamodb
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/exercism_config/generate_aws_settings.rb
|
154
154
|
- lib/exercism_config/retrieve.rb
|
155
155
|
- lib/exercism_config/setup_dynamodb_client.rb
|
156
|
+
- lib/exercism_config/setup_ecr_client.rb
|
156
157
|
- lib/exercism_config/setup_s3_client.rb
|
157
158
|
- lib/exercism_config/version.rb
|
158
159
|
- package.json
|