Skip to content

Sticky files in BUDA

David Anderson edited this page Nov 11, 2026 · 1 revision
job input/output files in BUDA (review of current design):
    input
        all files are contained in the batch desc (.zip) file.
        On submission, we unzip the batch desc
        and move input files w/ unique names to download hier
    output
        in validation, move canonical outputs
        from upload hier to to results/ID/.
        other files remain in the upload hier
    retire
        delete input, output files from hierarchies
        remove results/ID/
    the auto-retire mechanism ensures that all files are eventually deleted

sticky files and locality scheduling: goals
    two scenarios:
    1) a few big files
        a few (< 10) GB-scale files, e.g. LLM files.
        Goals:
        a) the file doesn't get deleted from client when the job is over,
            and doesn't get deleted from server when batch is retired.
        b) Once the file is not used anymore
            (either explicitly by job submitters, or by timeout)
            it gets deleted from clients and server.
        c) the file is gzipped on the network
        d) the file doesn't get copied to the slot directory for each job
            (use links to project dir)
        A given file could be used by different submitters.
            If so, there should be only one copy (on server and clients)

    2) many less-big files
        Like Einstein@home: thousands of 10MB-scale files,
            each job uses one or more.
        We need a) - c), and maybe d).
        We also need some form of locality scheduling:
            jobs are preferentially sent to hosts
            that already have their input files.
        Caveat: we need to ensure that new jobs
            (which use files that no host has) get sent.
            Simple way to do this:
            use scaled 'time in shmem' as a component of score.

    Note: we currently have an old system (from the Condor integration)
        where DB tables (job_file and batch_file_assoc)
        keep track of files and batch associations.
        These aren't useful here.  They don't address
        - stickiness
        - multiple job submitters
        - sandbox names
        ... and they require file immutability, which we don't have in BUDA.


proposed design
    new DB tables
        sticky_file
            (represents an existing sticky file)
            MD5 (unique)
            size_compressed
            size_uncompressed
            path in download hier
        sticky_file_ref
            (represents a reference from a batch to a sticky file)
            user ID
            batch ID
            time (when batch was submitted)
            input file name
            sandbox name

    batch submission
        a batch desc can contain (in shared_input_files, or job dir)
            entries named <in_name>.sticky
            The contents of the file is a sandbox name
        for each sticky file in batch desc
            if no sticky_file
                copy file to download dir
                create sticky_file

    web UI
        show list of sticky files
            show list of references
        let user delete them if no incomplete batches
            deletes sticky_file in DB, file in download hier

    auto-delete (periodic task)
        for each sticky_file
            if no reference in X months, and no incomplete batches
                delete SFD and file
    scheduler
        cleanup
            get list of sticky files on server
            tell client to delete files not on list
        job dispatch (if use locality scheduling)
            job score:
                increment by X*(file size) for each sticky file the client has
                increment by Y*(time in shared mem)
                make X and Y configurable

    Notes
        If we're going to use the file sandbox to stores 1000s of files,
        we might want to make it hierarchical,
        or at least 1 level of hierarchy.
        Or maybe add 'tags'.
        Also: allow uploading lots of files at once.

Clone this wiki locally