From 61dc5e3cddcbfae3811be5b2fe3ed5ec2f30fd4d Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 21 Nov 2025 15:43:05 +0530 Subject: [PATCH] Added mission control for solid queue ui. --- .DS_Store | Bin 8196 -> 8196 bytes Gemfile | 8 +++----- Gemfile.lock | 11 +++++++++++ README.md | 5 +++++ config/environments/development.rb | 3 +++ config/environments/production.rb | 3 +++ config/routes.rb | 1 + deploy/docker-compose-test.yml | 2 ++ deploy/kubernetes/manifests/wrestlingdev.yaml | 10 ++++++++++ deploy/kubernetes/secrets/secrets.yaml | 3 +++ deploy/rails-dev-Dockerfile | 2 +- deploy/rails-prod-Dockerfile | 2 +- 12 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.DS_Store b/.DS_Store index 3d93dff24b36e8ec3d4e88fcb8222d4868cecc54..e0512ec5a84ba4dc88d2a34c624d7e9b8b7e787a 100644 GIT binary patch delta 48 zcmV-00MGw~K!iY$PXQOPP`eKS7qbiyYXg(x6ONOu6nv9y6)Kao97(Zw69cmc81@9Q Gcn1TVx)87c delta 287 zcmZp1XmOa}&nUeyU^hRb^kyD`Z01;AhFpe3hHQpZhIoc7hGK?%hCGHG20exXhDy(z z{N$vZ{3Hej1_2;m&%nUQ_a6*^JO&0%pvruP5}?jvp!yPq3WgF?9gMP*Glb`g@-YN6 z_%rx0crv&E?FeKDWpHH(oqSJNjE%t&Xk^{wU&8ICLO=tGfDXw78VbVcK&8b%qf3BB g!<~g@{LjfnB9 0.1.1' +# Solid Queue UI +gem "mission_control-jobs" + group :development do # gem 'rubocop' diff --git a/Gemfile.lock b/Gemfile.lock index 061b75f..6897aea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -141,6 +141,16 @@ GEM marcel (1.1.0) mini_mime (1.1.5) minitest (5.25.5) + mission_control-jobs (1.1.0) + actioncable (>= 7.1) + actionpack (>= 7.1) + activejob (>= 7.1) + activerecord (>= 7.1) + importmap-rails (>= 1.2.1) + irb (~> 1.13) + railties (>= 7.1) + stimulus-rails + turbo-rails mocha (2.7.1) ruby2_keywords (>= 0.0.5) msgpack (1.8.0) @@ -340,6 +350,7 @@ DEPENDENCIES influxdb-rails jbuilder jquery-rails + mission_control-jobs mocha mysql2 propshaft diff --git a/README.md b/README.md index 26723c8..ccde307 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,9 @@ Available system resources: X CPU(s), YMMMB RAM SolidQueue plugin enabled in Puma ``` +I have deployed Mission Control as a UI for SolidQueue. The uri for mission control is `/jobs`. +For the development environment, the user/password is dev/secret. For the production environment, it is defined by environment variables. + ## Environment Variables ### Required Environment Variables @@ -160,6 +163,8 @@ SolidQueue plugin enabled in Puma * `WRESTLINGDEV_SECRET_KEY_BASE` - Rails application secret key (can be generated with `rake secret`) * `WRESTLINGDEV_EMAIL` - Email address (currently must be a Gmail account) * `WRESTLINGDEV_EMAIL_PWD` - Email password +* `WRESTLINGDEV_MISSION_CONTROL_USER` - mission control username +* `WRESTLINGDEV_MISSION_CONTROL_PASSWORD` - mission control password ### Optional Environment Variables * `SOLID_QUEUE_IN_PUMA` - Set to "true" to run Solid Queue workers inside Puma (default in development) diff --git a/config/environments/development.rb b/config/environments/development.rb index 464d860..a2a87c8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -99,4 +99,7 @@ Rails.application.configure do # Nobuild in development config.assets.build_assets = false + + MissionControl::Jobs.http_basic_auth_user = "dev" + MissionControl::Jobs.http_basic_auth_password = "secret" end diff --git a/config/environments/production.rb b/config/environments/production.rb index 03dbedc..10367ff 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -120,4 +120,7 @@ Rails.application.configure do config.assets.compile = true # Generate digests for assets URLs. config.assets.digest = true + + MissionControl::Jobs.http_basic_auth_user = ENV["WRESTLINGDEV_MISSION_CONTROL_USER"] + MissionControl::Jobs.http_basic_auth_password =ENV["WRESTLINGDEV_MISSION_CONTROL_PASSWORD"] end diff --git a/config/routes.rb b/config/routes.rb index c5a6147..255892e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,7 @@ Wrestling::Application.routes.draw do # Mount Action Cable server mount ActionCable.server => '/cable' + mount MissionControl::Jobs::Engine, at: "/jobs" resources :mats post "mats/:id/assign_next_match" => "mats#assign_next_match", :as => :assign_next_match diff --git a/deploy/docker-compose-test.yml b/deploy/docker-compose-test.yml index 04b21b8..d6f4c4c 100644 --- a/deploy/docker-compose-test.yml +++ b/deploy/docker-compose-test.yml @@ -26,6 +26,8 @@ services: - WRESTLINGDEV_INFLUXDB_HOST=influxdb - WRESTLINGDEV_INFLUXDB_PORT=8086 - SOLID_QUEUE_IN_PUMA=true + - WRESTLINGDEV_MISSION_CONTROL_USER=dev + - WRESTLINGDEV_MISSION_CONTROL_PASSWORD=secret networks: database: caching: diff --git a/deploy/kubernetes/manifests/wrestlingdev.yaml b/deploy/kubernetes/manifests/wrestlingdev.yaml index 1f31dd8..8032a48 100644 --- a/deploy/kubernetes/manifests/wrestlingdev.yaml +++ b/deploy/kubernetes/manifests/wrestlingdev.yaml @@ -109,6 +109,16 @@ spec: secretKeyRef: name: wrestlingdev-secrets key: influxdb_port + - name: WRESTLINGDEV_MISSION_CONTROL_USER + valueFrom: + secretKeyRef: + name: wrestlingdev-secrets + key: mission_control_user + - name: WRESTLINGDEV_MISSION_CONTROL_PASSWORD + valueFrom: + secretKeyRef: + name: wrestlingdev-secrets + key: mission_control_password # resources: # limits: # memory: "768Mi" diff --git a/deploy/kubernetes/secrets/secrets.yaml b/deploy/kubernetes/secrets/secrets.yaml index 08ab9d6..cf954f1 100644 --- a/deploy/kubernetes/secrets/secrets.yaml +++ b/deploy/kubernetes/secrets/secrets.yaml @@ -19,6 +19,9 @@ stringData: replication_password: PUT_REPLICATION_PASSWORD_HERE # Replication host used by the replica to connect to the master replication_host: wrestlingdev-mariadb + # Mission Control Credentials + mission_control_user: PUT_MISSION_CONTROL_USERNAME_HERE + mission_control_password: PUT_MISSION_CONTROL_PASSWORD_HERE # OPTIONAL # DELETE THESE LINES IF YOU'RE NOT USING THEM influxdb_database: PUT INFLUXDB DATABASE NAME HERE diff --git a/deploy/rails-dev-Dockerfile b/deploy/rails-dev-Dockerfile index 6f1ea22..4f6a2cd 100644 --- a/deploy/rails-dev-Dockerfile +++ b/deploy/rails-dev-Dockerfile @@ -4,7 +4,7 @@ FROM ruby:3.2.0 ARG USER_ID=1000 ARG GROUP_ID=1000 -RUN apt-get -qq update \ +RUN apt-get -qq update --fix-missing \ && apt-get -qq install -y \ build-essential \ sqlite3 \ diff --git a/deploy/rails-prod-Dockerfile b/deploy/rails-prod-Dockerfile index da39b53..6059263 100644 --- a/deploy/rails-prod-Dockerfile +++ b/deploy/rails-prod-Dockerfile @@ -6,7 +6,7 @@ ENV TINI_VERSION v0.19.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini -RUN apt-get -qq update \ +RUN apt-get -qq update --fix-missing \ && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y \ build-essential \ openssl \