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

Instructions for k8s agent #2697

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { json } from "@codemirror/lang-json";
import { xml } from "@codemirror/lang-xml";
import { css } from "@codemirror/lang-css";
import { html } from "@codemirror/lang-html";
import { yaml } from "@codemirror/lang-yaml";
import { javascript } from "@codemirror/lang-javascript";
import { erlang } from "@codemirror/legacy-modes/mode/erlang";
import { dockerFile } from "@codemirror/legacy-modes/mode/dockerfile";
Expand All @@ -29,6 +30,11 @@ const sqlDesc = LanguageDescription.of({
support: sql(),
});

const yamlDesc = LanguageDescription.of({
name: "YAML",
support: yaml(),
});

const jsonDesc = LanguageDescription.of({
name: "JSON",
support: json(),
Expand Down Expand Up @@ -67,6 +73,7 @@ const markdownDesc = LanguageDescription.of({
elixirDesc,
erlangDesc,
sqlDesc,
yamlDesc,
jsonDesc,
xmlDesc,
cssDesc,
Expand All @@ -81,6 +88,7 @@ export const languages = [
elixirDesc,
erlangDesc,
sqlDesc,
yamlDesc,
jsonDesc,
xmlDesc,
cssDesc,
Expand Down
59 changes: 53 additions & 6 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@codemirror/lang-markdown": "^6.2.3",
"@codemirror/lang-sql": "^6.5.5",
"@codemirror/lang-xml": "^6.0.2",
"@codemirror/lang-yaml": "^6.1.1",
"@codemirror/language": "^6.10.0",
"@codemirror/legacy-modes": "^6.3.3",
"@codemirror/lint": "^6.4.2",
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You may set `LIVEBOOK_CLUSTER` to one of the following values.

## `auto`

Detects the hosting platform and automatically sets up a cluster using DNS configuration. Currently the only supported platform is Fly.io.
Detects the hosting platform and automatically sets up a cluster using DNS configuration. Currently the only supported platform is Fly.io (and Kubernetes when using Livebook Teams).

## `dns:QUERY`

Expand Down
2 changes: 1 addition & 1 deletion lib/livebook_web/components/app_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ defmodule LivebookWeb.AppComponents do
for more information.
</div>
<p class="mt-1 text-sm">
Automatic clustering is available when deploying to Fly.io.
Automatic clustering is available when deploying to Fly.io and Kubernetes.
</p>
</div>
</div>
Expand Down
41 changes: 41 additions & 0 deletions lib/livebook_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,47 @@ defmodule LivebookWeb.CoreComponents do
"""
end

@doc """
Renders a highlighted code snippet with a title and a copy button.

## Examples

<.code_preview_with_title_and_copy
title="
source_id="my-snippet"
language="elixir"
source="System.version()" />

"""
attr :title, :string, required: true
attr :source_id, :string, required: true
attr :language, :string, required: true
attr :source, :string, required: true

def code_preview_with_title_and_copy(assigns) do
~H"""
<div>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-700 font-semibold"><%= @title %></span>
<div class="flex justify-end space-x-2">
<span class="tooltip left" data-tooltip="Copy source">
<.icon_button
aria-label="copy source"
phx-click={JS.dispatch("lb:clipcopy", to: "##{@source_id}")}
>
<.remix_icon icon="clipboard-line" />
</.icon_button>
</span>
</div>
</div>

<div class={@language}>
<.code_preview source_id={@source_id} language={@language} source={@source} />
</div>
</div>
"""
end

@doc """
Renders text with a tiny label.

Expand Down
27 changes: 7 additions & 20 deletions lib/livebook_web/live/app_session_live/source_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,13 @@ defmodule LivebookWeb.AppSessionLive.SourceComponent do
<p class="text-gray-700">
This app is built from the following notebook source:
</p>
<div class="flex flex-col space-y-1">
<div class="flex justify-between items-center">
<span class="text-sm text-gray-700 font-semibold">
<%= Session.file_name_for_download(@session) <> ".livemd" %>
</span>
<div class="flex justify-end space-x-2">
<span class="tooltip left" data-tooltip="Copy source">
<.icon_button
aria-label="copy source"
phx-click={JS.dispatch("lb:clipcopy", to: "#export-notebook-source")}
>
<.remix_icon icon="clipboard-line" />
</.icon_button>
</span>
</div>
</div>
<div class="markdown">
<.code_preview source_id="export-notebook-source" language="markdown" source={@source} />
</div>
</div>

<.code_preview_with_title_and_copy
title={Session.file_name_for_download(@session) <> ".livemd"}
source_id="export-notebook-source"
language="markdown"
source={@source}
/>
</div>
"""
end
Expand Down
Loading
Loading