@@ -52,7 +52,6 @@ use crate::{
5252} ;
5353
5454const CSCS_MAX_DIRECT_SIZE : usize = 5242880 ;
55- const DCGM_ENROOT_HOOK : & str = include_str ! ( "./dcgm_enroot_hook.sh" ) ;
5655
5756async fn get_access_token ( ) -> Result < Secret > {
5857 let client_id = match get_secret ( CLIENT_ID_SECRET_NAME ) . await {
@@ -751,30 +750,6 @@ async fn handle_script(
751750
752751 Ok ( script_path)
753752}
754- async fn setup_dcgm_hook ( api_client : & CscsApi , current_system : & str ) -> Result < ( ) > {
755- let user_dirs = file_system_roots ( Some ( FileSystemType :: Users ) ) . await ?;
756- let user_dir = user_dirs
757- . first ( )
758- . ok_or ( eyre ! ( "couldn't find user root directory on remote" ) ) ?;
759- let path = PathBuf :: from ( user_dir. name . clone ( ) )
760- . join ( ".config" )
761- . join ( "enroot" )
762- . join ( "hooks.d" )
763- . join ( "cscs_jobreport_dcgm_hook.sh" ) ;
764-
765- let response = api_client. checksum ( current_system, path. clone ( ) ) . await ;
766- if let Ok ( Some ( _) ) = response {
767- // file exists
768- return Ok ( ( ) ) ;
769- }
770- api_client
771- . mkdir ( current_system, path. parent ( ) . unwrap ( ) . to_path_buf ( ) )
772- . await ?;
773- api_client
774- . upload ( current_system, path, DCGM_ENROOT_HOOK . as_bytes ( ) . to_vec ( ) )
775- . await
776- . wrap_err ( "couldn't upload dcgm enroot hook " . to_string ( ) )
777- }
778753
779754pub async fn cscs_job_start (
780755 name : Option < String > ,
@@ -832,9 +807,6 @@ pub async fn cscs_job_start(
832807 if coman_squash. is_none ( ) {
833808 println ! ( "Warning: coman squash wasn't templated and is needed for ssh through coman to work" ) ;
834809 }
835- if let Err ( e) = setup_dcgm_hook ( & api_client, current_system) . await {
836- println ! ( "Warning: couldn't set up dcgm hook: {e:?}" ) ;
837- }
838810 let environment_path = handle_edf (
839811 & api_client,
840812 & base_path,
@@ -890,7 +862,7 @@ pub async fn cscs_file_list(
890862 let api_client = CscsApi :: new ( access_token. 0 , platform) . unwrap ( ) ;
891863 let config = Config :: new ( ) . unwrap ( ) ;
892864 api_client
893- . list_path ( & system. unwrap_or ( config. values . cscs . current_system ) , path)
865+ . list_path ( & system. unwrap_or ( config. values . cscs . current_system ) , path, false )
894866 . await
895867 }
896868 Err ( e) => Err ( e) ,
@@ -946,7 +918,7 @@ pub async fn cscs_file_delete(
946918 let api_client = CscsApi :: new ( access_token. 0 , platform) . unwrap ( ) ;
947919 let config = Config :: new ( ) . unwrap ( ) ;
948920 let current_system = & system. unwrap_or ( config. values . cscs . current_system ) ;
949- let paths = api_client. list_path ( current_system, remote. clone ( ) ) . await ?;
921+ let paths = api_client. list_path ( current_system, remote. clone ( ) , false ) . await ?;
950922 let path = paths. first ( ) . ok_or ( eyre ! ( "remote path doesn't exist" ) ) ?;
951923 if let PathType :: Directory = path. path_type {
952924 return Err ( eyre ! ( "remote path must be a file, not directory" ) ) ;
@@ -975,7 +947,7 @@ pub async fn cscs_file_download(
975947 let api_client = CscsApi :: new ( access_token. 0 , platform) . unwrap ( ) ;
976948 let config = Config :: new ( ) . unwrap ( ) ;
977949 let current_system = & system. unwrap_or ( config. values . cscs . current_system ) ;
978- let paths = api_client. list_path ( current_system, remote. clone ( ) ) . await ?;
950+ let paths = api_client. list_path ( current_system, remote. clone ( ) , false ) . await ?;
979951 let path = paths. first ( ) . ok_or ( eyre ! ( "remote path doesn't exist" ) ) ?;
980952 if let PathType :: Directory = path. path_type {
981953 return Err ( eyre ! ( "remote path must be a file, not directory" ) ) ;
@@ -1008,7 +980,7 @@ pub async fn cscs_file_upload(
1008980 let api_client = CscsApi :: new ( access_token. 0 , platform) . unwrap ( ) ;
1009981 let config = Config :: new ( ) . unwrap ( ) ;
1010982 let current_system = & system. unwrap_or ( config. values . cscs . current_system ) ;
1011- let existing = api_client. list_path ( current_system, remote. clone ( ) ) . await ?;
983+ let existing = api_client. list_path ( current_system, remote. clone ( ) , false ) . await ?;
1012984 let remote = if !existing. is_empty ( ) {
1013985 if existing. len ( ) == 1 && existing[ 0 ] . path_type == PathType :: File {
1014986 return Err ( eyre ! ( "remote file already exists" ) ) ;
0 commit comments