Skip to content

Commit

Permalink
Merge pull request #25 from dwyl/model_management#24
Browse files Browse the repository at this point in the history
[PR] Refactoring model management
  • Loading branch information
nelsonic authored Nov 21, 2023
2 parents a3c8c3b + e841abe commit 7d17351
Show file tree
Hide file tree
Showing 8 changed files with 473 additions and 214 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ RUN mix local.hex --force && \

# set build ENV
ENV MIX_ENV="prod"
ENV BUMBLEBEE_CACHE_DIR="/app/.bumblebee/"


# install mix dependencies
COPY mix.exs mix.lock ./
Expand Down Expand Up @@ -102,7 +100,5 @@ USER nobody
# Set the runtime ENV
ENV ECTO_IPV6="true"
ENV ERL_AFLAGS="-proto_dist inet6_tcp"
ENV BUMBLEBEE_CACHE_DIR="/app/.bumblebee/"


CMD ["/app/bin/server"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@ Awesome! 🎉
> and more resources your server will need to have to handle this heavier workload.

> [!WARNING]
>
> We've created a small module that allows you to have multiple models
> cached and downloaded and keep this logic contained.
>
> For this, check the [`deployment guide`](./deployment.md#5-a-better-model-management).

# 7. How do I deploy this thing?

There are a few considerations you may want to have
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ import_config "#{config_env()}.exs"
# After deploying, you set it to `false` and deploy it again,
# so the application doesn't download the model again on every restart.
config :app,
force_models_download: false
models_cache_dir: ".bumblebee"
4 changes: 0 additions & 4 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,3 @@ config :phoenix, :stacktrace_depth, 20

# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime

# App configuration
config :app,
models_cache_dir: ".bumblebee"
4 changes: 1 addition & 3 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ config :phoenix, :plug_init_mode, :runtime

# App configuration
config :app,
use_test_models: true,
force_models_download: true,
models_cache_dir: ".bumblebee"
use_test_models: true
Loading

0 comments on commit 7d17351

Please sign in to comment.