Project

General

Profile

Actions

Feature #23295

closed

Add arvados_loki role to Ansible

Added by Brett Smith 4 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Deployment
Target version:
Story points:
-
Release relationship:
Auto

Description

Add a new role tools/ansible/roles/arvados_loki. It requires the arvados_loki_config_file variable to be set in inventory. It has tasks to do the following:

  • Install the loki package.
  • Upload arvados_loki_config_file from the control node to /etc/loki/config.yml on the managed node.
  • Ensure the loki systemd service is enabled and running, and restart it if configuration changed.

The arvados_controller role follows most of this same pattern, except the configuration upload happens in arvados_service because it's shared across multiple roles. This case is simpler so you can just have it in the same role.

We will want to add an nginx front-end but that can be a follow-up ticket. (Partly because I need to think about whether it makes sense to build it on arvados_nginx_site.)

Documentation is not in scope for this ticket. It makes more sense to write documentation once we have the complete collection of Alloy+Loki+Grafana all implemented.


Subtasks 1 (0 open1 closed)

Task #23301: Review 23295-loki-ansible-roleResolvedStephen Smith11/25/2025Actions

Related issues 1 (1 open0 closed)

Related to Arvados Epics - Idea #18337: Easier install using AnsibleIn Progress01/01/202508/31/2025Actions
Actions #1

Updated by Brett Smith 4 months ago

  • Subtask #23301 added
Actions #2

Updated by Stephen Smith 4 months ago

  • Status changed from New to In Progress
Actions #3

Updated by Lucas Di Pentima 4 months ago ยท Edited

Our Salt installer uses the package sources from the grafana-formula project, that is to say, it gets Grafana-related packages from Grafana itself.

Here's the list of sources depending on the distro, the Debian-specific one is:

name: deb https://apt.grafana.com stable main
file: /etc/apt/sources.list.d/grafana.list
key_url: https://apt.grafana.com/gpg.key
Actions #4

Updated by Brett Smith 4 months ago

Given this, the new role needs to look more like arvados_docker: it should install package pins, install the repository, then install the package. You can start writing the tasks now (if you haven't already) and I'll work on putting good pins together.

Actions #5

Updated by Brett Smith 4 months ago

We discussed at standup we are rarely affected by Loki changes, so pinning the major version seems fine. It should look like this (untested, feel free to fix typos):

Package: loki
Pin: version 3.*
Pin-Priority: 995
Actions #6

Updated by Brett Smith 4 months ago

For the playbook, add a play for a new arvados_loki group that includes the role, following the same pattern as most of the plays in there now.

My understanding is that we typically delpoy such that all the Arvados servers run Alloy, and then send logs to a separate server running Loki+Grafana. But any of these could be shuffled around so I think it makes sense to have separate groups for all of them.

Actions #7

Updated by Stephen Smith 4 months ago

Changes at arvados|117c4811ee8acf89691aeb3c161c5fef705c9119 branch 23295-loki-ansible-role

  • The role:
    • Adds the apt version pin following the example of arvados_docker
    • Adds the grafana repo, notifies apt-update and flushes handlers
    • Installs loki v3.*
    • Copies the provided config file
    • Enables and restarts (if config changed) or starts loki.service
  • Added example arvados_loki group to full inventory with some descriptions and invoke the role on the group in the main playbook
Actions #8

Updated by Lucas Di Pentima 4 months ago

A couple comments:

  • I think that if we pin the loki package, it's better to not repeat the version information in the install package step, to avoid future issues.
  • The arvados_loki role needs to depend on distro_apt so that it can notify 'apt update'. Check how it's declared in roles/arvados_docker/meta/main.yml
Actions #9

Updated by Stephen Smith 4 months ago

Changes at arvados|3724c52910058b9e5945cc5d907bfac648f89cca

  • Added the distro_apt dependency
  • Removed redundant version specifier from apt task
Actions #10

Updated by Lucas Di Pentima 4 months ago

A couple more comments:

  • I believe the task that checks/creates the /etc/loki/ directory and the one that writes the configuration file need to have become: yes.
  • Also, I would make sure that ownership & permissions on /etc/loki/ are also correctly set.

With that, it LGTM. Thanks!

Actions #11

Updated by Stephen Smith 4 months ago

  • Status changed from In Progress to Resolved

Made those changes and fixed incorrectly named meta file after running the playbook again to check for mistakes

Merged in arvados|68b315f4df43a7a2f5ef08185fb3811c8b22f932

Actions #12

Updated by Brett Smith 4 months ago

  • Related to Idea #18337: Easier install using Ansible added
Actions #13

Updated by Brett Smith about 2 months ago

  • Release set to 84
Actions

Also available in: Atom PDF