Skip to content

Ownership error with squashed outputs #142

Open
@fcomitani

Description

@fcomitani

Hello,

I just wanted to notify an issue that arises when dealing with a change of ownership in the pipeline output files.

I am running the pipeline as root on a dedicated VM within an HPC cluster for which all output is squashed to a specific user. This workaround was set up to avoid security issues with docker on the HPC cluster.

The problem is due to tar, which requires to explicitly acknowledge the change in ownership.
I managed to solve the problem first by adding --no-same-owner to every tar call in tools/aligners.py, preprocessing.py and quantifiers.py as in the following example:

subprocess.check_call(['tar', '-xvf', os.path.join(job.tempDir, 'starIndex.tar.gz'), '-C', job.tempDir, '--no-same-owner'])

To temporarily bypass the problem when creating the output tarball files, however, I had to explicitly add the username information to the code of utils/files.py.
Line 20 f_out.add(file_path, arcname=arcname) is now

def reset(tarinfo):
    tarinfo.uid=tarinfo.gid=1000
    tarinfo.uname='username'
    tarinfo.gname='usergroup'
    return tarinfo
f_out.add(file_path, arcname=arcname, filter=reset)

I'm sure there are more elegant solutions to this, but I wanted to let you know in case anybody else tries to run the pipeline on a VM.

Regards,
Federico

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions