Commit graph

238 commits

Author SHA1 Message Date
Howard Su 31b0a9f7d0
Add windows version of ci (#1045)
* Add windows version of ci

Config autocrlf to input on Windows
start epmd in background

* Update .github/workflows/test.yaml

* Update .github/workflows/test.yaml

* Update .github/workflows/test.yaml

* Fix tests

* Fix ownership of cached files

* Fix tests

* Increase timeouts

* Run tests on Windows only on main

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-04-11 20:34:31 +02:00
Jonatan Kłosko 5117fd6e64
List database types when adding database connection for the first time (#1090)
* List database types when adding database connection for the first time

* Rename classes
2022-04-04 19:48:57 +02:00
Jonatan Kłosko 1cdc9f7f70
Remove restart button on Mix.install/2 error (#1088)
* Remove restart button on Mix.install failure

* Remove unused standalone? check
2022-04-04 12:49:17 +02:00
ByeongUk Choi e3d9c5fa35
allow embedded runtime by env (#1084)
* allow embedded runtime by env

* fix session live test

* This reverts commit f36931d6ef9b..81ca7d

* allow runtime modules

* Apply suggestions from code review
2022-04-04 12:20:36 +02:00
Jonatan Kłosko 902c993098
Adjustments (#1087)
* Fix horizontal scrollbar on smaller screens

* Apply navigation shortcuts without an additional roundtrip

* Shorten the data element selector

* Fix URL in changelog

* Return reference from handle_intellisense
2022-04-04 12:19:11 +02:00
Jonatan Kłosko 75eb031719
Automate searching and adding new dependencies (#1081)
* Automate searching and adding new dependencies

* Restructure runtime management

* Leave search restrictions up to the runtime

* Support predefined dependencies in Embedded runtime dependency search

* Use the embedded runtime for dependency search test

* Fix typo

* Use module for loading embedded runtime dependencies

* Improve naming
2022-04-01 20:13:37 +02:00
Jonatan Kłosko df765f2dd3
List predefined smart cells and automatically add their dependencies (#1078)
* List predefined smart cells and automatically add their dependencies

* Generalize dependency insertion to multiple entries

* Add runtime setup modal

* Don't evaluate setup when restarting the runtime fails

* Automatically add vega_lite for chart builder

* Improve confirmation modal actions when the action is not destructive
2022-03-30 21:55:50 +02:00
Jonatan Kłosko 5476fd001d
Introduce a setup cell (#1075)
* Introduce a setup cell

* Don't collapse setup cell when dirty

* Collapse fresh setup cell when empty

* Reword collapsed setup cell text
2022-03-28 21:36:57 +02:00
Jonatan Kłosko 4369a45bd5
Regroup cell insert buttons (#1073)
* Regroup cell insert buttons

* Add spacing to divider

* Split into two menus

* Remove smart cell icon
2022-03-24 19:02:31 +01:00
Jonatan Kłosko 894ff15419
Use the same local file system instance for all files (#1070)
* Use the same local file system instance for all files

* Add test
2022-03-24 14:09:17 +01:00
Jonatan Kłosko 7f39c6be76
Remove non-ascii characters from autogenerated notebook file names (#1068) 2022-03-22 21:54:59 +01:00
Jonatan Kłosko ac5a71bf85
Show a message when JS view data is not available (#1067)
* Multiplex initialization of JS views

* Show timeout message when JS view data fails to load

* Refactor JS view channel

* Update tests
2022-03-22 18:25:42 +01:00
Jonatan Kłosko 01b9ffe731
Keep binding in reversed evaluation order (#1065)
* Keep binding in reversed evaluation order

* Treat rebound names as new

* Add test for the default order

* Optimise binding reorder

* Update lib/livebook/runtime/evaluator.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Apply review comments

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-03-21 19:23:43 +01:00
Jonatan Kłosko becdda61f7
Support optional reevaluation on smart cell update (#1062) 2022-03-18 19:36:48 +01:00
Jonatan Kłosko 6db36ea7e6
Add support for smart cell editor (#1050)
* Add support for smart cell editor

* Log an error when smart cell fails to start
2022-03-14 22:19:56 +01:00
Jakub Perżyło 4061aa150d
Add autosave path configuration (#1019)
* Added autosave path configuration

* Update settings.ex

* Adjusted to review

* Apply suggestions from code review

Co-authored-by: José Valim <jose.valim@gmail.com>

* Adjusted to review

* Adjusted to review

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-03-13 16:22:52 +01:00
Jonatan Kłosko ea8b7c2d15
Add support for scanning smart cell evaluation result (#1048)
* Add support for scanning smart cell evaluation result

* Don't allow moving an evaluating cell across sections

* Use consistent naming
2022-03-08 11:10:37 +01:00
Jonatan Kłosko 6b78258713
Add support for scanning evaluation context from smart cells (#1041)
* Add support for scanning evaluation context from smart cells

* Rename prev_locator to base_locator to clarify the meaning

* Adjustments

* Add data tests

* Adjustments

* Test smart cell intearaction with RuntimeServer

* Serialize binding scanning and leave sending to the user

* Monitor the scanning process
2022-03-05 13:19:42 +01:00
Jonatan Kłosko e27ff5a960
Rename Elixir cell to Code cell (#1035) 2022-03-02 12:48:02 +01:00
Jonatan Kłosko aaeac6bb95
Add an action converting smart cell to elixir cell (#1030)
* Add an action converting smart cell to elixir cell

* Simplify tests setup

* Add confirmation

* Update lib/livebook_web/live/session_live/cell_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-03-02 12:13:44 +01:00
Jonatan Kłosko f58f9609d2
Fix race conditions in tests (#1031)
* Fix race conditions in tests

* Format

* Increase session import redirect timeout

* Increase intellisense timeout
2022-02-28 22:27:39 +01:00
Jonatan Kłosko 9d7fe44253
Introduce smart cells (#1029)
* Introduce smart cells

* Apply review comments
2022-02-28 13:53:33 +01:00
José Valim 3bc219e5d8
Bring path verification and add normalization (#1016)
* Bring path verification and add normalization

* Normalize user home

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-21 13:18:17 +01:00
José Valim b2d717faee mix format 2022-02-21 09:00:32 +01:00
José Valim 7050180242 Resolve paths instead of raising 2022-02-21 08:08:24 +01:00
José Valim 71319246c4
Write to file out-of-band (#1006)
* Write to file out-of-band

It won't block the immediate write but it may block
a subsequent write. A sync function was added for
testing purposes.

* Update lib/livebook/storage/ets.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-15 21:17:43 +01:00
Jakub Perżyło 48f72a003a
ETS config file persistence (#1002)
* Added Ets config storage file persistence

* Adjusted to review

* Adjusted to review

* Removed redundant code

* Update lib/livebook/storage/ets.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-15 19:28:14 +01:00
Jonatan Kłosko fb0c96fa99
Speed up tests (#996)
* Close sessions created during tests

* Change live_patch to live_redirect where applicable
2022-02-10 15:36:59 +01:00
Jonatan Kłosko ca27bb157f
Refactoring (#994)
* Group all runtime messages under a common prefix

* Move output specification ot the Runtime protocol

* Update doc comments

* Livebook.Evaluator -> Livebook.Runtime.Evaluator

* Livebook.ContentLoader -> Livebook.Notebook.ContentLoader

* Livebook.UniqueTask -> Livebook.Utils.UniqueTask

* Add import/export delegates to Livebook.LiveMarkdown
2022-02-10 12:15:41 +01:00
Jonatan Kłosko 7f19afe7af
Fastlane JS channel events (#993)
* Fastlane JS channel events

* Abstract fastlaning to separate concerns
2022-02-09 23:15:03 +01:00
Jonatan Kłosko 19b777eb4e
Handle runtime event broadcast in a separate worker process (#992)
* Handle runtime event broadcast in a separate worker process

* Improve wording
2022-02-09 19:47:26 +01:00
Jonatan Kłosko ccc64876a8
Add support for widget binary payloads (#982)
* Add support for widget binary payloads

* Migrate LV auth to a separate hook

* Properly set user buffer when encoding
2022-02-07 21:03:25 +01:00
gpopides 19f4f17e74
check if section has valid parent when importing notebook (#984)
* check if section has valid parent + tests

* formatting

* apply review feedback

* fix the forgotten test

* apply feedback

* apply feedback

* produce a warning if the section points to itself + tests

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-06 12:51:09 +01:00
Benjamin Philip 1a0b9e0f7d
Allow downloading source from sessions list (#980)
* Support downloading source on a per session basis

* Update session_list_component.ex

* Add test

* Update lib/livebook_web/live/home_live/session_list_component.ex

* Update test/livebook_web/live/home_live_test.exs

Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-04 11:36:09 +01:00
Julian Gomez 358bdb3267
Export with title or file name (#870)
* Export file with title or file name

* Export with title or file name

* Add Session.file_name_for_download/1

* Compute the name without calling the server

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-03 21:17:30 +01:00
gpopides be1fce326c
Pass file or directory as open command (#969)
* caputre directory from params

* set file if file parameter is a file

* set file param

* docs

* partial review changes

* apply review changes

* add tests and rename file to path

* formatting

* applied feedback + fixed test

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-03 20:26:18 +01:00
Jonatan Kłosko 5538e2e8c0 Fix race condition in notebook import test 2022-02-02 14:04:45 +01:00
en30 731d95e4f0
Skip XML.decode!(body) if body is empty (#956)
* Skip XML.decode!(body) if body is empty

Google Cloud Storage has almost S3 compatible XML API,
but some responses have `content-type: text/html; charset=UTF-8`
and empty body. This change prevents XML decode error and
enables work fine with Google Cloud Storage.

* Handle Google Cloud Storage XML API response

* Rename S3.encode to S3.decode

* Improve a test case description

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

* Make S3.decode/1 let any content type pass

* mix format

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-02-01 12:32:51 +01:00
José Valim efdbf67f59
Introduce LIVEBOOK_HOME and LIVEBOOK_DATA_PATH (#963)
And move the relevant configurations to settings.
2022-01-31 11:51:57 +01:00
Jakub Perżyło 86e4034f33
Persistent storage (#937)
Start moving filesystems as an initial implementation.
2022-01-30 19:51:03 +01:00
José Valim d2344a5c3b
Improve memory tracking and address race conditions (#957)
1. Allow multiple sessions to close or disconnect at once,
     and then request the system resources to be updated

  2. Make sure that closing a session happens synchronously,
     otherwise a race condition could still list the closed
     session in a dashboard

  3. Ensure close and disconnect can happen more than once
     (for example if two users click the same button at the
     same time)
2022-01-30 12:47:50 +01:00
Jonatan Kłosko 4d70e5cceb
Test and typing improvements (#949)
* Minimize race condition in the frame update test

* Use defmacrop for building intellisense context

* Remove unnecessary cell view computation

* Fix nested assets resolution

* Fix typing errors

* Add missing async attribute to test suites

* Improve rendering synchronization

* Up
2022-01-29 16:39:41 +01:00
Cristine Guadelupe 4dd28388a5
Bulk actions for sessions (#939)
* Initial implementation to close multiple sessions

* Sessions: bulk actions with components

* Rename Disconnect sessions to Disconnect runtime

* Select all and disabled when nothing is selected

* Styled checkbox

* Renames toggle events

* Warning about not persisted notebooks

* Adds disconnect runtime option for a single session

* Edit sessions on right

* Fix: typos and plural

* Minor adjustments

* Removes the loop for rendering the menu

* Menus with fixed width

* Minor adjustments

* Pluralize as global helper

* Bulk actions form on client side

* Track bulk actions buttons state

* Fix: home live tests

* Doctests for pluralize

* Fix: bulk actions buttons losing state on session update

* Fix: format

* Minor adjustment on toggle_edit

* Review-based adjustments

* Reset the Edit state after single-session actions

* Minor adjustments

* Fixes bulk action events

* Submit the bulk action form directly

* Tests for bulk actions

* Indentation

* Update lib/livebook_web/live/home_live/close_session_component.ex

Co-authored-by: José Valim <jose.valim@gmail.com>

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-01-28 17:45:04 -03:00
Jonatan Kłosko f8a216f8ee
Highlight code errors on formatting and evaluation (#948) 2022-01-28 21:00:31 +01:00
Jonatan Kłosko 188edfcf07
Handle intellisense during evaluation (#941)
* Handle intellisense during evaluation

* Apply review comments

* Add TODOs
2022-01-27 12:01:02 +01:00
Jonatan Kłosko 00c2cfb31a
Improve errors formatting (#936)
* Use monospaced font and wrapping for errors

* Improve function clause error format
2022-01-25 21:55:24 +01:00
Jonatan Kłosko 6b19f1d71b
Gracefully handle errors in the inspect protocol (#934) 2022-01-25 17:54:02 +01:00
Jonatan Kłosko 928cb5c592
Preserve Markdown modifiers in headings (#933) 2022-01-25 16:38:52 +01:00
José Valim 70a9a95d4e
Improvements to memory tracking (#917)
* Address race condition on cancel timer
* Include memory measurement as part of evaluation metadata
* Move periodic resource computation to a single process
* Have a explicit call out for total memory
2022-01-22 17:17:20 +01:00
Cristine Guadelupe 6180bb1ff2
Track memory usage - visualization (#898)
* Utils to fetch and format system and node memory usage

* Order by memory

* Track memory on session

* Show memory usage on runtime sidebar

* Shows memory usage percentage on home

* Layout adjustments

* Sidebar design adjustments to match Figma

* Home design adjustments to show the memory information

* Move memory calculations to utils

* Shows disconnected notebooks as consuming 0mb on home

* Simplifies the data structure of memory usage

* Node memory tracker on runtime

* Clean up

* Renames node memory to runtime memory

* Standardizes the data structure of memory usage

* Sends evaluation_finished to the runtime to update the memory usage after an evaluation

* Fix: The evalutor does not notify when there is no notify_to option

* Adds a test with the notify_to option to the evaluator

* Documents the notify_to option

* Minor fixes on runtime and runtime_server

* Minor fixes on sessions

* Minor adjustments

* Updates docs and specs on Utils

* Minor adjustments on session_live

* Fix total memory used by sessions on home

* Put duplicated functions on helpers

* Better filter by memory

* Fix the tooltip text for memory information on sidebar

* Minor alignment adjustment on home
2022-01-21 19:24:47 -03:00