Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(Clowder): consume redis SSL config #1807

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ GEM
aws-sdk-cloudwatchlogs (~> 1)
multi_json (~> 1)
uuid (~> 2)
clowder-common-ruby (0.4.0)
clowder-common-ruby (0.4.2)
coderay (1.1.3)
concurrent-ruby (1.2.2)
config (4.2.1)
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
end

# FIXME: Settings.redis.ssl after clowder provides it
{ url: redis_url, password: redis_password, ssl: ActiveModel::Type::Boolean.new.cast(ENV.fetch('SETTINGS__REDIS__SSL', nil))}
{ url: redis_url, password: redis_password, ssl: Settings.redis.ssl}
end

# Override is necessary as it gets set during initialization without the proper config available
Expand Down
7 changes: 1 addition & 6 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
sidekiq_config = lambda do |config|
# FIXME: Settings.redis.ssl after clowder provides it
config.redis = {
url: Settings.redis.url,
password: Settings.redis.password.presence,
ssl: ActiveModel::Type::Boolean.new.cast(ENV.fetch('SETTINGS__REDIS__SSL', nil)),
network_timeout: 5
}
config.redis = Settings.redis.to_h.merge(network_timeout: 5)
config[:dead_timeout_in_seconds] = 2.weeks.to_i
config[:interrupted_timeout_in_seconds] = 2.weeks.to_i

Expand Down
11 changes: 0 additions & 11 deletions deploy/clowdapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ objects:
value: "${SETTINGS__FORCE_IMPORT_SSGS}"
- name: MAX_INIT_TIMEOUT_SECONDS
value: "${MAX_INIT_TIMEOUT_SECONDS}"
- name: SETTINGS__REDIS__SSL
value: "${REDIS_SSL}"
- name: PRIMARY_REDIS_AS_CACHE
value: "${PRIMARY_REDIS_AS_CACHE}"
- name: SETTINGS__REDIS__CACHE_HOSTNAME
Expand Down Expand Up @@ -178,8 +176,6 @@ objects:
value: "${MAX_INIT_TIMEOUT_SECONDS}"
- name: PRIMARY_REDIS_AS_CACHE
value: "${PRIMARY_REDIS_AS_CACHE}"
- name: SETTINGS__REDIS__SSL
value: "${REDIS_SSL}"
- name: SETTINGS__REDIS__CACHE_HOSTNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -271,8 +267,6 @@ objects:
value: "${MAX_INIT_TIMEOUT_SECONDS}"
- name: PRIMARY_REDIS_AS_CACHE
value: "${PRIMARY_REDIS_AS_CACHE}"
- name: SETTINGS__REDIS__SSL
value: "${REDIS_SSL}"
- name: SETTINGS__REDIS__CACHE_HOSTNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -377,8 +371,6 @@ objects:
value: "${MAX_INIT_TIMEOUT_SECONDS}"
- name: PRIMARY_REDIS_AS_CACHE
value: "${PRIMARY_REDIS_AS_CACHE}"
- name: SETTINGS__REDIS__SSL
value: "${REDIS_SSL}"
- name: SETTINGS__REDIS__CACHE_HOSTNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -510,9 +502,6 @@ parameters:
value: 800m
- name: CPU_REQUEST_IMPORT_SSG
value: 100m
- name: REDIS_SSL
description: 'Whether to use secured connection to Redis. Use string values of true or false'
value: "true"
- name: RACECAR_OFFSET_COMMIT_INTERVAL
required: true
value: "5"
Expand Down
3 changes: 2 additions & 1 deletion devel.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
},
"inMemoryDb": {
"hostname": "redis",
"port": "6379"
"port": "6379",
"sslMode": false
},
"database": {
"name": "compliance_dev",
Expand Down
3 changes: 2 additions & 1 deletion github-ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"inMemoryDb": {
"hostname": "redis",
"port": "6379"
"port": "6379",
"sslMode": false
},
"database": {
"name": "insights",
Expand Down
7 changes: 1 addition & 6 deletions lib/tasks/status.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ namespace :redis do
desc 'Check for available redis connection'
task status: [:environment] do
begin
# FIXME: Settings.redis.ssl after clowder provides it
Redis.new(
url: Settings.redis.url,
password: Settings.redis.password.presence,
ssl: ActiveModel::Type::Boolean.new.cast(ENV.fetch('SETTINGS__REDIS__SSL', nil))
).ping
Redis.new(Settings.redis.to_h.slice(:url, :password, :ssl)).ping
rescue Redis::BaseError
abort('ERROR: Redis unavailable')
end
Expand Down
3 changes: 2 additions & 1 deletion test.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"inMemoryDb": {
"hostname": "redis",
"port": "6379"
"port": "6379",
"sslMode": false
},
"database": {
"name": "compliance-test",
Expand Down
Loading