tweaks to dynamodb docker-compose setup

- gets rid of container_name, as this explicit name breaks from the
   pattern used in the rest of the codebase.
 - gets rid of env vars for AWS creds as they're unnecessary, and could
   potentially interfere with other aws libs besides dynammodb.
 - removes `links` as its deprecated and redundant with `depends_on`
 - adds "VIRTUAL_{HOST,PORT}" for dinghy

also fixes a typo in an old data fixup

Change-Id: Ie5953d1ee89d9e40779fe8f3e6c56731f77684d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246061
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
This commit is contained in:
Michael Ziwisky 2020-08-24 20:53:17 -07:00
parent 6615c4cd7e
commit 14682d6b1b
3 changed files with 11 additions and 14 deletions

View File

@ -1,20 +1,15 @@
# to use this for global lookups add docker-compose/dynamodb.override.yml # to use this for global lookups add docker-compose/dynamodb.override.yml
# to your COMPOSE_FILE var in .env # to your COMPOSE_FILE var in .env
# Then: # Then run:
# - Run `GlobalLookups.initialize_ddb_for_development!` from a console # $ docker-compose run --rm web bin/rails runner GlobalLookups::DevUtils.initialize_ddb_for_development!
version: '2.3' version: '2.3'
services: services:
web: web:
depends_on: depends_on:
- "dynamodb"
links:
- dynamodb - dynamodb
environment:
AWS_ACCESS_KEY_ID: 'DUMMYIDEXAMPLE'
AWS_SECRET_ACCESS_KEY: 'DUMMYEXAMPLEKEY'
dynamodb: dynamodb:
image: instructure/dynamo-local-admin:latest image: instructure/dynamo-local-admin:latest
container_name: dynamodb-local environment:
ports: VIRTUAL_HOST: dynamodb.docker
- "8000:8000" VIRTUAL_PORT: 8000

View File

@ -19,7 +19,7 @@ module DataFixup::InitializeSubmissionCachedDueDate
def self.run def self.run
Course.find_in_batches do |courses| Course.find_in_batches do |courses|
courses.each do |course| courses.each do |course|
DueDateCacher.recompute_course(course, inst_job_opts: { priority: Delayed::LOWER_PRIORITY }) DueDateCacher.recompute_course(course, inst_jobs_opts: { priority: Delayed::LOWER_PRIORITY })
end end
end end
end end

View File

@ -22,9 +22,11 @@ module GlobalLookups
end end
end end
unless singleton_class.method_defined?(:initialize_ddb_for_development!) module DevUtils
def self.initialize_ddb_for_development! unless singleton_class.method_defined?(:initialize_ddb_for_development!)
puts("Nothing to do for global lookups stub") def self.initialize_ddb_for_development!
puts("Nothing to do for global lookups stub")
end
end end
end end
end end