Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy v9.4.3 to production #4077

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions app/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ config :meadow, Meadow.Search.Cluster,
bulk_page_size: 200,
bulk_wait_interval: 500,
json_encoder: Ecto.Jason,
embedding_model_id: aws_secret("meadow",
dig: ["search", "embedding_model_id"],
default: nil
)
embedding_model_id:
aws_secret("meadow",
dig: ["search", "embedding_model_id"],
default: nil
),
embedding_dimensions:
aws_secret("meadow", dig: ["search", "embedding_dimensions"], default: nil)

config :meadow,
ark: %{
Expand Down
24 changes: 24 additions & 0 deletions app/lib/meadow/search/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Meadow.Search.Config do
@moduledoc """
Convenience methods for retrieving search-specific configuration
"""
alias Meadow.Search.HTTP

require Logger

Expand Down Expand Up @@ -38,6 +39,7 @@ defmodule Meadow.Search.Config do
File.read!(settings)
|> Jason.decode!()
|> put_in(["settings", "default_pipeline"], pipeline)
|> add_embedding_dimension()

{%{settings: settings}, _} ->
File.read!(settings) |> Jason.decode!()
Expand All @@ -52,6 +54,28 @@ defmodule Meadow.Search.Config do
|> Keyword.get(:embedding_model_id)
end

def add_embedding_dimension(
%{"mappings" => %{"properties" => %{"embedding" => %{"dimension" => _}}}} = settings
) do
case embedding_model_dimensions() do
nil -> settings
_ -> insert_embedding_dimension(settings)
end
end

def insert_embedding_dimension(settings),
do:
put_in(
settings,
["mappings", "properties", "embedding", "dimension"],
embedding_model_dimensions()
)

def embedding_model_dimensions do
Application.get_env(:meadow, Meadow.Search.Cluster)
|> Keyword.get(:embedding_dimensions)
end

def index_versions do
index_configs()
|> Enum.map(& &1.version)
Expand Down
2 changes: 1 addition & 1 deletion app/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Code.require_file("lib/env.ex")
defmodule Meadow.MixProject do
use Mix.Project

@app_version "9.4.2"
@app_version "9.4.3"

def project do
[
Expand Down
Loading