From e7d19818199e5db486bdcd8acb1bb6d4723fd5f5 Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 14:01:58 -0600 Subject: [PATCH 1/8] pin older ruby-lsp --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index fe45ea68..3f33914c 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,7 @@ group :development do gem "byebug", platforms: %i[mri mingw x64_mingw] gem "pry-rails" gem "standard" - gem "ruby-lsp" + gem "ruby-lsp", "~> 0.12.3" gem "rubocop-rails" gem "rubocop-capybara" gem "rubocop-minitest" diff --git a/Gemfile.lock b/Gemfile.lock index 2528e03e..0ee5b9c3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -270,7 +270,7 @@ GEM postmark-rails (0.22.1) actionmailer (>= 3.0.0) postmark (>= 1.21.3, < 2.0) - prism (0.19.0) + prism (0.17.1) protocol (2.0.0) ruby_parser (~> 3.0) pry (0.14.2) @@ -373,9 +373,9 @@ GEM rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) - ruby-lsp (0.13.2) + ruby-lsp (0.12.5) language_server-protocol (~> 3.17.0) - prism (>= 0.19.0, < 0.20) + prism (>= 0.17.1, < 0.18) sorbet-runtime (>= 0.5.5685) ruby-openai (7.0.1) event_stream_parser (>= 0.3.0, < 2.0.0) @@ -412,7 +412,7 @@ GEM fugit (~> 1.11.0) railties (>= 7.1) thor (~> 1.3.1) - sorbet-runtime (0.5.11156) + sorbet-runtime (0.5.11690) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -521,7 +521,7 @@ DEPENDENCIES rubocop-capybara rubocop-minitest rubocop-rails - ruby-lsp + ruby-lsp (~> 0.12.3) ruby-openai (~> 7.0.1) selenium-webdriver solid_queue (~> 1.0.0) From d5e0e91d224cc96de077283403e8d9c378d6a112 Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 14:10:08 -0600 Subject: [PATCH 2/8] pin prism instead --- Gemfile | 3 ++- Gemfile.lock | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 3f33914c..c578dc9a 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,8 @@ group :development do gem "byebug", platforms: %i[mri mingw x64_mingw] gem "pry-rails" gem "standard" - gem "ruby-lsp", "~> 0.12.3" + gem "ruby-lsp" + gem "prism", "0.18.0" gem "rubocop-rails" gem "rubocop-capybara" gem "rubocop-minitest" diff --git a/Gemfile.lock b/Gemfile.lock index 0ee5b9c3..a8d34f42 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -270,7 +270,7 @@ GEM postmark-rails (0.22.1) actionmailer (>= 3.0.0) postmark (>= 1.21.3, < 2.0) - prism (0.17.1) + prism (0.18.0) protocol (2.0.0) ruby_parser (~> 3.0) pry (0.14.2) @@ -373,9 +373,9 @@ GEM rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) - ruby-lsp (0.12.5) + ruby-lsp (0.13.1) language_server-protocol (~> 3.17.0) - prism (>= 0.17.1, < 0.18) + prism (>= 0.18.0, < 0.19) sorbet-runtime (>= 0.5.5685) ruby-openai (7.0.1) event_stream_parser (>= 0.3.0, < 2.0.0) @@ -510,6 +510,7 @@ DEPENDENCIES ostruct pg (~> 1.1) postmark-rails + prism (= 0.18.0) pry-rails puma (>= 6.0) rack-cors @@ -521,7 +522,7 @@ DEPENDENCIES rubocop-capybara rubocop-minitest rubocop-rails - ruby-lsp (~> 0.12.3) + ruby-lsp ruby-openai (~> 7.0.1) selenium-webdriver solid_queue (~> 1.0.0) From 46a67704d4c05c52623fbc70111e2464efeb8edd Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 14:17:13 -0600 Subject: [PATCH 3/8] fix docker instead --- Dockerfile | 3 ++- Gemfile | 1 - Gemfile.lock | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index fad9d39c..63f3eed3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,7 +95,8 @@ RUN apk add --no-cache bash git build-base postgresql-dev curl-dev gcompat tzdat ENV BUNDLE_CACHE=/tmp/bundle \ BUNDLE_JOBS=2 \ - PORT=3000 + PORT=3000 \ + CFLAGS="-Wno-error=calloc-transposed-args" # https://github.com/AllYourBot/hostedgpt/pull/580 WORKDIR /rails COPY Gemfile Gemfile.lock .ruby-version ./ diff --git a/Gemfile b/Gemfile index c578dc9a..fe45ea68 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,6 @@ group :development do gem "pry-rails" gem "standard" gem "ruby-lsp" - gem "prism", "0.18.0" gem "rubocop-rails" gem "rubocop-capybara" gem "rubocop-minitest" diff --git a/Gemfile.lock b/Gemfile.lock index a8d34f42..227c5dd8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -270,7 +270,7 @@ GEM postmark-rails (0.22.1) actionmailer (>= 3.0.0) postmark (>= 1.21.3, < 2.0) - prism (0.18.0) + prism (0.19.0) protocol (2.0.0) ruby_parser (~> 3.0) pry (0.14.2) @@ -373,10 +373,10 @@ GEM rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) - ruby-lsp (0.13.1) + ruby-lsp (0.14.0) language_server-protocol (~> 3.17.0) - prism (>= 0.18.0, < 0.19) - sorbet-runtime (>= 0.5.5685) + prism (>= 0.19.0, < 0.22) + sorbet-runtime (>= 0.5.10782) ruby-openai (7.0.1) event_stream_parser (>= 0.3.0, < 2.0.0) faraday (>= 1) @@ -510,7 +510,6 @@ DEPENDENCIES ostruct pg (~> 1.1) postmark-rails - prism (= 0.18.0) pry-rails puma (>= 6.0) rack-cors From 6b05bf6857137506a2e20634bb1fbee4f61b1574 Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 14:17:52 -0600 Subject: [PATCH 4/8] revert lock --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 227c5dd8..2528e03e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -373,10 +373,10 @@ GEM rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) - ruby-lsp (0.14.0) + ruby-lsp (0.13.2) language_server-protocol (~> 3.17.0) - prism (>= 0.19.0, < 0.22) - sorbet-runtime (>= 0.5.10782) + prism (>= 0.19.0, < 0.20) + sorbet-runtime (>= 0.5.5685) ruby-openai (7.0.1) event_stream_parser (>= 0.3.0, < 2.0.0) faraday (>= 1) @@ -412,7 +412,7 @@ GEM fugit (~> 1.11.0) railties (>= 7.1) thor (~> 1.3.1) - sorbet-runtime (0.5.11690) + sorbet-runtime (0.5.11156) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) From 30976722256f52d4453f9ebc52bba1aebcf30731 Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 14:33:13 -0600 Subject: [PATCH 5/8] comment --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 63f3eed3..5e5d2182 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,7 +96,8 @@ RUN apk add --no-cache bash git build-base postgresql-dev curl-dev gcompat tzdat ENV BUNDLE_CACHE=/tmp/bundle \ BUNDLE_JOBS=2 \ PORT=3000 \ - CFLAGS="-Wno-error=calloc-transposed-args" # https://github.com/AllYourBot/hostedgpt/pull/580 + CFLAGS="-Wno-error=calloc-transposed-args" +# CFLAGS is needed to fix https://github.com/AllYourBot/hostedgpt/pull/580 WORKDIR /rails COPY Gemfile Gemfile.lock .ruby-version ./ From ac097bc25f0efa42383d409be91c24e2b4e03c03 Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 14:48:41 -0600 Subject: [PATCH 6/8] Update Dockerfile for bundle installation --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e5d2182..4649d26d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,15 +95,14 @@ RUN apk add --no-cache bash git build-base postgresql-dev curl-dev gcompat tzdat ENV BUNDLE_CACHE=/tmp/bundle \ BUNDLE_JOBS=2 \ - PORT=3000 \ - CFLAGS="-Wno-error=calloc-transposed-args" -# CFLAGS is needed to fix https://github.com/AllYourBot/hostedgpt/pull/580 + PORT=3000 WORKDIR /rails COPY Gemfile Gemfile.lock .ruby-version ./ RUN --mount=type=cache,id=gems,target=/tmp/bundle \ - bundle install + CFLAGS="-Wno-error=calloc-transposed-args" bundle install +# CFLAGS is needed to fix https://github.com/AllYourBot/hostedgpt/pull/580 RUN apk add --no-cache postgresql-client From 2b521cba9239922759be2359ccdcb6aa3d9f3157 Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 14:57:46 -0600 Subject: [PATCH 7/8] Simplify Dockerfile bundle install command --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4649d26d..fad9d39c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -101,8 +101,7 @@ WORKDIR /rails COPY Gemfile Gemfile.lock .ruby-version ./ RUN --mount=type=cache,id=gems,target=/tmp/bundle \ - CFLAGS="-Wno-error=calloc-transposed-args" bundle install -# CFLAGS is needed to fix https://github.com/AllYourBot/hostedgpt/pull/580 + bundle install RUN apk add --no-cache postgresql-client From 347289350f2b379c74d7ef51866d3f802f5537ad Mon Sep 17 00:00:00 2001 From: Keith Schacht Date: Tue, 10 Dec 2024 15:12:00 -0600 Subject: [PATCH 8/8] Pin docker --- Dockerfile | 3 ++- Gemfile.lock | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fad9d39c..93ec3522 100644 --- a/Dockerfile +++ b/Dockerfile @@ -89,7 +89,8 @@ EXPOSE 3000 #### START of DEV #### # RUBY_VERSION is the only thing used from anything above -FROM ruby:${RUBY_VERSION}-alpine AS development +FROM ruby:${RUBY_VERSION}-alpine@sha256:caeab43b356463e63f87af54a03de1ae4687b36da708e6d37025c557ade450f8 AS development +# TODO: When we bump to a new version of ruby we'll ahve to unpin from this specific sha RUN apk add --no-cache bash git build-base postgresql-dev curl-dev gcompat tzdata vips-dev imagemagick diff --git a/Gemfile.lock b/Gemfile.lock index 2528e03e..f96fc4fb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -226,6 +226,8 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) + nokogiri (1.16.7-aarch64-linux) + racc (~> 1.4) nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) nokogiri (1.16.7-x86_64-darwin) @@ -436,6 +438,8 @@ GEM railties (>= 6.0.0) stringio (3.1.1) sync (0.5.0) + tailwindcss-rails (2.7.2-aarch64-linux) + railties (>= 7.0.0) tailwindcss-rails (2.7.2-arm64-darwin) railties (>= 7.0.0) tailwindcss-rails (2.7.2-x86_64-darwin) @@ -443,6 +447,7 @@ GEM tailwindcss-rails (2.7.2-x86_64-linux) railties (>= 7.0.0) thor (1.3.2) + tiktoken_ruby (0.0.9-aarch64-linux) tiktoken_ruby (0.0.9-arm64-darwin) tiktoken_ruby (0.0.9-x86_64-darwin) tiktoken_ruby (0.0.9-x86_64-linux) @@ -481,6 +486,7 @@ GEM zeitwerk (2.7.1) PLATFORMS + aarch64-linux-musl arm64-darwin-23 arm64-darwin-24 x86_64-darwin-22