Skip to content

Commit

Permalink
Fix(SPRING) Change decompression SLURM QOS to high (#3836)(patch)
Browse files Browse the repository at this point in the history
## Description
This PR changes the SLURM quality of service from low to high for SPRING decompression jobs. See #3804 

### Changed

- Decompression SLURM QOS to high
  • Loading branch information
Vince-janv authored Oct 15, 2024
1 parent af54aaa commit 860e0a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cg/apps/crunchy/crunchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def spring_to_fastq(self, compression_obj: CompressionData, sample_id: str = "")
log_dir=log_dir.as_posix(),
memory=self.slurm_memory,
number_tasks=self.slurm_number_tasks,
quality_of_service=SlurmQos.LOW,
quality_of_service=SlurmQos.HIGH,
)
sbatch_content: str = self.slurm_api.generate_sbatch_content(sbatch_parameters)
sbatch_path = files.get_spring_to_fastq_sbatch_path(
Expand Down
18 changes: 10 additions & 8 deletions tests/apps/crunchy/test_compress_fastq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
from pathlib import Path
from unittest import mock

import pytest
from pydantic import ValidationError
Expand Down Expand Up @@ -123,7 +124,6 @@ def test_spring_to_fastq(
compression_object: CompressionData,
spring_metadata_file: Path,
crunchy_config: dict,
mocker,
):
"""Test SPRING to FASTQ method
Expand All @@ -132,15 +132,17 @@ def test_spring_to_fastq(
"""
# GIVEN a crunchy-api given an existing SPRING metadata file
assert spring_metadata_file.exists()
mocker_submit_sbatch = mocker.patch.object(SlurmAPI, "submit_sbatch")

crunchy_api = CrunchyAPI(crunchy_config)
# GIVEN that the pending path does not exist
assert compression_object.pending_exists() is False
assert not compression_object.pending_exists()

# WHEN calling bam_to_cram method on bam-path
crunchy_api.spring_to_fastq(compression_obj=compression_object)
with mock.patch.object(SlurmAPI, "submit_sbatch", return_value=123456) as submit_sbatch:
# WHEN calling bam_to_cram method on bam-path
crunchy_api.spring_to_fastq(compression_obj=compression_object)

# THEN _submit_sbatch method is and the qos is high
assert "--qos=high" in submit_sbatch.call_args[1]["sbatch_content"]

# THEN _submit_sbatch method is called
mocker_submit_sbatch.assert_called()
# THEN assert that the pending path was created
assert compression_object.pending_exists() is True
assert compression_object.pending_exists()

0 comments on commit 860e0a8

Please sign in to comment.