Check the modified time of ~/.local/share/code-server/heartbeat.
If it is older than max_idle_second seconds, kill the container.
Otherwise, check again every HEARTBEAT_CHECK_SECONDS.
Wait for user to resume the task. If resume_task is set, terminate the VSCode server, reload the task function, and run it with the input of the task.
Parameter
Type
Description
child_process
multiprocessing.context.Process
The process to be terminated.
task_function
args
*args
kwargs
**kwargs
max_idle_seconds
int
The duration in seconds to live after no activity detected.
post_execute
typing.Optional[typing.Callable]
The function to be executed before the vscode is self-terminated.
Returns the code server information based on the system’s architecture.
This function checks the system’s architecture and returns the corresponding
code server information from the provided dictionary. The function currently
supports AMD64 and ARM64 architectures.
Parameter
Type
Description
code_server_info_dict
dict
A dictionary containing code server information. The keys should be the architecture type (‘amd64’ or ‘arm64’) and the values should be the corresponding code server information.
Copy the original task file to the context working directory. This ensures that the inputs.pb can be loaded, as loading requires the original task interface.
By doing so, even if users change the task interface in their code, we can use the copied task file to load the inputs as native Python objects.
Generate a Python script and a launch.json for users to debug interactively.