diff --git a/lib/livebook/config.ex b/lib/livebook/config.ex index d20831fe9146..3ff8a7ad1dc5 100644 --- a/lib/livebook/config.ex +++ b/lib/livebook/config.ex @@ -44,6 +44,21 @@ defmodule Livebook.Config do @identity_provider_read_only Enum.filter(@identity_providers, & &1.read_only) + @doc """ + Returns docker tags to be used when generating sample Dockerfiles. + """ + @spec docker_tags() :: list(%{tag: String.t(), name: String.t(), env: keyword()}) + def docker_tags do + version = app_version() + base = if version =~ "dev", do: "latest", else: version + + [ + %{tag: base, name: "Livebook", env: []}, + %{tag: "#{base}-cuda11.8", name: "Livebook + CUDA 11.8", env: [XLA_TARGET: "cuda118"]}, + %{tag: "#{base}-cuda12.1", name: "Livebook + CUDA 12.1", env: [XLA_TARGET: "cuda120"]} + ] + end + @doc """ Returns the longname if the distribution mode is configured to use long names. """ diff --git a/lib/livebook_web/live/hub/edit/team_component.ex b/lib/livebook_web/live/hub/edit/team_component.ex index ff1018c1000e..a876d41dce75 100644 --- a/lib/livebook_web/live/hub/edit/team_component.ex +++ b/lib/livebook_web/live/hub/edit/team_component.ex @@ -30,6 +30,9 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do raise(NotFoundError, "could not find file system matching #{inspect(file_system_id)}") end + docker_tags = Livebook.Config.docker_tags() + [%{tag: default_base_image} | _] = docker_tags + {:ok, socket |> assign( @@ -43,7 +46,9 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do hub_metadata: Provider.to_metadata(assigns.hub), is_default: is_default?, zta: %{"provider" => "", "key" => ""}, - zta_metadata: nil + zta_metadata: nil, + base_image: default_base_image, + docker_tags: docker_tags ) |> assign_dockerfile() |> assign_form(changeset)} @@ -206,6 +211,17 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do the steps below. First, configure your deployment:
+