diff --git a/cluster-setup/README.md b/cluster-setup/README.md index d749bad6a..06de011b4 100644 --- a/cluster-setup/README.md +++ b/cluster-setup/README.md @@ -79,11 +79,26 @@ or `/etc/kive/kive_purge.conf`. * `barman_password`: this is in the `barman` user's `.pgpass` file. * `streaming_barman_password`: this is also in the `barman` user's `.pgpass` file. +Some other notable settings that you may need to adjust: + +* `kive_allowed_hosts`: this is a JSON-formatted list of IP addresses/URLs that the +web server will respond to requests on. +* `kive_subject_prefix`: this will be prepended to the emails sent by the Kive system. +It's a good idea to include some details on this system, e.g. "Kive server on Octomore", +or "Kive server on developer workstation". +* `kive_purge_start`: sets the threshold for the Kive purge task to perform file cleanup. +* `kive_purge_stop`: sets the stopping threshold for this Kive purge task; that is, a +purge will stop when the remaining files' total size is under this threshold. +* `kive_log_level`: the logging level, as understood by [Django's logging utilities][DjangoLogging], +used by the purge task. + Then go to `deployment/` and create an `ansible.cfg` from one of the provided templates, probably `ansible_octomore.cfg`. These files will be necessary for Ansible to work. > Note: all playbooks should be run using `sudo`! +[DjangoLogging]: https://docs.djangoproject.com/en/4.0/topics/logging/ + #### General preliminary setup The first playbook we will run sets up the `/data` partition, so the first thing we do diff --git a/cluster-setup/deployment/group_vars/default_template.yml b/cluster-setup/deployment/group_vars/default_template.yml index 699e85a84..c8b2fe7d0 100644 --- a/cluster-setup/deployment/group_vars/default_template.yml +++ b/cluster-setup/deployment/group_vars/default_template.yml @@ -9,11 +9,17 @@ kive_listen_port: 8080 update_kive_source: yes kive_server_email: kive-noreply@bccfe.ca kive_admins: "[[\"kive\", \"kive@bccfe.ca\"]]" -kive_subject_prefix: "Kive server" +kive_subject_prefix: "Kive (development) server" kive_backup_path: /data/kive_db_backup kive_python_package: python3.7 kive_python_executable: python3.7 +# Settings used by the Kive purge tasks; uncomment if you need to customize +# for your system (the defaults are likely good for a development system). +# kive_purge_start: "20GB" +# kive_purge_stop: "15GB" +# kive_log_level: WARN + # Settings for network services running on the head node, # e.g. firewall, NFS, and PostgreSQL. nfs_export_to_hosts: 192.168.64.0/255.255.255.0 diff --git a/cluster-setup/deployment/group_vars/octomore_template.yaml b/cluster-setup/deployment/group_vars/octomore_template.yaml index a783239b8..8a03ccb15 100644 --- a/cluster-setup/deployment/group_vars/octomore_template.yaml +++ b/cluster-setup/deployment/group_vars/octomore_template.yaml @@ -4,17 +4,22 @@ # Most of the network information should be already set appropriately. # Variables needed to set up Kive. -kive_allowed_hosts: "[\"*\"]" +kive_allowed_hosts: "[\"192.168.69.179\", \"kive-int.cfenet.ubc.ca\"]" kive_listen_port: 80 update_kive_source: yes kive_server_email: kive-noreply@bccfe.ca kive_admins: "[[\"kive\", \"kive@bccfe.ca\"]]" -kive_subject_prefix: "Kive server" +kive_subject_prefix: "Kive server on Octomore" kive_backup_path: /media/backup kive_version: v0.16.2 kive_python_package: python3.7 kive_python_executable: python3.7 +# Settings used by the Kive purge tasks. +kive_purge_start: "4TB" +kive_purge_stop: "3.5TB" +kive_log_level: INFO + # Slurm configuration. slurmctlnode: octomore slurm_nodes: diff --git a/cluster-setup/deployment/roles/kive_server/templates/kive_purge.conf.j2 b/cluster-setup/deployment/roles/kive_server/templates/kive_purge.conf.j2 index 70b53edaf..aa9ad0eec 100644 --- a/cluster-setup/deployment/roles/kive_server/templates/kive_purge.conf.j2 +++ b/cluster-setup/deployment/roles/kive_server/templates/kive_purge.conf.j2 @@ -8,7 +8,9 @@ KIVE_SERVER_EMAIL={{ kive_server_email | quote }} KIVE_ADMINS={{ kive_admins | quote }} KIVE_SUBJECT_PREFIX={{ kive_subject_prefix | quote }} -# Set these in /root/ansible-rundir/env_vars.yml if you don't like the defaults in settings.py +# The KIVE_PURGE_START, KIVE_PURGE_STOP, and KIVE_LOG_LEVEL variables +# can be set in Ansible prior to deployment if you don't like the defaults +# in settings.py. # KIVE_PURGE_START=20GB # KIVE_PURGE_STOP=15GB # KIVE_PURGE_DATASET_AGING=1.0 @@ -16,15 +18,15 @@ KIVE_SUBJECT_PREFIX={{ kive_subject_prefix | quote }} # KIVE_PURGE_CONTAINER_AGING=10.0 # KIVE_PURGE_WAIT='0 days, 1:00:00' # KIVE_PURGE_BATCH_SIZE=100 -# KIVE_LOG_LEVEL=WARN +# KIVE_LOG_LEVEL=WARNING {% if kive_purge_start is defined %} -KIVE_PURGE_START={{kive_purge_start}} +KIVE_PURGE_START={{ kive_purge_start }} {% endif %} {% if kive_purge_stop is defined %} -KIVE_PURGE_STOP={{kive_purge_stop}} +KIVE_PURGE_STOP={{ kive_purge_stop }} {% endif %} {% if kive_log_level is defined %} -KIVE_LOG_LEVEL={{kive_log_level}} +KIVE_LOG_LEVEL={{ kive_log_level }} {% endif %} # KIVE_LOG is set separately for each service in the .service files. diff --git a/kive/kive/settings.py b/kive/kive/settings.py index 9aa6dc8f9..21962a0ea 100644 --- a/kive/kive/settings.py +++ b/kive/kive/settings.py @@ -212,7 +212,7 @@ LOG_HANDLER_NAMES.append('console') if ADMINS: LOG_HANDLER_NAMES.append('mail_admins') -LOG_LEVEL = os.environ.get('KIVE_LOG_LEVEL', 'WARN') +LOG_LEVEL = os.environ.get('KIVE_LOG_LEVEL', 'WARNING') # See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration.