From f2c5d101c3d0ce13c1921e5d27ff84c2b213d4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Wed, 25 Oct 2023 12:17:59 +0200 Subject: [PATCH] Deprecate warmup_apps.sh in favour of warmup_apps (#2305) --- README.md | 2 +- lib/livebook/hubs/dockerfile.ex | 2 +- rel/server/overlays/bin/warmup_apps | 4 ++++ rel/server/overlays/bin/warmup_apps.sh | 2 ++ test/livebook/hubs/dockerfile_test.exs | 4 ++-- 5 files changed, 10 insertions(+), 4 deletions(-) create mode 100755 rel/server/overlays/bin/warmup_apps diff --git a/README.md b/README.md index cfa978d2b..8ad5f6279 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ The following environment variables can be used to configure Livebook on boot: * `LIVEBOOK_APPS_PATH_WARMUP` - sets the warmup mode for apps deployed from `LIVEBOOK_APPS_PATH`. Must be either "auto" (apps are warmed up on Livebook startup, right before app deployment) or "manual" (apps are warmed up when - building the Docker image; to do so add "RUN /app/bin/warmup_apps.sh" to + building the Docker image; to do so add "RUN /app/bin/warmup_apps" to your image). Defaults to "auto". * `LIVEBOOK_BASE_URL_PATH` - sets the base url path the web application is diff --git a/lib/livebook/hubs/dockerfile.ex b/lib/livebook/hubs/dockerfile.ex index 4fcba6fad..d1e1b70cd 100644 --- a/lib/livebook/hubs/dockerfile.ex +++ b/lib/livebook/hubs/dockerfile.ex @@ -112,7 +112,7 @@ defmodule Livebook.Hubs.Dockerfile do apps_warmup = """ # Cache apps setup at build time - RUN /app/bin/warmup_apps.sh + RUN /app/bin/warmup_apps """ random_secret_key_base = Livebook.Utils.random_secret_key_base() diff --git a/rel/server/overlays/bin/warmup_apps b/rel/server/overlays/bin/warmup_apps new file mode 100755 index 000000000..d2f38ab11 --- /dev/null +++ b/rel/server/overlays/bin/warmup_apps @@ -0,0 +1,4 @@ +#!/bin/sh + +cd -P -- "$(dirname -- "$0")" +exec ./livebook eval Livebook.Release.warmup_apps diff --git a/rel/server/overlays/bin/warmup_apps.sh b/rel/server/overlays/bin/warmup_apps.sh index d2f38ab11..c24d2f0bf 100755 --- a/rel/server/overlays/bin/warmup_apps.sh +++ b/rel/server/overlays/bin/warmup_apps.sh @@ -1,4 +1,6 @@ #!/bin/sh +echo "Using warmup_apps.sh is deprecated. Please use warmup_apps instead." + cd -P -- "$(dirname -- "$0")" exec ./livebook eval Livebook.Release.warmup_apps diff --git a/test/livebook/hubs/dockerfile_test.exs b/test/livebook/hubs/dockerfile_test.exs index 097047aac..566eb1600 100644 --- a/test/livebook/hubs/dockerfile_test.exs +++ b/test/livebook/hubs/dockerfile_test.exs @@ -31,7 +31,7 @@ defmodule Livebook.Hubs.DockerfileTest do COPY notebook.livemd /apps/ # Cache apps setup at build time - RUN /app/bin/warmup_apps.sh + RUN /app/bin/warmup_apps """ # With secrets @@ -113,7 +113,7 @@ defmodule Livebook.Hubs.DockerfileTest do COPY notebook.livemd /apps/ # Cache apps setup at build time - RUN /app/bin/warmup_apps.sh + RUN /app/bin/warmup_apps """ # With secrets