Skip to content

Commit

Permalink
Rename vscode as flyin plugin (flyteorg#1986)
Browse files Browse the repository at this point in the history
* rename vscode as flyin plugin

Signed-off-by: byhsu <[email protected]>

* fix lint

Signed-off-by: byhsu <[email protected]>

---------

Signed-off-by: byhsu <[email protected]>
Co-authored-by: byhsu <[email protected]>
Signed-off-by: Rafael Raposo <[email protected]>
  • Loading branch information
2 people authored and RRap0so committed Dec 15, 2023
1 parent 2e5aacc commit f2ab65c
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
- flytekit-spark
- flytekit-sqlalchemy
- flytekit-vaex
- flytekit-vscode
- flytekit-flyin
- flytekit-whylogs
exclude:
# flytekit-modin depends on ray which does not have a 3.11 wheel yet.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COPY . /flytekit
RUN pip install -e /flytekit
RUN pip install -e /flytekit/plugins/flytekit-k8s-pod
RUN pip install -e /flytekit/plugins/flytekit-deck-standard
RUN pip install -e /flytekit/plugins/flytekit-vscode
RUN pip install -e /flytekit/plugins/flytekit-flyin
RUN pip install scikit-learn

ENV PYTHONPATH "/flytekit:/flytekit/plugins/flytekit-k8s-pod:/flytekit/plugins/flytekit-deck-standard:"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
# Flytekit VSCode Plugin
# Flytekit FlyIn Plugin

The Flytekit VSCode plugin offers an easy solution for users to run Python tasks within an interactive VSCode server, compatible with any image. `@vscode` is a decorator which users can put within @task and user function. With `@vscode`, the task will install vscode dependencies (skip if they already exist) and run a vscode server instead of the user defined functions.
> Flyin = Flyte Interactive = Develop Flyte with the speed of flying
FlyIn plugin provides users' favorite interface to develop and debug a flyte task interactively. We support vscode, jupyter (WIP), and neovim (WIP).

## Installation

To install the plugin, run the following command:

```bash
pip install flytekitplugins-vscode
pip install flytekitplugins-flyin
```

## Vscode

FlyIn Vscode offers an easy solution for users to run Python tasks within an interactive VSCode server, compatible with any image. `@vscode` is a decorator which users can put within @task and user function. With `@vscode`, the task will install vscode dependencies (skip if they already exist) and run a vscode server instead of the user defined functions.


## Starter Example
```python
from flytekit import task
from flytekitplugins.vscode import vscode
from flytekitplugins.flyin import vscode

@task
@vscode
Expand Down Expand Up @@ -40,12 +49,11 @@ If users want to skip the vscode downloading process at runtime, they have the o
+ ENV PATH="/tmp/code-server/code-server-4.18.0-linux-amd64/bin:${PATH}"
```

## More Examples
## Advanced Examples

```python
from flytekit import task, workflow
from flytekitplugins.vscode import vscode, VscodeConfig
from flytekitplugins.vscode.constants import DEFAULT_CODE_SERVER_EXTENSIONS
from flytekitplugins.flyin import vscode, VscodeConfig, DEFAULT_CODE_SERVER_EXTENSIONS

@task(
container_image="localhost:30000/flytekit-vscode:0.0.2",
Expand Down
File renamed without changes
17 changes: 17 additions & 0 deletions plugins/flytekit-flyin/flytekitplugins/flyin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
.. currentmodule:: flytekitplugins.flyin
This package contains flyin plugin for Flytekit.
.. autosummary::
:template: custom.rst
:toctree: generated/
vscode
VscodeConfig
DEFAULT_CODE_SERVER_REMOTE_PATH
DEFAULT_CODE_SERVER_EXTENSIONS
"""

from .vscode_lib.decorator import vscode, VscodeConfig
from .vscode_lib.constants import DEFAULT_CODE_SERVER_REMOTE_PATH, DEFAULT_CODE_SERVER_EXTENSIONS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

PLUGIN_NAME = "vscode"
PLUGIN_NAME = "flyin"

microlib_name = f"flytekitplugins-{PLUGIN_NAME}"

Expand All @@ -13,7 +13,7 @@
version=__version__,
author="flyteorg",
author_email="[email protected]",
description="This package holds the vscode plugins for flytekit",
description="This package holds the flyin plugins for flytekit",
namespace_packages=["flytekitplugins"],
packages=[f"flytekitplugins.{PLUGIN_NAME}"],
install_requires=plugin_requires,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import mock
from flytekitplugins.vscode import vscode
from flytekitplugins.flyin import vscode

from flytekit import task, workflow


@mock.patch("multiprocessing.Process")
@mock.patch("flytekitplugins.vscode.decorator.exit_handler")
@mock.patch("flytekitplugins.vscode.decorator.download_vscode")
def test_vscode_plugin(mock_download_vscode, mock_exit_handler, mock_process):
@mock.patch("flytekitplugins.flyin.vscode_lib.decorator.exit_handler")
@mock.patch("flytekitplugins.flyin.vscode_lib.decorator.download_vscode")
def test_vscode(mock_download_vscode, mock_exit_handler, mock_process):
@task
@vscode
def t():
Expand Down
13 changes: 0 additions & 13 deletions plugins/flytekit-vscode/flytekitplugins/vscode/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"flytekitplugins-sqlalchemy": "flytekit-sqlalchemy",
"flytekitplugins-vaex": "flytekit-vaex",
"flytekitplugins-whylogs": "flytekit-whylogs",
"flytekitplugins-vscode": "flytekit-vscode",
"flytekitplugins-flyin": "flytekit-flyin",
}


Expand Down

0 comments on commit f2ab65c

Please sign in to comment.