From e59f7631b99c84650915e802110cb69b34b8fa98 Mon Sep 17 00:00:00 2001 From: Andrey Bondarenko Date: Sun, 12 Jan 2025 12:31:49 +0100 Subject: [PATCH 01/10] Update k8s deployment example Update k8s deployment example * remove unused gem-caches * update entrypoints to correspond 0.22.x * add liveness probe --- docs/How_to_install_Dawarich_in_k8s.md | 60 +++++++++----------------- 1 file changed, 21 insertions(+), 39 deletions(-) diff --git a/docs/How_to_install_Dawarich_in_k8s.md b/docs/How_to_install_Dawarich_in_k8s.md index f21c8658..71dc40a1 100644 --- a/docs/How_to_install_Dawarich_in_k8s.md +++ b/docs/How_to_install_Dawarich_in_k8s.md @@ -36,37 +36,7 @@ spec: storageClassName: longhorn resources: requests: - storage: 15Gi ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - namespace: dawarich - name: gem-cache - labels: - storage.k8s.io/name: longhorn -spec: - accessModes: - - ReadWriteOnce - storageClassName: longhorn - resources: - requests: - storage: 15Gi ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - namespace: dawarich - name: gem-sidekiq - labels: - storage.k8s.io/name: longhorn -spec: - accessModes: - - ReadWriteOnce - storageClassName: longhorn - resources: - requests: - storage: 15Gi + storage: 1Gi --- apiVersion: v1 kind: PersistentVolumeClaim @@ -81,7 +51,7 @@ spec: storageClassName: longhorn resources: requests: - storage: 15Gi + storage: 1Gi ``` ### Deployment @@ -143,14 +113,12 @@ spec: image: freikin/dawarich:0.16.4 imagePullPolicy: Always volumeMounts: - - mountPath: /usr/local/bundle/gems - name: gem-app - mountPath: /var/app/public name: public - mountPath: /var/app/tmp/imports/watched name: watched command: - - "dev-entrypoint.sh" + - "web-entrypoint.sh" args: - "bin/rails server -p 3000 -b ::" resources: @@ -199,16 +167,14 @@ spec: image: freikin/dawarich:0.16.4 imagePullPolicy: Always volumeMounts: - - mountPath: /usr/local/bundle/gems - name: gem-sidekiq - mountPath: /var/app/public name: public - mountPath: /var/app/tmp/imports/watched name: watched command: - - "dev-entrypoint.sh" + - "sidekiq-entrypoint.sh" args: - - "sidekiq" + - "bundle exec sidekiq" resources: requests: memory: "1Gi" @@ -216,6 +182,22 @@ spec: limits: memory: "3Gi" cpu: "1500m" + livenessProbe: + httpGet: + path: /api/v1/health + port: 3000 + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + readinessProbe: + httpGet: + path: / + port: 3000 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 volumes: - name: gem-cache persistentVolumeClaim: From 4e1cbda341a2c90289c31aa31a5b0cf866aeafb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:33:14 +0000 Subject: [PATCH 02/10] Bump rubocop-rails from 2.29.0 to 2.29.1 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.29.0 to 2.29.1. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.29.0...v2.29.1) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 43f74521..50976765 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -181,7 +181,7 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - language_server-protocol (3.17.0.3) + language_server-protocol (3.17.0.4) logger (1.6.5) lograge (0.14.0) actionpack (>= 4) @@ -342,7 +342,7 @@ GEM rswag-ui (2.16.0) actionpack (>= 5.2, < 8.1) railties (>= 5.2, < 8.1) - rubocop (1.70.0) + rubocop (1.71.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -354,7 +354,7 @@ GEM unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.37.0) parser (>= 3.3.1.0) - rubocop-rails (2.29.0) + rubocop-rails (2.29.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.52.0, < 2.0) From f1fbb9acac6a96242436636858ea3f0ec3b6a00d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:33:26 +0000 Subject: [PATCH 03/10] Bump database_consistency from 2.0.0 to 2.0.3 Bumps [database_consistency](https://github.com/djezzzl/database_consistency) from 2.0.0 to 2.0.3. - [Changelog](https://github.com/djezzzl/database_consistency/blob/master/CHANGELOG.md) - [Commits](https://github.com/djezzzl/database_consistency/compare/v2.0.0...v2.0.3) --- updated-dependencies: - dependency-name: database_consistency dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 43f74521..1186f8ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -109,7 +109,7 @@ GEM data_migrate (11.2.0) activerecord (>= 6.1) railties (>= 6.1) - database_consistency (2.0.0) + database_consistency (2.0.3) activerecord (>= 3.2) date (3.4.1) debug (1.10.0) @@ -410,7 +410,7 @@ GEM tailwindcss-ruby (3.4.17-x86_64-darwin) tailwindcss-ruby (3.4.17-x86_64-linux) thor (1.3.2) - timeout (0.4.2) + timeout (0.4.3) turbo-rails (2.0.11) actionpack (>= 6.0.0) railties (>= 6.0.0) From 7a5c7a8c1c29289972fb4dac936e38ba12ae6732 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:34:03 +0000 Subject: [PATCH 04/10] Bump sidekiq from 7.3.7 to 7.3.8 Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.3.7 to 7.3.8. - [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) - [Commits](https://github.com/sidekiq/sidekiq/compare/v7.3.7...v7.3.8) --- updated-dependencies: - dependency-name: sidekiq dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 43f74521..6e54ca85 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -366,7 +366,8 @@ GEM shrine (3.6.0) content_disposition (~> 1.0) down (~> 5.1) - sidekiq (7.3.7) + sidekiq (7.3.8) + base64 connection_pool (>= 2.3.0) logger rack (>= 2.2.4) From e210fb89cf226fb888460439b58a033184566f34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:34:20 +0000 Subject: [PATCH 05/10] Bump tailwindcss-rails from 3.3.0 to 3.3.1 Bumps [tailwindcss-rails](https://github.com/rails/tailwindcss-rails) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/rails/tailwindcss-rails/releases) - [Changelog](https://github.com/rails/tailwindcss-rails/blob/main/CHANGELOG.md) - [Commits](https://github.com/rails/tailwindcss-rails/compare/v3.3.0...v3.3.1) --- updated-dependencies: - dependency-name: tailwindcss-rails dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 43f74521..b45a5b8e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -163,7 +163,8 @@ GEM activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.8.0) - irb (1.14.3) + irb (1.15.1) + pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) json (2.9.1) @@ -240,6 +241,9 @@ GEM patience_diff (1.2.0) optimist (~> 3.0) pg (1.5.9) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) prometheus_exporter (2.2.0) webrick pry (0.14.2) @@ -400,9 +404,9 @@ GEM attr_extras (>= 6.2.4) diff-lcs patience_diff - tailwindcss-rails (3.3.0) + tailwindcss-rails (3.3.1) railties (>= 7.0.0) - tailwindcss-ruby + tailwindcss-ruby (~> 3.0) tailwindcss-ruby (3.4.17) tailwindcss-ruby (3.4.17-aarch64-linux) tailwindcss-ruby (3.4.17-arm-linux) From 3c81bd20e09628905c77f607279933d78ad37f4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:10:46 +0000 Subject: [PATCH 06/10] Bump ffaker from 2.23.0 to 2.24.0 Bumps [ffaker](https://github.com/ffaker/ffaker) from 2.23.0 to 2.24.0. - [Release notes](https://github.com/ffaker/ffaker/releases) - [Changelog](https://github.com/ffaker/ffaker/blob/main/Changelog.md) - [Commits](https://github.com/ffaker/ffaker/compare/v2.23.0...v2.24.0) --- updated-dependencies: - dependency-name: ffaker dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0bfd8209..a92bbe8d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -139,7 +139,7 @@ GEM factory_bot (~> 6.5) railties (>= 5.0.0) fakeredis (0.1.4) - ffaker (2.23.0) + ffaker (2.24.0) foreman (0.88.1) fugit (1.11.1) et-orbi (~> 1, >= 1.2.11) From d3ffe4670afccb2c19bc94ea78f945cddee9f5c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:11:21 +0000 Subject: [PATCH 07/10] Bump strong_migrations from 2.1.0 to 2.2.0 Bumps [strong_migrations](https://github.com/ankane/strong_migrations) from 2.1.0 to 2.2.0. - [Changelog](https://github.com/ankane/strong_migrations/blob/master/CHANGELOG.md) - [Commits](https://github.com/ankane/strong_migrations/compare/v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: strong_migrations dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0bfd8209..1427ae40 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -399,8 +399,8 @@ GEM stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.2) - strong_migrations (2.1.0) - activerecord (>= 6.1) + strong_migrations (2.2.0) + activerecord (>= 7) super_diff (0.15.0) attr_extras (>= 6.2.4) diff-lcs From 29529b60f64bea94bc8193ff409d5f0ff66b35a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:45:11 +0000 Subject: [PATCH 08/10] Bump chartkick from 5.1.2 to 5.1.3 Bumps [chartkick](https://github.com/ankane/chartkick) from 5.1.2 to 5.1.3. - [Changelog](https://github.com/ankane/chartkick/blob/master/CHANGELOG.md) - [Commits](https://github.com/ankane/chartkick/compare/v5.1.2...v5.1.3) --- updated-dependencies: - dependency-name: chartkick dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index a9afa268..e45b4984 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,7 +102,7 @@ GEM msgpack (~> 1.2) builder (3.3.0) byebug (11.1.3) - chartkick (5.1.2) + chartkick (5.1.3) coderay (1.1.3) concurrent-ruby (1.3.5) connection_pool (2.5.0) From 4e217b8a114499ee80d386cc33d2b3f93a438e27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:45:16 +0000 Subject: [PATCH 09/10] Bump puma from 6.5.0 to 6.6.0 Bumps [puma](https://github.com/puma/puma) from 6.5.0 to 6.6.0. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v6.5.0...v6.6.0) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index a9afa268..25fffd6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -267,7 +267,7 @@ GEM date stringio public_suffix (6.0.1) - puma (6.5.0) + puma (6.6.0) nio4r (~> 2.0) pundit (2.4.0) activesupport (>= 3.0.0) From bd39b295a438d259b6c182f6d3198d45d4ef3307 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 6 Feb 2025 19:50:03 +0100 Subject: [PATCH 10/10] Return app version in health response --- .app_version | 2 +- CHANGELOG.md | 6 ++++++ app/controllers/api/v1/health_controller.rb | 2 ++ spec/requests/api/v1/health_spec.rb | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.app_version b/.app_version index df47809d..379191a4 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.23.6 +0.23.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9024ee26..095bcdb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 0.23.7 - 2025-02-06 + +### Added + +- `X-Dawarich-Version` header to the `GET /api/v1/health` endpoint response. + # 0.23.6 - 2025-02-06 ### Added diff --git a/app/controllers/api/v1/health_controller.rb b/app/controllers/api/v1/health_controller.rb index 87df7d96..8e13d165 100644 --- a/app/controllers/api/v1/health_controller.rb +++ b/app/controllers/api/v1/health_controller.rb @@ -10,6 +10,8 @@ class Api::V1::HealthController < ApiController response.set_header('X-Dawarich-Response', 'Hey, I\'m alive!') end + response.set_header('X-Dawarich-Version', APP_VERSION) + render json: { status: 'ok' } end end diff --git a/spec/requests/api/v1/health_spec.rb b/spec/requests/api/v1/health_spec.rb index 4861b399..139a207c 100644 --- a/spec/requests/api/v1/health_spec.rb +++ b/spec/requests/api/v1/health_spec.rb @@ -23,5 +23,11 @@ RSpec.describe 'Api::V1::Healths', type: :request do expect(response.headers['X-Dawarich-Response']).to eq('Hey, I\'m alive and authenticated!') end end + + it 'returns the correct version' do + get '/api/v1/health' + + expect(response.headers['X-Dawarich-Version']).to eq(APP_VERSION) + end end end