Skip to content

Commit

Permalink
Addressed the details missed in kive_purge.conf and kive_apache.conf …
Browse files Browse the repository at this point in the history
…that were reported in a comment to issue #1790.
  • Loading branch information
Richard Liang committed Jan 2, 2024
1 parent 1388ef8 commit 083f271
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
15 changes: 15 additions & 0 deletions cluster-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion cluster-setup/deployment/group_vars/default_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ kive_listen_port: 8080
update_kive_source: yes
kive_server_email: [email protected]
kive_admins: "[[\"kive\", \"[email protected]\"]]"
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
Expand Down
9 changes: 7 additions & 2 deletions cluster-setup/deployment/group_vars/octomore_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
kive_admins: "[[\"kive\", \"[email protected]\"]]"
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@ 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
# KIVE_PURGE_LOG_AGING=10.0
# 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.
2 changes: 1 addition & 1 deletion kive/kive/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 083f271

Please sign in to comment.