mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-12 22:46:17 +08:00
Fix docker tag on release branches
This commit is contained in:
parent
5d78db66e5
commit
a643307d52
1 changed files with 8 additions and 4 deletions
|
@ -7,6 +7,10 @@ defmodule Livebook.Hubs.DockerfileTest do
|
||||||
alias Livebook.Hubs
|
alias Livebook.Hubs
|
||||||
alias Livebook.Secrets.Secret
|
alias Livebook.Secrets.Secret
|
||||||
|
|
||||||
|
@docker_tag if Livebook.Config.app_version() =~ "-dev",
|
||||||
|
do: "latest",
|
||||||
|
else: Livebook.Config.app_version()
|
||||||
|
|
||||||
describe "build_dockerfile/7" do
|
describe "build_dockerfile/7" do
|
||||||
test "deploying a single notebook in personal hub" do
|
test "deploying a single notebook in personal hub" do
|
||||||
config = dockerfile_config()
|
config = dockerfile_config()
|
||||||
|
@ -16,7 +20,7 @@ defmodule Livebook.Hubs.DockerfileTest do
|
||||||
dockerfile = Dockerfile.build_dockerfile(config, hub, [], [], file, [], %{})
|
dockerfile = Dockerfile.build_dockerfile(config, hub, [], [], file, [], %{})
|
||||||
|
|
||||||
assert dockerfile == """
|
assert dockerfile == """
|
||||||
FROM ghcr.io/livebook-dev/livebook:latest
|
FROM ghcr.io/livebook-dev/livebook:#{@docker_tag}
|
||||||
|
|
||||||
# Apps configuration
|
# Apps configuration
|
||||||
ENV LIVEBOOK_APPS_PATH "/apps"
|
ENV LIVEBOOK_APPS_PATH "/apps"
|
||||||
|
@ -91,7 +95,7 @@ defmodule Livebook.Hubs.DockerfileTest do
|
||||||
dockerfile = Dockerfile.build_dockerfile(config, hub, [], [], file, [], %{})
|
dockerfile = Dockerfile.build_dockerfile(config, hub, [], [], file, [], %{})
|
||||||
|
|
||||||
assert dockerfile == """
|
assert dockerfile == """
|
||||||
FROM ghcr.io/livebook-dev/livebook:latest
|
FROM ghcr.io/livebook-dev/livebook:#{@docker_tag}
|
||||||
|
|
||||||
ARG TEAMS_KEY="lb_tk_fn0pL3YLWzPoPFWuHeV3kd0o7_SFuIOoU4C_k6OWDYg"
|
ARG TEAMS_KEY="lb_tk_fn0pL3YLWzPoPFWuHeV3kd0o7_SFuIOoU4C_k6OWDYg"
|
||||||
|
|
||||||
|
@ -160,14 +164,14 @@ defmodule Livebook.Hubs.DockerfileTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "deploying with different base image" do
|
test "deploying with different base image" do
|
||||||
config = dockerfile_config(%{docker_tag: "latest-cuda11.8"})
|
config = dockerfile_config(%{docker_tag: "#{@docker_tag}-cuda11.8"})
|
||||||
hub = personal_hub()
|
hub = personal_hub()
|
||||||
file = Livebook.FileSystem.File.local(p("/notebook.livemd"))
|
file = Livebook.FileSystem.File.local(p("/notebook.livemd"))
|
||||||
|
|
||||||
dockerfile = Dockerfile.build_dockerfile(config, hub, [], [], file, [], %{})
|
dockerfile = Dockerfile.build_dockerfile(config, hub, [], [], file, [], %{})
|
||||||
|
|
||||||
assert dockerfile =~ """
|
assert dockerfile =~ """
|
||||||
FROM ghcr.io/livebook-dev/livebook:latest-cuda11.8
|
FROM ghcr.io/livebook-dev/livebook:#{@docker_tag}-cuda11.8
|
||||||
|
|
||||||
ENV XLA_TARGET "cuda118"
|
ENV XLA_TARGET "cuda118"
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue