Skip to content

Commit

Permalink
Fixed for volcengine Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenrong-wang committed Jul 16, 2024
1 parent a7f8ef9 commit 03be1f4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
12 changes: 9 additions & 3 deletions hpcopr/cluster_general_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4576,12 +4576,18 @@ int volce_bucket_clean(char* workdir, char* crypto_keyfile){
return -1;
}
snprintf(log_tmp,FILENAME_LENGTH,"%s%s%s.log",NOW_TMP_DIR,PATH_SLASH,cluster_name);


#ifdef _WIN32
snprintf(rm_task_cmd,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s rm -re %s -e tos-%s.volces.com -i %s -k %s %s/ -r -f -v -fr -m",NOW_TMP_DIR,TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address);
snprintf(rm_file_cmd,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s rm -re %s -e tos-%s.volces.com -i %s -k %s %s/ -r -f -v -fr",NOW_TMP_DIR,TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address);
snprintf(ls_task_cmd,CMDLINE_LENGTH,"set HOMEPATH=%s && %s ls -re %s -e tos-%s.volces.com -i %s -k %s %s/ -s -m -d >%s 2>&1",NOW_TMP_DIR,TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,log_tmp);
snprintf(ls_file_cmd,CMDLINE_LENGTH,"set HOMEPATH=%s && %s ls -re %s -e tos-%s.volces.com -i %s -k %s %s/ -s -d >%s 2>&1",NOW_TMP_DIR,TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,log_tmp);
#else
snprintf(rm_task_cmd,CMDLINE_LENGTH-1,"%s rm -re %s -e tos-%s.volces.com -i %s -k %s %s/ -r -f -v -fr -m",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address);
snprintf(rm_file_cmd,CMDLINE_LENGTH-1,"%s rm -re %s -e tos-%s.volces.com -i %s -k %s %s/ -r -f -v -fr",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address);

snprintf(rm_file_cmd,CMDLINE_LENGTH-1,"%s rm -re %s -e tos-%s.volces.com -i %s -k %s %s/ -r -f -v -fr",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address);
snprintf(ls_task_cmd,CMDLINE_LENGTH,"%s ls -re %s -e tos-%s.volces.com -i %s -k %s %s/ -s -m -d >%s 2>&1",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,log_tmp);
snprintf(ls_file_cmd,CMDLINE_LENGTH,"%s ls -re %s -e tos-%s.volces.com -i %s -k %s %s/ -s -d >%s 2>&1",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,log_tmp);
#endif

i=0;
do{
Expand Down
24 changes: 24 additions & 0 deletions hpcopr/dataman.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,25 @@ int bucket_cp(char* workdir, char* crypto_keyfile, char* hpc_user, char* source_
}
else{
if(strcmp(cmd_type,"copy")==0){
#ifdef _WIN32
snprintf(cmdline,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s cp -re %s -e tos-%s.volces.com -i %s -k %s %s%s %s%s %s",NOW_TMP_DIR,TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,real_source_path,bucketinfo.bucket_address,real_target_path,real_rflag);
#else
snprintf(cmdline,CMDLINE_LENGTH-1,"%s cp -re %s -e tos-%s.volces.com -i %s -k %s %s%s %s%s %s",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,real_source_path,bucketinfo.bucket_address,real_target_path,real_rflag);
#endif
}
else if(strcmp(cmd_type,"put")==0){
#ifdef _WIN32
snprintf(cmdline,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s cp -re %s -e tos-%s.volces.com -i %s -k %s %s %s%s %s",NOW_TMP_DIR,TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,real_source_path,bucketinfo.bucket_address,real_target_path,real_rflag);
#else
snprintf(cmdline,CMDLINE_LENGTH-1,"%s cp -re %s -e tos-%s.volces.com -i %s -k %s %s %s%s %s",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,real_source_path,bucketinfo.bucket_address,real_target_path,real_rflag);
#endif
}
else{
#ifdef _WIN32
snprintf(cmdline,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s cp -re %s -e tos-%s.volces.com -i %s -k %s %s%s %s %s",NOW_TMP_DIR,TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,real_source_path,real_target_path,real_rflag);
#else
snprintf(cmdline,CMDLINE_LENGTH-1,"%s cp -re %s -e tos-%s.volces.com -i %s -k %s %s%s %s %s",TOSUTIL_EXEC,bucketinfo.region_id,bucketinfo.region_id,bucketinfo.bucket_ak,bucketinfo.bucket_sk,bucketinfo.bucket_address,real_source_path,real_target_path,real_rflag);
#endif
}
}
if(system(cmdline)!=0){
Expand Down Expand Up @@ -391,14 +403,26 @@ int bucket_rm_ls(char* workdir, char* crypto_keyfile, char* hpc_user, char* remo
}
else{
if(strcmp(cmd_type,"delete")==0){
#ifdef _WIN32
snprintf(cmdline,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s rm -re %s -e tos-%s.volces.com -i %s -k %s %s%s %s %s",NOW_TMP_DIR,TOSUTIL_EXEC,binfo.region_id,binfo.region_id,binfo.bucket_ak,binfo.bucket_sk,binfo.bucket_address,real_remote_path,real_rflag,real_fflag);
#else
snprintf(cmdline,CMDLINE_LENGTH-1,"%s rm -re %s -e tos-%s.volces.com -i %s -k %s %s%s %s %s",TOSUTIL_EXEC,binfo.region_id,binfo.region_id,binfo.bucket_ak,binfo.bucket_sk,binfo.bucket_address,real_remote_path,real_rflag,real_fflag);
#endif
}
else{
if(strlen(real_rflag)==0){
#ifdef _WIN32
snprintf(cmdline,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s ls -re %s -e tos-%s.volces.com -i %s -k %s %s%s -d",NOW_TMP_DIR,TOSUTIL_EXEC,binfo.region_id,binfo.region_id,binfo.bucket_ak,binfo.bucket_sk,binfo.bucket_address,real_remote_path);
#else
snprintf(cmdline,CMDLINE_LENGTH-1,"%s ls -re %s -e tos-%s.volces.com -i %s -k %s %s%s -d",TOSUTIL_EXEC,binfo.region_id,binfo.region_id,binfo.bucket_ak,binfo.bucket_sk,binfo.bucket_address,real_remote_path);
#endif
}
else{
#ifdef _WIN32
snprintf(cmdline,CMDLINE_LENGTH-1,"set HOMEPATH=%s && %s ls -re %s -e tos-%s.volces.com -i %s -k %s %s%s",NOW_TMP_DIR,TOSUTIL_EXEC,binfo.region_id,binfo.region_id,binfo.bucket_ak,binfo.bucket_sk,binfo.bucket_address,real_remote_path);
#else
snprintf(cmdline,CMDLINE_LENGTH-1,"%s ls -re %s -e tos-%s.volces.com -i %s -k %s %s%s",TOSUTIL_EXEC,binfo.region_id,binfo.region_id,binfo.bucket_ak,binfo.bucket_sk,binfo.bucket_address,real_remote_path);
#endif
}
}
}
Expand Down

0 comments on commit 03be1f4

Please sign in to comment.