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

[Refactor] Rename flyin to flyteinteractive #2157

Conversation

MortalHappiness
Copy link
Member

@MortalHappiness MortalHappiness commented Feb 2, 2024

Tracking issue

flyteorg/flyte#4792
flyteorg/flyte#4284

Why are the changes needed?

Due to Linkedin's policy, the name flyin needs to be changed to flyteinteractive.

What changes were proposed in this pull request?

  1. Change in flyin code
  2. Change in flyin folder name

How was this patch tested?

Setup process

None

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Copy link

welcome bot commented Feb 2, 2024

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

@MortalHappiness
Copy link
Member Author

@ByronHsu can you help review this PR? Thank you.

@MortalHappiness MortalHappiness force-pushed the refactor/flyte-4792-rename-flyin-to-flyteinteractive branch from 4da5a44 to 6ae3b9b Compare February 2, 2024 20:31
Copy link

codecov bot commented Feb 3, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (f721eef) 82.78% compared to head (08df568) 85.80%.

Files Patch % Lines
...itplugins/flyteinteractive/vscode_lib/decorator.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2157      +/-   ##
==========================================
+ Coverage   82.78%   85.80%   +3.02%     
==========================================
  Files         313      313              
  Lines       23630    23630              
  Branches     3541     3541              
==========================================
+ Hits        19561    20275     +714     
+ Misses       3481     2744     -737     
- Partials      588      611      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Future-Outlier <[email protected]>
@Future-Outlier Future-Outlier force-pushed the refactor/flyte-4792-rename-flyin-to-flyteinteractive branch from a97cf44 to 08df568 Compare February 3, 2024 03:31
@Future-Outlier
Copy link
Member

open the browser to access the code-server
image
resume the task
image

@Future-Outlier
Copy link
Member

I use this Dockerfile to help test this.

FROM python:3.10-slim-buster

MAINTAINER Flyte Team <[email protected]>
LABEL org.opencontainers.image.source https://github.com/flyteorg/flytekit
WORKDIR /root
ENV PYTHONPATH /root

ARG VERSION
ARG TARGETARCH

# 1. Update the necessary packages for flytekit
# 2. Install code-server
# 3. Download code-server extensions for Python and Jupyter via wget
# 4. Install flytekit and flytekit-flyin with no cache
# 5. Delete apt cache. Reference: https://gist.github.com/marvell/7c812736565928e602c4
# 6. Some packages will create config file under /home by default, so we need to make sure it's writable
# 7. Change the permission of /tmp, so that others can run command on it
RUN apt-get update \
    && apt-get install build-essential git wget -y \
    && mkdir -p /tmp/ \
    && mkdir -p /tmp/code-server \
    && wget --no-check-certificate -O /tmp/code-server/code-server-4.19.0-linux-${TARGETARCH}.tar.gz https://github.com/coder/code-server/releases/download/v4.19.0/code-server-4.19.0-linux-${TARGETARCH}.tar.gz \
    && tar -xzf /tmp/code-server/code-server-4.19.0-linux-${TARGETARCH}.tar.gz -C /tmp/code-server/ \
    && wget --no-check-certificate https://open-vsx.org/api/ms-python/python/2023.20.0/file/ms-python.python-2023.20.0.vsix -P /tmp/code-server \
    && wget --no-check-certificate https://open-vsx.org/api/ms-toolsai/jupyter/2023.9.100/file/ms-toolsai.jupyter-2023.9.100.vsix -P /tmp/code-server 
RUN pip install flyteidl --pre \
    && pip install -U git+https://github.com/flyteorg/flytekit.git@a97cf443a95725740547af434e72fa2c78962e00 \
    && pip install -U git+https://github.com/flyteorg/flytekit.git@a97cf443a95725740547af434e72fa2c78962e00#subdirectory=plugins/flytekit-flyteinteractive \
    && apt-get clean autoclean \
    && apt-get autoremove --yes \
    && rm -rf /var/lib/{apt,dpkg,cache,log}/ \
    && useradd -u 1000 flytekit \
    && chown -R flytekit:flytekit /tmp/code-server \
    && chown flytekit: /root \
    && chown flytekit: /home \
    && :

# Set the environment variable for code-server
ENV PATH="/tmp/code-server/code-server-4.19.0-linux-${TARGETARCH}/bin:${PATH}"

USER flytekit

# Install extensions using code-server
# Execution is performed here as code-server configuration depends on the USER setting
# If we install it as ROOT, the config will be stored in /root/.config/code-server/config.yaml
# Now, the config of code-server will be stored in /home/flytekit/.config/code-server/config.yaml
RUN code-server --install-extension /tmp/code-server/ms-python.python-2023.20.0.vsix \
    && code-server --install-extension /tmp/code-server/ms-toolsai.jupyter-2023.9.100.vsix

@Future-Outlier
Copy link
Member

python example

from flytekit import ImageSpec, Secret, task, workflow
# from flytekitplugins.flyteinteractive import vscode, SendgridNotifier, SendgridConfig, SlackNotifier, SlackConfig
from flytekitplugins.flyteinteractive import (CODE_TOGETHER_EXTENSION, COPILOT_EXTENSION,
                                   VIM_EXTENSION, VscodeConfig, vscode)
from flytekitplugins.flyteinteractive import (vscode, VscodeConfig)

@task(
)
@vscode(
    config=config,
    # max_idle_seconds=80,
    # warning_seconds_before_termination=60,
    # notifier=slack_notifier,
)
def t(a: int, b: int) -> int:
    return a + b


@workflow
def wf(a: int = 5, b: int = 3) -> int:
    out = t(a=a, b=b)
    return out

@pingsutw pingsutw merged commit b744a11 into flyteorg:master Feb 5, 2024
82 of 84 checks passed
Copy link

welcome bot commented Feb 5, 2024

Congrats on merging your first pull request! 🎉

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