Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading timeout for big runs #55

Open
FaroutYLq opened this issue Sep 2, 2024 · 0 comments
Open

Downloading timeout for big runs #55

FaroutYLq opened this issue Sep 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@FaroutYLq
Copy link

This is a problem in the vanilla admix-download in stable branch. When a run is too huge, for example 050073-raw_records-rfzvpzj4mf, you will have problems downloading because of a timeout issue. A patch was proposed before and didn't solve the problem.

However, a brutal way to bypass this is to use rucio download. It might be acceptable to find a way to insert this functionality into admix stable branch.

def _meta_admix_download(st, run, target, rse = "UC_OSG_USERDISK"):
    codes = ""
    filename = str(st.key_for(run, target))
    straxhash = filename.split('-')[-1]
    did = "xnt_"+run+":"+target+"-"+straxhash

    # make directory
    codes += "mkdir -p %s"%(filename) + "\n"
    
    # enter directory
    codes += "cd %s"%(filename) + "\n"

    # rucio download
    codes += "rucio download %s --rse %s"%(did, rse) + "\n"

    # move things out
    codes += "mv %s/* ."%(did.split(':')[-1]) + "\n"

    # remove empty folder 
    codes += "rm -rf %s"%(did.split(':')[-1]) + "\n"

    # cd out back to parent directory
    codes += "cd ../" + "\n"

    print(codes)

def meta_admix_download(runs, target = "raw_records", rse = "UC_OSG_USERDISK"):
    import cutax
    st = cutax.xenonnt_offline()
    for r in runs:
        if type(r) == str:
            pass
        else:
            r = str(r).zfill(6)
        _meta_admix_download(st, r, target, rse)

An example will be

meta_admix_download(['049198', '049327', '050045', '050073'])

and this will give you the output you are expected to paste into terminal:

mkdir -p 049198-raw_records-rfzvpzj4mf
cd 049198-raw_records-rfzvpzj4mf
rucio download xnt_049198:raw_records-rfzvpzj4mf --rse UC_OSG_USERDISK
mv raw_records-rfzvpzj4mf/* .
rm -rf raw_records-rfzvpzj4mf
cd ../

mkdir -p 049327-raw_records-rfzvpzj4mf
cd 049327-raw_records-rfzvpzj4mf
rucio download xnt_049327:raw_records-rfzvpzj4mf --rse UC_OSG_USERDISK
mv raw_records-rfzvpzj4mf/* .
rm -rf raw_records-rfzvpzj4mf
cd ../

mkdir -p 050045-raw_records-rfzvpzj4mf
cd 050045-raw_records-rfzvpzj4mf
rucio download xnt_050045:raw_records-rfzvpzj4mf --rse UC_OSG_USERDISK
mv raw_records-rfzvpzj4mf/* .
rm -rf raw_records-rfzvpzj4mf
cd ../

mkdir -p 050073-raw_records-rfzvpzj4mf
cd 050073-raw_records-rfzvpzj4mf
rucio download xnt_050073:raw_records-rfzvpzj4mf --rse UC_OSG_USERDISK
mv raw_records-rfzvpzj4mf/* .
rm -rf raw_records-rfzvpzj4mf
cd ../
@FaroutYLq FaroutYLq added the bug Something isn't working label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant