Skip to content

Commit

Permalink
AggregationClient fix (#4347)
Browse files Browse the repository at this point in the history
* Add AGGREGATION_HOST env var

* Fix AggregationClient

* Use k8s deployments as hosts

* disable cert verification for intra-k8s traffic

* lil tweak
  • Loading branch information
zwolf authored Jun 15, 2024
1 parent 509c773 commit b6d3205
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/aggregation_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class ServerError < ConnectionError; end
attr_reader :connection

def initialize(adapter=Faraday.default_adapter)
@host = ENV.fetch('AGGREGATION_HOST', 'https://aggregation-staging.zooniverse.org')
@connection = connect!(adapter)
@host ||= ENV.fetch('AGGREGATION_HOST', 'http://test.example.com')
end

def connect!(adapter)
Expand All @@ -24,7 +24,7 @@ def send_aggregation_request(project_id, workflow_id, user_id)
params = { project_id: project_id, workflow_id: workflow_id, user_id: user_id }

request(:post, '/run_aggregation') do |req|
req.body = params.to_json
req.body = params
end
end

Expand Down
1 change: 1 addition & 0 deletions kubernetes/deployment-production.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ data:
TALK_API_USER: '1'
TALK_API_APPLICATION: '1'
USER_SUBJECT_LIMIT: '10000'
AGGREGATION_HOST: http://aggregation-caesar/
---
apiVersion: apps/v1
kind: Deployment
Expand Down
1 change: 1 addition & 0 deletions kubernetes/deployment-staging.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ data:
TALK_API_USER: '1'
TALK_API_APPLICATION: '1'
USER_SUBJECT_LIMIT: '100'
AGGREGATION_HOST: http://aggregation-staging-app/
---
apiVersion: apps/v1
kind: Deployment
Expand Down

0 comments on commit b6d3205

Please sign in to comment.