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.2.2 to production #3866

Merged
merged 30 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6d044d0
Bump version to 9.2.2
github-actions[bot] Mar 6, 2024
15afac0
Create a search pipeline on hot swap, enabling hybrid search
bmquinn Mar 7, 2024
5ba3452
Bump typescript from 5.3.3 to 5.4.2 in /app/assets
dependabot[bot] Mar 7, 2024
17acc2c
Merge pull request #3867 from nulib/4568-hybrid-search
mbklein Mar 7, 2024
b30c82c
Make it possible to use Meadow's livebook integration in dev
mbklein Mar 7, 2024
5d06988
Bump jose from 4.15.1 to 4.15.5 in /app/assets
dependabot[bot] Mar 7, 2024
566cadb
Merge pull request #3870 from nulib/livebook-in-dev
mbklein Mar 7, 2024
d494de2
Adds a preprocessor to the search pipeline that restricts requests to…
bmquinn Mar 7, 2024
b4dbe61
Merge pull request #3872 from nulib/4549-preprocess-visibiliy
bmquinn Mar 7, 2024
8e8fbbd
Bump phoenix_ecto from 4.5.0 to 4.5.1 in /app
dependabot[bot] Mar 8, 2024
1a53028
Update the search processor to filter out unpublished works
bmquinn Mar 8, 2024
1ec5cab
Merge pull request #3874 from nulib/4549-search-processor-published
bmquinn Mar 8, 2024
26423aa
Don't start index pipeline name with "-" in release
mbklein Mar 11, 2024
171499d
Merge pull request #3875 from nulib/errant-dash-prefix
mbklein Mar 11, 2024
8c1d6e4
Bump phoenix_live_reload from 1.5.1 to 1.5.2 in /app
dependabot[bot] Mar 12, 2024
b301e00
Swap order of weights in hybrid search pipeline
mbklein Mar 12, 2024
a7ec50b
Merge pull request #3877 from nulib/reorder-hybrid-search-weights
bmquinn Mar 12, 2024
d9bb865
Bump @samvera/clover-iiif from 2.4.0-rc.0 to 2.4.0 in /app/assets
dependabot[bot] Mar 13, 2024
807e571
Bump downshift from 8.4.0 to 8.5.0 in /app/assets
dependabot[bot] Mar 13, 2024
e13959a
Bump @apollo/client from 3.9.5 to 3.9.7 in /app/assets
dependabot[bot] Mar 14, 2024
f78759a
Bump sass from 1.71.1 to 1.72.0 in /app/assets
dependabot[bot] Mar 14, 2024
8561279
Merge dependabot/npm_and_yarn/app/assets/deploy/staging/sass-1.72.0 i…
github-actions[bot] Mar 14, 2024
6360e4a
Merge dependabot/npm_and_yarn/app/assets/deploy/staging/apollo/client…
github-actions[bot] Mar 14, 2024
ad4e614
Merge dependabot/npm_and_yarn/app/assets/deploy/staging/downshift-8.5…
github-actions[bot] Mar 14, 2024
0789213
Merge dependabot/npm_and_yarn/app/assets/deploy/staging/samvera/clove…
github-actions[bot] Mar 14, 2024
5aa9b0c
Merge dependabot/hex/app/deploy/staging/phoenix_live_reload-1.5.2 int…
github-actions[bot] Mar 14, 2024
081c266
Merge dependabot/hex/app/deploy/staging/phoenix_ecto-4.5.1 into combi…
github-actions[bot] Mar 14, 2024
b898221
Merge dependabot/npm_and_yarn/app/assets/jose-4.15.5 into combined-de…
github-actions[bot] Mar 14, 2024
da7ced4
Merge dependabot/npm_and_yarn/app/assets/deploy/staging/typescript-5.…
github-actions[bot] Mar 14, 2024
bbc2059
Merge pull request #3882 from nulib/combined-dependencies
mbklein Mar 14, 2024
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ If you would like to interact directly with the database

You can visit the GraphiQL interface at: [`https://[YOURENV].dev.rdc.library.northwestern.edu:3001/api/graphiql`](https:/[YOURENV].dev.rdc.library.northwestern.edu:3001/api/graphiql)

### Livebook Integration

To start meadow with superuser Livebook integration, run: `MEADOW_ROOT/bin/meadow-livebook [iex arguments]`

For example, from Meadow's root directory: `./bin/meadow-livebook phx.server`

### Opensearch Dashboard

- To start: `es-proxy start`
Expand Down
54 changes: 27 additions & 27 deletions app/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions app/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"@honeybadger-io/react": "^6.1.7",
"@nulib/design-system": "^1.5.1",
"@radix-ui/react-dialog": "^1.0.5",
"@samvera/clover-iiif": "2.4.0-rc.0",
"@samvera/clover-iiif": "2.4.0",
"@samvera/image-downloader": "^1.1.1",
"bulma": "^0.9.4",
"bulma-checkradio": "^2.1.3",
"bulma-pageloader": "^0.3.0",
"bulma-switch": "^2.0.0",
"bulma-toast": "^2.4.4",
"classnames": "^2.5.1",
"downshift": "^8.4.0",
"downshift": "^8.5.0",
"edtf": "^4.6.0",
"esbuild-plugin-svgr": "^2.1.0",
"faker": "^5.5.3",
Expand Down Expand Up @@ -109,9 +109,9 @@
"react-dom": "^18.2.0",
"react-router-dom": "^5.3.0",
"react-router-prop-types": "^1.0.5",
"sass": "^1.71.1",
"sass": "^1.72.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"typescript": "^5.4.2",
"use-phoenix-channel": "^1.1.1"
}
}
15 changes: 11 additions & 4 deletions app/lib/env.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ if !function_exported?(:Env, :prefix, 0) do
alias Hush.Provider.{AwsSecretsManager, SystemEnvironment}

def prefix do
with env <- if(function_exported?(Mix, :env, 0), do: Mix.env(), else: nil) do
[System.get_env("DEV_PREFIX"), env] |> Enum.reject(&is_nil/1) |> Enum.join("-")
end
env =
cond do
System.get_env("RELEASE_NAME") -> nil
function_exported?(Mix, :env, 0) -> Mix.env()
true -> nil
end

[System.get_env("DEV_PREFIX"), env] |> Enum.reject(&is_nil/1) |> Enum.join("-")
end

def prefix(val), do: [prefix(), to_string(val)] |> Enum.reject(&is_nil/1) |> Enum.join("-")
def prefix(val), do: [prefix(), to_string(val)] |> reject_empty() |> Enum.join("-")
def atom_prefix(val), do: prefix(val) |> String.to_atom()

def aws_secret(name, opts \\ []),
Expand All @@ -23,5 +28,7 @@ if !function_exported?(:Env, :prefix, 0) do
defp hush_secret(provider, name, opts), do: {:hush, provider, name, opts}

defp secrets_path, do: System.get_env("SECRETS_PATH", "config")

defp reject_empty(list), do: Enum.reject(list, &(is_nil(&1) or &1 == ""))
end
end
69 changes: 64 additions & 5 deletions app/lib/meadow/search/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ defmodule Meadow.Search.Index do
:noop

pipeline ->
create_vector_pipeline(pipeline, SearchConfig.embedding_model_id(), "embedding_text")
pipeline
|> create_ingest_pipeline(SearchConfig.embedding_model_id(), "embedding_text")
|> create_search_pipeline()
end

with timestamp <- DateTime.utc_now() |> DateTime.to_unix(:millisecond),
Expand All @@ -39,14 +41,70 @@ defmodule Meadow.Search.Index do
end

@doc """
Create a vector pipeline, takes a name, model id, source field, and a target field
Returns {:ok, {}}
Create a search pipeline, takes a name, normalization_technique, combination_technique, and a weight field
Returns name
"""
def create_vector_pipeline(name, model_id, source_field, target_field \\ "embedding") do
def create_search_pipeline(
name,
normalization_technique \\ "l2",
combination_technique \\ "arithmetic_mean",
weights \\ [0.7, 0.3]
) do
pipeline = %{
"description" => "Search pipeline for #{name}",
"request_processors" => [
%{
"filter_query" => %{
"description" => "Restricts requests to publicly visible documents",
"query" => %{
"bool" => %{
"must" => [
%{
"terms" => %{
"visibility" => ["Public", "Institution"]
}
},
%{
"term" => %{
"published" => true
}
}
]
}
}
}
}
],
"phase_results_processors" => [
%{
"normalization-processor" => %{
"normalization" => %{
"technique" => normalization_technique
},
"combination" => %{
"technique" => combination_technique,
"parameters" => %{
"weights" => weights
}
}
}
}
]
}

HTTP.put(["_search", "pipeline", name], pipeline)
name
end

@doc """
Create a ingest pipeline, takes a name, model id, source field, and a target field
Returns name
"""
def create_ingest_pipeline(name, model_id, source_field, target_field \\ "embedding") do
model_name = embedding_model_name(model_id)

pipeline = %{
"description" => "Vector pipeline for #{name}",
"description" => "Ingest pipeline for #{name}",
"processors" => [
%{
"text_embedding" => %{
Expand Down Expand Up @@ -74,6 +132,7 @@ defmodule Meadow.Search.Index do
}

HTTP.put(["_ingest", "pipeline", name], pipeline)
name
end

defp embedding_model_name(model_id) do
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.2.1"
@app_version "9.2.2"

def project do
[
Expand Down
Loading
Loading