From 152f51c10c24f0e4644c1630c7b5db23d39f112c Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Wed, 13 Oct 2021 16:54:08 -0400 Subject: [PATCH] chore: upgrade coursegraph's neo4j image from 3.2 to 3.5 (#824) This coincides with our upgrade of Neo4j in edx/configuration. Other notes: * We are specifically pinning 3.5.28 (instead of simply 3.5) to ensure that we're using the exact same patch release as what's deployed from edx/configuration. * In the provisioning script, we now specifically start lms and then `exec` the management command. Before, we used the `run` command, which started lms automatically. This worked; however, it would create a *second* lms container if one was already running, which was very confusing. With this change, we will either (a) start a new lms container and use it, or (b) use the existing lms container. TNL-8386 --- docker-compose.yml | 2 +- provision-coursegraph.sh | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 931669b64d..92b0b7b1de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,7 +36,7 @@ services: hostname: coursegraph.devstack.edx # Try to keep this in sync with the NEO4J_VERSION declared within # https://github.com/edx/configuration/blob/master/playbooks/roles/neo4j - image: neo4j:3.2 + image: neo4j:3.5.28 networks: default: aliases: diff --git a/provision-coursegraph.sh b/provision-coursegraph.sh index bdae3f41b3..4e67b61230 100755 --- a/provision-coursegraph.sh +++ b/provision-coursegraph.sh @@ -4,20 +4,19 @@ set -eu -o pipefail . scripts/colors.sh set -x -echo -e "${GREEN} Ensuring Coursegraph image is up to date...${NC}" - # Pulling the image will almost always be a no-op, but will be important # when we bump the version in docker-compose.yml or when Neo4j releases a patch. # Also, this gives us a chance to refresh the container in case it's gotten into # a weird state. +echo -e "${GREEN} Ensuring Coursegraph image is up to date...${NC}" docker-compose rm --force --stop coursegraph docker-compose pull coursegraph -docker-compose up -d coursegraph +echo -e "${GREEN} Starting Coursegraph and LMS...${NC}" +docker-compose up -d coursegraph lms sleep 10 # Give Neo4j some time to boot up. echo -e "${GREEN} Updating LMS courses in Coursegraph...${NC}" - -docker-compose run lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && ./manage.py lms dump_to_neo4j --host coursegraph.devstack.edx --user neo4j --password edx' +docker-compose exec lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && ./manage.py lms dump_to_neo4j --host coursegraph.devstack.edx --user neo4j --password edx' echo -e "${GREEN} Coursegraph is now up-to-date with LMS!${NC}"