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

allow embedded runtime by env #1084

Merged
merged 5 commits into from
Apr 4, 2022
Merged

allow embedded runtime by env #1084

merged 5 commits into from
Apr 4, 2022

Conversation

ByeongUkChoi
Copy link
Contributor

#1082

  • add environment variable LIVEBOOK_EMBEDDED_RUNTIME_ENABLED
  • hide runtime settings embedded button when LIVEBOOK_EMBEDDED_RUNTIME_ENABLED is not true

@josevalim
Copy link
Contributor

Thank you! We should also check somewhere internally that, if someone tries to start the embedded runtime and it is disabled, perhaps by hacking around the UI, we fail to start it. @jonatanklosko, where would be the best place to check it?

README.md Outdated Show resolved Hide resolved
lib/livebook.ex Outdated Show resolved Hide resolved
lib/livebook/config.ex Outdated Show resolved Hide resolved
@jonatanklosko
Copy link
Member

jonatanklosko commented Apr 3, 2022

where would be the best place to check it?

We have a separate LV for configuring each runtime, and that's where we connect, so we can just have a check in mount verifying that the given runtime is in fact in the runtime_module list, and raise/redirect otherwise?

@ByeongUkChoi
Copy link
Contributor Author

@jonatanklosko

check in mount

like this?

defmodule LivebookWeb.SessionLive.ElixirStandaloneLive do

  def mount(param, session, socket) do
    unless __MODULE__ in Livebook.Config.runtime_modules() do
      raise "now allow runtime elixir standalone."

      # code...
    end
  end
end

@jonatanklosko
Copy link
Member

@ByeongUkChoi yup, except we want to check for Livebook.Runtime.ElixirStandalone, rather than the LV __MODULE__ :)

lib/livebook/config.ex Outdated Show resolved Hide resolved
Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ByeongUkChoi thank you! :)

@jonatanklosko jonatanklosko merged commit e3d9c5f into livebook-dev:main Apr 4, 2022
@ByeongUkChoi ByeongUkChoi deleted the feature/ISSUE-1082 branch April 4, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants