Note that these steps must be run from the root directory of the repo.
-
Build Docker images.
make build
Notes:
- An optional tag may be specified to avoid overriding existing images (e.g., when testing images from a different branch):
make build TAG=my-tag.
- An optional tag may be specified to avoid overriding existing images (e.g., when testing images from a different branch):
-
Retrieve a
cilogon.ymlfile containing CILogon credentials that will be provided for you. Place it in the Docker configuration directory.mv /path/to/cilogon.yml bootstrap/development/docker/config
-
Generate secrets, such as passwords for PostgreSQL and Redis.
sh bootstrap/development/docker/scripts/docker_generate_secrets.sh
Notes:
- This step should only be performed once. Running it again will overwrite existing passwords that may already have been used to configure services.
-
Generate a
.envfile using values defined in the Docker configuration directory. You must provide a deployment name ("BRC" or "LRC"), as well as a port where the web service will be available ("8880", "8881", "8882", or "8883").export DEPLOYMENT=BRC export WEB_PORT=8880 sh bootstrap/development/docker/scripts/docker_generate_django_env.sh $DEPLOYMENT $WEB_PORT
Notes:
- This step may be performed multiple times.
- The
main.ymlfile does not need to be modified in any way, despite indications within it. Its pre-defined values will be overridden and added to based on the other YML files in the directory. - The port must be one of the above because the CILogon application client is only configured for one of those four ports.
- The port may be customized so that multiple instances may run at the same time, without port clashes.
- Settings may be added or overridden by specifying them in an
overrides.ymlfile in the directory.- The following features may require additional configuration. Refer to the documentation for more information.
- Allowance renewal surveys
- MOU generation and storage on BRC deployments
- Vector-related requests on BRC deployments
- The following features may require additional configuration. Refer to the documentation for more information.
- The generated
.envfile will be created incoldfront/config/and is used by the Django application directly.
-
Generate a
.envfile with environment variables that will be passed todocker-compose.yml. You must provide the same deployment name and web port as in the previous step.sh bootstrap/development/docker/scripts/create_docker_compose_env_file.sh $DEPLOYMENT $WEB_PORT
Notes:
docker-compose.ymllooks for a.envfile in the same directory it resides in. This script creates.envthere.- The MailHog web UI port is derived from the web port (e.g., 8880 → 8025, 8881 → 8026). Access it at
http://localhost:MAILHOG_PORT. - There is an optional third argument that configures whether the application expects
env_settings.pyor a legacy pre-generated Python settings file. By default,env_settings.pyis used, but this can be overridden by providingfalseas a third argument. (Eventually, this will be removed.)
-
Start the application stack. The default project name is
brc-dev; override withPROJECT=lrc-devfor an LRC instance or a second parallel stack.make up
Notes:
- Some services (e.g.,
web) are expected to be failing at this point. - If the
IMAGE_TAGenvironment variable is set, Docker Compose will use images with the specified tag. - To persist the project name across sessions (required for non-BRC deployments), create a gitignored
local.mkin the repo root:echo "PROJECT := lrc-dev" > local.mk.
- Some services (e.g.,
-
Run Django scripts to set up the database and perform other tasks.
make setup
Notes:
- This step may be run multiple times.
-
Retrieve a PostgreSQL database dump file that will be provided for you. Place it in the root directory of the repo. Load it into your instance.
make load-db DUMP=YYYY_MM_DD-HH-MM.dump
Notes:
- This may take several minutes.
- The following error may appear in the output, but is not an issue:
ERROR: role "postgres" already exists
-
At this point, the web service should be functioning. Navigate to it from the browser at "http://localhost:WEB_PORT", where
WEB_PORTis the one defined above. -
After authenticating for the first time, grant your user administrator privileges in Django:
-
Enter into the application shell container:
make shell
-
From within the container, start a Django shell:
python3 manage.py shell
-
From within the Django shell, update your user:
from django.contrib.auth.models import User # The username is the string that appears on the right-hand side of the # menu. It will be an email address if you do not have a cluster account. user = User.objects.get(username="your_username") user.is_staff = True user.is_superuser = True user.save()
-