diff --git a/.DS_Store b/.DS_Store index 3d93dff..e0512ec 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Gemfile b/Gemfile index edcba47..2412df2 100644 --- a/Gemfile +++ b/Gemfile @@ -74,11 +74,9 @@ gem 'solid_cable' gem 'puma' gem 'tzinfo-data' gem 'daemons' -# Interface for viewing and managing background jobs -# gem 'delayed_job_web' -# Note: solid_queue-ui is not compatible with Rails 8.0 yet -# We'll create a custom UI or wait for compatibility updates -# gem 'solid_queue_ui', '~> 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 \