Skip to content

Geo: Admin > Background Jobs can only view and manage primary Geo site's Sidekiq

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

When using secondary proxying (15.1+, or when using Unified URL in 14.6), visiting Admin > Background Jobs always gets routed to the primary, regardless of which site your request initially routes to.

Therefore when using secondary proxying, you cannot view the Sidekiq frame for the secondary site.

I also tried visiting the iframe address /admin/sidekiq, but GitLab Workhorse still proxies those requests to the primary.

This problem also means you cannot easily enable, disable, or enqueue now Sidekiq-cron jobs, or clear a queue, without using the command line.

Workaround

SSH into a GitLab Rails node in the target secondary Geo site, open Rails console, and for example, directly call code of sidekiq-cron or sidekiq.

Proposal

Implementation Guide

Make each Geo site display its local Sidekiq UI inside Admin > Background Jobs.

  • Add /admin/sidekiq to Workhorse Geo local routes to let all sites render their local Sidekiq UI at /admin/sidekiq
  • Add /admin/sidekiq/* to Workhorse Geo local routes. (There are many sub-routes for the Sidekiq UI.)
  • Locally, you should test this by visiting http://localhost:3000/admin/sidekiq and http://localhost:3001/admin/sidekiq (or whatever your FQDNs are) and confirm that they show different Sidekiq data and you can view all the Sidekiq views and use the buttons.
  • Display the Geo site/node's name in the Admin > Background jobs view, when Geo is in-use.
  • Make sure you don't break the view when Geo is not in-use.

This should make the Sidekiq UI available in any secondary site which is using a separate URL. For Unified URL, the sysadmin will have to figure out how to make their requests route to the site for which they want to see the Sidekiq UI.

Examples with Unified URL:

  • If using DNS to route to Geo sites, and if each sites' Internal URL is browseable by you, then you can visit the Internal URL of each site to see their Sidekiq UI

  • If using DNS to route to Geo sites, you may be able to edit /etc/hosts to visit the desired site

  • If all sites are behind an opaque load balancer, then you probably cannot easily choose a particular site

  • Open a feature request issue with the below proposal

Geo: View the Sidekiq UI for all sites

Problem: It's difficult to view a specific Sidekiq UI when using Unified URL.

Proposal: Make it easy to view the Sidekiq UI for every site, especially when using Unified URL.

  • Add a route like /admin/geo/sites/:geo_site_id/-/sidekiq/*
  • Secondary sites already proxy those routes to the primary. No action needed.
  • Make the primary site, in Rails, proxy those requests to the appropriate site at /admin/sidekiq/*. Similar to this
  • In /admin/background_jobs, add an iframe for every site, pointing to their /admin/geo/sites/:geo_site_id/-/sidekiq

This solution means you could visit /admin/sidekiq and you will see the Sidekiq UI for all sites on one page. It doesn't matter which site your request is routed to.

Edited by 🤖 GitLab Bot 🤖