canvas-lms/docker-compose.new-jenkins.yml

54 lines
1.2 KiB
YAML
Raw Normal View History

# it is intended that this be used exclusive of all other docker-compose.*yml files in CI
version: "2.3"
services:
canvas:
Upgrade unofficial postgis repo to official repo Closes: CCI-261 The mdillon repo was an unofficial postgis repo, there is now and official postgis/postgis repo! https://registry.hub.docker.com/r/postgis/postgis/ https://github.com/postgis/docker-postgis Test Plan: - First, take notice if you currently have pg_collkey installed: $ docker-compose run --rm postgres psql -x \ -h postgres -U postgres -d canvas -c "SELECT * FROM pg_available_extensions WHERE \ pg_available_extensions.name = 'pg_collkey';" If `installed_version` is blank, then the extension is not isntalled into the `canvas` database. - take down any running environment: $ docker-compose stop && docker-compose down - copy (or update) new settings from docker-compose.override.yml: # manual diff $ diff config/docker-compose.override.yml \ docker-compose.override.yml # overwrite any existing config $ cp config/docker-compose.override.yml . - copy (or update) new settings from database.yml: # manual diff $ diff docker-compose/config/database.yml config/database.yml # overwrite any existing config $ cp docker-compose/config/database.yml config/ - rebuild and startup the postgres image: $ docker-compose up --build postgres - the postgres logs do not mention ERROR: could not access file "$libdir/collkey_icu.so": No such file or directory - install the extension if it wasn't previously present: $ docker-compose run --rm postgres psql -x \ -h postgres \ -U postgres \ -d canvas \ -c "CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA public; CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public; CREATE EXTENSION IF NOT EXISTS pg_collkey SCHEMA public;" $ docker-compose run --rm postgres psql -x \ -h postgres \ -U postgres \ -d canvas_test \ -c "CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA public; \ CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public; \ CREATE EXTENSION IF NOT EXISTS pg_collkey SCHEMA public;" - pg_collkey is now present: $ docker-compose run --rm postgres psql -x \ -h postgres -U postgres -d canvas -c "SELECT * FROM pg_available_extensions WHERE \ pg_available_extensions.name = 'pg_collkey';" $ docker-compose run --rm postgres psql -x \ -h postgres -U postgres -d canvas_test -c "SELECT * FROM pg_available_extensions WHERE \ pg_available_extensions.name = 'pg_collkey';" - Optionally, Build the postgres container with fresh volumes: $ COMPOSE_PROJECT_NAME=<a-unique-name> docker-compose --build \ up postgres - The postgres logs show no errors related to collkey_icu.so (like above) Change-Id: I4f0e027cd908fee937b6204cd3a20e5ecf998021 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228190 Reviewed-by: Rex Fleischer <rfleischer@instructure.com> Reviewed-by: Jacob Powell <spowell@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> QA-Review: James Butters <jbutters@instructure.com> Product-Review: Derek Bender <djbender@instructure.com>
2020-03-05 03:32:41 +08:00
image: $PATCHSET_TAG
depends_on:
- postgres
- cassandra
- redis
- dynamodb
environment:
ENCRYPTION_KEY: facdd3a131ddd8988b14f6e4e01039c93cfa0160
RAILS_ENV: test
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
RANDOMIZE_SEQUENCES: 1
DISABLE_SPRING: 'true'
RERUNS_RETRY:
MAX_FAIL:
COVERAGE:
FORCE_FAILURE:
# parallel_tests
CI_NODE_TOTAL:
CI_NODE_INDEX:
DOCKER_PROCESSES:
EXCLUDE_TESTS:
TEST_PATTERN:
# rspec-parallel-log build
RSPEC_LOG:
# this will stop passenger from booting so the container isn't running anything at all once up
command: sleep infinity
init: true
redis:
image: starlord.inscloudgate.net/jenkins/redis:alpine
init: true
postgres:
image: $POSTGRES_IMAGE_TAG
Upgrade unofficial postgis repo to official repo Closes: CCI-261 The mdillon repo was an unofficial postgis repo, there is now and official postgis/postgis repo! https://registry.hub.docker.com/r/postgis/postgis/ https://github.com/postgis/docker-postgis Test Plan: - First, take notice if you currently have pg_collkey installed: $ docker-compose run --rm postgres psql -x \ -h postgres -U postgres -d canvas -c "SELECT * FROM pg_available_extensions WHERE \ pg_available_extensions.name = 'pg_collkey';" If `installed_version` is blank, then the extension is not isntalled into the `canvas` database. - take down any running environment: $ docker-compose stop && docker-compose down - copy (or update) new settings from docker-compose.override.yml: # manual diff $ diff config/docker-compose.override.yml \ docker-compose.override.yml # overwrite any existing config $ cp config/docker-compose.override.yml . - copy (or update) new settings from database.yml: # manual diff $ diff docker-compose/config/database.yml config/database.yml # overwrite any existing config $ cp docker-compose/config/database.yml config/ - rebuild and startup the postgres image: $ docker-compose up --build postgres - the postgres logs do not mention ERROR: could not access file "$libdir/collkey_icu.so": No such file or directory - install the extension if it wasn't previously present: $ docker-compose run --rm postgres psql -x \ -h postgres \ -U postgres \ -d canvas \ -c "CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA public; CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public; CREATE EXTENSION IF NOT EXISTS pg_collkey SCHEMA public;" $ docker-compose run --rm postgres psql -x \ -h postgres \ -U postgres \ -d canvas_test \ -c "CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA public; \ CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public; \ CREATE EXTENSION IF NOT EXISTS pg_collkey SCHEMA public;" - pg_collkey is now present: $ docker-compose run --rm postgres psql -x \ -h postgres -U postgres -d canvas -c "SELECT * FROM pg_available_extensions WHERE \ pg_available_extensions.name = 'pg_collkey';" $ docker-compose run --rm postgres psql -x \ -h postgres -U postgres -d canvas_test -c "SELECT * FROM pg_available_extensions WHERE \ pg_available_extensions.name = 'pg_collkey';" - Optionally, Build the postgres container with fresh volumes: $ COMPOSE_PROJECT_NAME=<a-unique-name> docker-compose --build \ up postgres - The postgres logs show no errors related to collkey_icu.so (like above) Change-Id: I4f0e027cd908fee937b6204cd3a20e5ecf998021 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228190 Reviewed-by: Rex Fleischer <rfleischer@instructure.com> Reviewed-by: Jacob Powell <spowell@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> QA-Review: James Butters <jbutters@instructure.com> Product-Review: Derek Bender <djbender@instructure.com>
2020-03-05 03:32:41 +08:00
environment:
Configure databases in a unified manner This patchset removes the much duplicated database.yml and instead defaults to a DATABASE_URL scheme. There is however still present a docker-compose/config/new-jenkins/database.yml file to temporarily allow our internal portal service to still function until such time we can reconfigure it. To set up custom connection options all that is needed is setting DATABASE_URL. See examples of this in docker-compose.yml and docker-compose.new-jenkins.yml. Test Plan ========= Image: - pulling canvas-lms:master image boots without database errors Repo: - given default dev environment where COMPOSE_FILE=docker-compose.yml:docker-compose.override.yml - build the web and postgres images: docker-compose build web postgres (feel free to comment out `yarn install` and `compile_assets` in the Dockerfile since we won't be needing them for this test and this speeds things up) - set a custom DATABASE_URL to change the database name and echo it to see it gets into the image correctly: $ docker run -it -e \ DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \ $(docker-compose ps -q web) bash -c "echo \$DATABASE_URL" => postgres://postgres:sekret@postgres/canvas_custom_env $ docker-compose run --rm -e \ DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \ web bash -c "echo \$DATABASE_URL" => postgres://postgres:sekret@postgres/canvas_custom_env - Test that setting a custom database name via DATABASE_URL can create the database $ docker-compose run --rm -e \ DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \ web bash -c "bin/rails db:create" => Created database 'canvas_custom_env' - This patchset boots on portal Change-Id: Ic6f3819550df94b6c98b17ef05ac2029a578cfe4 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234213 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Powell <spowell@instructure.com> Reviewed-by: James Butters <jbutters@instructure.com> QA-Review: Robin Kuss <rkuss@instructure.com> QA-Review: Rex Fleischer <rfleischer@instructure.com> QA-Review: Jacob Powell <spowell@instructure.com> Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-04-16 02:52:10 +08:00
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
init: true
cassandra:
image: $CASSANDRA_IMAGE_TAG
environment:
CASSANDRA_START_RPC: 'true'
init: true
dynamodb:
image: $DYNAMODB_IMAGE_TAG
command: -jar DynamoDBLocal.jar
init: true