Vscode decorator to turn any python (AutoContainer) task to a vscode server #4314
Closed
troychiu
started this conversation in
RFC Incubator
Replies: 1 comment
-
Since it will be a plugin that doesn’t require changes in flytekit, no RFC required (discussed in the meetup on Nov. 9) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
Why:
When
Flyte users might currently use a workaround of using
time.sleep
, SSHing into the cluster, and then developing/debugging. However, using the raw terminal for this purpose can be cumbersome and unintuitive. For instance, in a multi-level directory structure or a complex code base that requires heavy navigation, users may find the terminal environment frustrating.Solution:
Therefore, @ByronHsu and I propose the addition of a decorator as a Flyte plugin, enabling users to turn any task into a Visual Studio Code (VSCode) server with just one line of code.
Additionally, we can auto-generate a launch.json file, providing a "one-click to run" feature.
Code sample
The
@vscode
decorator provides a simple way for users to run a task as an interactive VSCode server within any container image.@vscode
is a decorator that can be used within the@task
and user functions, like this:By doing so, the task will install VSCode dependencies and run a VSCode server instead of the user-defined function. It also starts an exit handler that continuously polls the status of the heartbeat file and terminates if the server is idle for a set duration. This is crucial because the pod is most likely using several GPUs, and we want to free them up for other users.
Heartbeat file can monitor the active connection to the code-server
Vscode example screenshot:
Beta Was this translation helpful? Give feedback.
All reactions