<#3193 Check script existence on the Slurm cluster...
# flyte-github
c
#3193 Check script existence on the Slurm cluster for ShellTask Pull request opened by JiangJiaWei1103 ## Tracking issue flyteorg/flyte#5634 ## Why are the changes needed? Before executing a Slurm job with a pre-existing script, we need to verify that the specified script is present on the Slurm cluster. ## What changes were proposed in this pull request? Use the SFTP
get
method to verify the existence of the specified script at
batch_script_path
on the Slurm cluster. ## How was this patch tested? This patch is tested by running the following example: import os from flytekit import workflow from flytekitplugins.slurm import SlurmRemoteScript, SlurmTask slurm_task = SlurmTask( name="basic", task_config=SlurmRemoteScript( ssh_config={ "host": "aws2", "username": "ubuntu", }, sbatch_conf={ "partition": "debug", "job-name": "job0", }, # The following script doesn't exist on the Slurm cluster batch_script_path="/home/ubuntu/fake.sh", ) ) @workflow def wf() -> None: slurm_task() if name == "__main__": from flytekit.clis.sdk_in_container import pyflyte from click.testing import CliRunner runner = CliRunner() path = os.path.realpath(file) print(f">>> LOCAL EXEC <<<") result = runner.invoke(pyflyte.main, ["run", path, "wf"]) print(result.output) ### Setup process For agent local test, the setup process is summarized as follows: git clone https://github.com/flyteorg/flytekit.git gh pr checkout 3193 make setup && pip install -e . cd plugins/flytekit-slurm && pip install -e . ### Screenshots The error message is shown as follows: [Screenshot 2025-03-15 at 10 23 27 AM](https://private-user-images.githubusercontent.com/36886416/423010051-31bf9afc-1f01-4366-b7d1-8d3c0a32d28c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDI0ODM4NzIsIm5iZiI6MTc0MjQ4MzU3MiwicGF0aCI6Ii8zNjg4NjQxNi80MjMwMTAwNTEtMzFiZjlhZmMtMWYwMS00MzY2LWI3ZDEtOGQzYzBhMzJkMjhjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAzMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMzIwVDE1MTI1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhMWYyYWY1ZWNhNDJlNGI5MTE1N2JhYmQ5NGJjYzA5NGZkZGFjZTZjMDg2YzVkZDA5ZjJkMzJlMDNmODgyZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8EfEL3_OtB5YyMvZSHpghpAINXdwdWYl9BOfgZzULlo) ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs #3159 ## Docs link N/A ### Summary by Bito This PR implements a comprehensive migration from legacy agent-based to modern connector-based architecture, including enhancing the Slurm script agent with asynchronous SFTP operations. It improves error handling, standardizes nomenclature, updates CLI commands with deprecation warnings, and introduces new plugins like GeoPandas with encoding capabilities. Unit tests added: False Estimated effort to review (1-5, lower is better): 5 flyteorg/flytekit