Skip to content

Set up databases for different services when using persistent databases

Boros Gábor requested to merge persistent-databases into master

Created by: itsjeyd

cf. OC-1610

Dependencies

Test instructions

  1. Prepare your .env by setting INSTANCE_MYSQL_URL and INSTANCE_MONGO_URL to values from corresponding settings from stage.console.opencraft.com .env file. Make sure your .env sets SWIFT_ENABLE=true (if it doesn't contain the SWIFT_ENABLE setting, that's fine too since it defaults to true).

  2. Log in to https://horizon.cloud.ovh.net using credentials for "OVH - OpenStack - Horizon - Databases" (stored in KeePassX database). Go to "Access & Security" and add a rule to the databases-mysql-im-stage and databases-mongodb-stage security groups that grants your IP access to the corresponding databases.

  3. Create a new instance from the shell using the following settings:

    from instance.factories import production_instance_factory
    
    instance = production_instance_factory(
       sub_domain="databases-test.sandbox",
       name='Databases Test',
       edx_platform_repository_url="https://github.com/edx/edx-platform.git",
       configuration_source_repo_url="https://github.com/open-craft/configuration.git",
       configuration_version="jill/edx-sandbox-remote",  # branch from related PR
       edx_platform_commit="master",
       openedx_release="master",
    )
  4. Run the development server, go to http://localhost:5000/instance, find the instance created in the previous step and click "Launch new AppServer".

  5. Once the status of the app server switches to "Configuring VM", copy its "VM IP Address" from the "Status" section. Using this IP address, repeat step 2 to grant the VM access to the external MySQL and MongoDB databases.

  6. Wait for the provisioning process to finish.

Merge request reports