Skip to content

Commit

Permalink
specify user for docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelDuffin committed Nov 18, 2024
1 parent 402bd89 commit bbdcde4
Show file tree
Hide file tree
Showing 4 changed files with 812 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/ad_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,11 @@ class DemultiplexConfig(PanelConfig):
}
TESTING = TESTING
BCL2FASTQ2_CMD = (
f"docker run --rm -v %s:/mnt/run -v %s:/mnt/run/%s {BCL2FASTQ_DOCKER} -R /mnt/run "
f"docker run --rm --user %s:%s -v %s:/mnt/run -v %s:/mnt/run/%s {BCL2FASTQ_DOCKER} -R /mnt/run "
"--sample-sheet /mnt/run/%s --no-lane-splitting"
)
CD_CMD = (
f"docker run --rm -v %s:/input_run {GATK_DOCKER} ./gatk CollectIlluminaLaneMetrics "
f"docker run --rm --user %s:%s -v %s:/input_run {GATK_DOCKER} ./gatk CollectIlluminaLaneMetrics "
"--RUN_DIRECTORY /input_run --OUTPUT_DIRECTORY /input_run --OUTPUT_PREFIX %s"
)
DEMULTIPLEX_TEST_RUNFOLDERS = [
Expand Down
7 changes: 7 additions & 0 deletions demultiplex/demultiplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,23 @@ def __init__(self, folder_name: str, timestamp: str):
) # Get dictionary of loggers
self.demux_rf_logger = self.loggers["demux"]
self.bcl2fastq2_rf_logger = self.loggers["bcl2fastq2"]
#get current user to run docker images with this user instead of root
#controls the ownership of the files to enable deleting later
self.user = os.getuid()
# N.B. --no-lane-splitting creates a single fastq for a sample,
# not into one fastq per lane)
self.bcl2fastq2_cmd = DemultiplexConfig.BCL2FASTQ2_CMD % (
self.user,
self.user,
self.rf_obj.runfolderpath,
self.rf_obj.samplesheet_path,
self.rf_obj.samplesheet_name,
self.rf_obj.samplesheet_name,
)
# Shell command to run cluster density calculation
self.cluster_density_cmd = DemultiplexConfig.CD_CMD % (
self.user,
self.user,
self.rf_obj.runfolderpath,
self.rf_obj.runfolder_name,
)
Expand Down
Loading

0 comments on commit bbdcde4

Please sign in to comment.