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

Release/1.30.0 #332

Closed
wants to merge 86 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
3f8142c
Bump celery from 4.4.7 to 5.2.2
dependabot[bot] Jan 6, 2022
b3eb544
Bump gitpython from 3.0.8 to 3.1.30
dependabot[bot] Jan 6, 2023
a40bd82
Bump django-filter from 2.1.0 to 2.4.0
dependabot[bot] Jan 6, 2023
05b29c4
Bump django from 2.2.24 to 2.2.28
dependabot[bot] Jan 6, 2023
3b13e00
adding span instrumentation
D-Pankey Feb 7, 2023
b054b19
Create Jenkinsfile
D-Pankey May 25, 2023
ca3cf94
Update Jenkinsfile
D-Pankey May 25, 2023
ca323a4
Update Jenkinsfile
D-Pankey May 25, 2023
f2d3034
Update Jenkinsfile
D-Pankey May 25, 2023
fcc8a6d
Update Jenkinsfile
D-Pankey May 25, 2023
35f7574
Update Jenkinsfile
D-Pankey May 25, 2023
3ecdbf6
Update Jenkinsfile
D-Pankey May 26, 2023
90acf7f
Merge pull request #312 from mskcc/feature/dd_trace
D-Pankey Jun 1, 2023
9487d15
Disable ddtrace for tests, and black formatting
Jun 1, 2023
0ae6a3f
Merge branch 'develop' of github.com:mskcc/ridgeback into develop_mock
nikhil Jun 7, 2023
31d3719
Fixed jenkins file ssh and formatting
nikhil Jun 7, 2023
96a2c30
Added integration_tests for ridgeback
nikhil Jun 7, 2023
59d5949
Load singularity after ssh
nikhil Jun 7, 2023
164d6c5
Merge branch 'develop' of github.com:mskcc/ridgeback into develop_mock
nikhil Jun 12, 2023
b39cc0e
Update Jenkinsfile to use develop branch
nikhil Jul 1, 2023
e23bb3c
Merge pull request #321 from mskcc/develop_mock
nikhil Jul 7, 2023
bb23e8f
Merge pull request #322 from mskcc/feature/dd_trace_develop
D-Pankey Jul 24, 2023
a6ce99f
Merge pull request #323 from mskcc/master
nikhil Jul 26, 2023
65e6a8a
Preserve work dir
nikhil Aug 22, 2023
d7e1d43
Fixed typo
nikhil Oct 12, 2023
0900897
Do not run command tool status on completed leader jobs
nikhil Oct 12, 2023
4210256
Merge pull request #327 from mskcc/master
sivkovic Oct 13, 2023
da395ec
Merge pull request #324 from mskcc/feature/preserve_work_dir
nikhil Oct 16, 2023
ab6e4f2
Update toil_jobsubmitter.py
Oct 18, 2023
e7eaded
Merge pull request #328 from mskcc/hotfix/access_submit
buehlere Oct 18, 2023
d10a15e
Merge branch 'develop' of github.com:mskcc/ridgeback into develop
nikhil Nov 7, 2023
7695451
Merge pull request #326 from mskcc/hotfix/fix_permission_set
nikhil Nov 9, 2023
88ab329
Version bump
nikhil Nov 9, 2023
711ae1f
Added setting for setting max hours for hanging job detection
nikhil Nov 9, 2023
d1cf4f9
Added task to check for hanging jobs
nikhil Nov 9, 2023
ec45bbc
Added check hanging function
nikhil Nov 9, 2023
1c1db20
Added alerts field to message
nikhil Nov 9, 2023
f88eedc
Added log path to command line tool details
nikhil Nov 9, 2023
2e5b66a
Added tests
nikhil Nov 9, 2023
e14e36c
Added black formatting
nikhil Nov 9, 2023
a6da999
Added tool and leader walltime fields for jobsubmitter
nikhil Nov 14, 2023
c0acefc
Added tool and leader walltime fields for job
nikhil Nov 14, 2023
bcdd2df
Removed unused setting to prevent confusion
nikhil Nov 14, 2023
38e4f42
Added walltime field migration
nikhil Nov 14, 2023
9c10ff0
Added black formatting
nikhil Nov 14, 2023
c2b9f0f
Fixed walltime query
nikhil Nov 14, 2023
b14d087
Fixed tests
nikhil Nov 14, 2023
3c7f002
Added new tests for tool walltime
nikhil Nov 14, 2023
d68aca1
Added black formatting
nikhil Nov 14, 2023
b94c1dd
Added flake8 fix
nikhil Nov 14, 2023
5bcfa57
Added deprecated warning for old ridgeback job
nikhil Nov 14, 2023
13b9b1e
Updated container env varaibles
nikhil Nov 14, 2023
3ee6519
Fix expected limit calculation
nikhil Nov 14, 2023
8914a08
Fixed tests
nikhil Nov 14, 2023
632af24
Fix orchestrator tests
nikhil Nov 16, 2023
f564ee6
Added black formatting
nikhil Nov 16, 2023
058b21b
Fix default walltime
nikhil Nov 16, 2023
cec3d05
Added migrations to rename walltime field
nikhil Nov 16, 2023
2ae54bb
Added default walltime value migration
nikhil Nov 16, 2023
edfc069
Revert leader_walltime to walltime
nikhil Nov 16, 2023
0ef72f1
Added simpler migration
nikhil Nov 16, 2023
9af6843
Added black formatting
nikhil Nov 16, 2023
642f777
Prevent submission lockup
nikhil Nov 16, 2023
7ab26b1
Fix checking hanging jobs
Nov 16, 2023
75dfefc
Fix check hanging job
Nov 17, 2023
d3b64fe
Updated container file
nikhil Nov 17, 2023
5afe6d5
Fixed commandline filtering parameters
nikhil Nov 20, 2023
156f320
Added black formatting
nikhil Nov 20, 2023
73ff821
Merge branch 'feature/added_hanging_job_detection' of github.com:mskc…
nikhil Nov 20, 2023
d112d40
Removed unnecessary env
nikhil Nov 22, 2023
1623ce1
Removed another unused env
nikhil Nov 22, 2023
7a8be6d
Merge pull request #329 from mskcc/feature/version_bump
nikhil Nov 24, 2023
925e196
Add black migration
nikhil Nov 24, 2023
18863f4
Merge branch 'feature/add_tool_level_walltime' of github.com:mskcc/ri…
nikhil Nov 24, 2023
706a632
Fixed process test
nikhil Nov 24, 2023
f4e94b8
Add flake and black fixes
nikhil Nov 24, 2023
c0a30ba
Fix non-deterministic test
nikhil Nov 25, 2023
6305be2
Merge pull request #330 from mskcc/feature/added_hanging_job_detection
sivkovic Jan 10, 2024
99c04cf
Merge pull request #331 from mskcc/feature/add_tool_level_walltime
allanbolipata Jan 10, 2024
51cd6e0
Merge pull request #290 from mskcc/dependabot/pip/gitpython-3.1.30
allanbolipata Jan 10, 2024
e768af1
Merge pull request #260 from mskcc/dependabot/pip/django-filter-2.4.0
allanbolipata Jan 10, 2024
7db9066
Merge pull request #255 from mskcc/dependabot/pip/django-2.2.28
allanbolipata Jan 10, 2024
eb06e2b
Merge branch 'develop' into dependabot/pip/celery-5.2.2
allanbolipata Jan 10, 2024
92bc959
Merge pull request #253 from mskcc/dependabot/pip/celery-5.2.2
allanbolipata Jan 10, 2024
4b99b8a
Create github-actions.yml
D-Pankey Feb 7, 2024
64ea245
Merge pull request #336 from mskcc/feature/githubactions_release1.30.0
D-Pankey Feb 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
push:
branches: [ "release/1.30.0" ]

jobs:
build:

runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5


steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install pip==19.3.1
pip install --force-reinstall 'setuptools<58.0.0'
pip install -r requirements.txt
pip install -r requirements-toil.txt
#python manage.py migrate
- name: Run migrations
run: python manage.py migrate
- name: Run test
#run: python manage.py test
run: |
coverage run --source='.' manage.py test
coverage report -m --fail-under=75
- name: Run flake8
uses: suo/flake8-github-action@releases/v1
with:
checkName: 'build' # NOTE: this needs to be the same as the job name
env:
RIDGEBACK_DB_NAME: github_actions
RIDGEBACK_DB_PASSWORD: postgres
RIDGEBACK_DB_USERNAME: postgres
RIDGEBACK_TOIL_JOB_STORE_ROOT: /sample_path
RIDGEBACK_TOIL_WORK_DIR_ROOT: /sample_path
RIDGEBACK_TOIL_TMP_DIR_ROOT: /sample_path
RIDGEBACK_LSF_WALLTIME: 10:00
RIDGEBACK_LSF_SLA: SLA
CELERY_LOG_PATH: /sample_path
CELERY_PID_PATH: /sample_path
CELERY_BEAT_SCHEDULE_PATH: /sample_path
RIDGEBACK_NEXTFLOW_JOB_STORE_ROOT: /sample_path
RIDGEBACK_NEXTFLOW_WORK_DIR_ROOT: /sample_path
RIDGEBACK_NEXTFLOW_TMP_DIR_ROOT: /sample_path
SINGULARITY_PATH: /sample_singularity
RIDGEBACK_VENV: /sample_path
RIDGEBACK_PATH: /sample_path
RIDGEBACK_PORT: 4009
RIDGEBACK_DEFAULT_QUEUE: sample_queue
RIDGEBACK_RABBITMQ_USERNAME: sample_username
RIDGEBACK_RABBITMQ_PASSWORD: sample_password
41 changes: 41 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
pipeline {
agent any
parameters {
choice(name: 'SERVER', choices: ['DEV', 'STAGE', 'PROD'], description: 'Server')
}
stages {
stage('Deploy to Dev') {
when {
expression { params.SERVER == 'DEV' }
}
steps {
echo 'deply to dev'
sshagent(credentials: ['a4d999a5-6318-4659-83be-3f148a5490ca']) {
sh 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/juno/work/ci/jenkins/known_hosts [email protected] "cd /srv/services/ridgeback_dev_2/code/ridgeback && source /juno/work/ci/jenkins/lsf.sh && git pull && git checkout $BRANCH_NAME && cd /srv/services/ridgeback_dev_2 && source run_restart.sh"'
}
}
}
stage('Deploy to Stage') {
when {
expression { params.SERVER == 'STAGE' }
}
steps {
echo 'deply to stage'
sshagent(credentials: ['a4d999a5-6318-4659-83be-3f148a5490ca']) {
sh 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/juno/work/ci/jenkins/known_hosts [email protected] "cd /srv/services/staging_voyager/ridgeback/code/ridgeback && source /juno/work/ci/jenkins/lsf.sh && git pull && git checkout $BRANCH_NAME && cd ../.. && source run_restart.sh"'
}
}
}
stage('Deploy to Prod') {
when {
expression { params.SERVER == 'PROD' }
}
steps {
echo 'deply to PROD'
sshagent(credentials: ['a4d999a5-6318-4659-83be-3f148a5490ca']) {
sh 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/juno/work/ci/jenkins/known_hosts [email protected] "cd /srv/services/ridgeback/code/ridgeback && source /juno/work/ci/jenkins/lsf.sh && git pull && git checkout $BRANCH_NAME && git pull && source run_restart.sh"'
}
}
}
}
}
89 changes: 41 additions & 48 deletions container/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,72 +17,64 @@ Here are both the essential and optional environment variables needed by the ins

##### General

Variable | Description
:------------- |:-------------
SINGULARITYENV_SINGULARITY_PATH | The path to the singularity executable
SINGULARITYENV_RIDGEBACK_VENV | The path to the venv containing toil and other python dependencies
| Variable | Description |
| :------------------------------ | :----------------------------------------------------------------- |
| SINGULARITYENV_SINGULARITY_PATH | The path to the singularity executable |
| SINGULARITYENV_RIDGEBACK_VENV | The path to the venv containing toil and other python dependencies |

Optional Variable | Description | Default
:------------- |:------------- |:-------------
SINGULARITYENV_RIDGEBACK_PATH | The path to the ridgeback repo | /usr/bin/ridgeback (in container)
SINGULARITYENV_RIDGEBACK_PORT | The port to run the ridgeback webserver | 8000
| Optional Variable | Description | Default |
| :---------------------------- | :-------------------------------------- | :-------------------------------- |
| SINGULARITYENV_RIDGEBACK_PATH | The path to the ridgeback repo | /usr/bin/ridgeback (in container) |
| SINGULARITYENV_RIDGEBACK_PORT | The port to run the ridgeback webserver | 8000 |

##### Rabbitmq

Variable | Description
:------------- |:-------------
SINGULARITYENV_RIDGEBACK_DEFAULT_QUEUE | Default rabbitmq queue
SINGULARITYENV_RIDGEBACK_RABBITMQ_USERNAME | rabbitmq username
SINGULARITYENV_RIDGEBACK_RABBITMQ_PASSWORD | rabbitmq password

The default rabbitmq queue should be the same queue set in toil_orchestrator/celery.py
| Variable | Description |
| :----------------------------------------- | :--------------------- |
| SINGULARITYENV_RIDGEBACK_DEFAULT_QUEUE | Default rabbitmq queue |
| SINGULARITYENV_RIDGEBACK_RABBITMQ_USERNAME | rabbitmq username |
| SINGULARITYENV_RIDGEBACK_RABBITMQ_PASSWORD | rabbitmq password |

The default rabbitmq queue should be the same queue set in orchestrator/celery.py

##### Database

Variable | Description
:------------- |:-------------
SINGULARITYENV_RIDGEBACK_DB_NAME | Database name
SINGULARITYENV_RIDGEBACK_DB_USERNAME | Database username
SINGULARITYENV_RIDGEBACK_DB_PASSWORD | Database password
SINGULARITYENV_RIDGEBACK_DB_PORT | Database port

| Variable | Description |
| :----------------------------------- | :---------------- |
| SINGULARITYENV_RIDGEBACK_DB_NAME | Database name |
| SINGULARITYENV_RIDGEBACK_DB_USERNAME | Database username |
| SINGULARITYENV_RIDGEBACK_DB_PASSWORD | Database password |
| SINGULARITYENV_RIDGEBACK_DB_PORT | Database port |

##### Toil

Variable | Description
:------------- |:-------------
SINGULARITYENV_RIDGEBACK_TOIL_JOB_STORE_ROOT | TOIL jobstore
SINGULARITYENV_RIDGEBACK_TOIL_WORK_DIR_ROOT | TOIL workdir
SINGULARITYENV_RIDGEBACK_TOIL_TMP_DIR_ROOT | TOIL tmp dir

| Variable | Description |
| :------------------------------------------- | :------------ |
| SINGULARITYENV_RIDGEBACK_TOIL_JOB_STORE_ROOT | TOIL jobstore |
| SINGULARITYENV_RIDGEBACK_TOIL_WORK_DIR_ROOT | TOIL workdir |
| SINGULARITYENV_RIDGEBACK_TOIL_TMP_DIR_ROOT | TOIL tmp dir |

##### LSF

Variable | Description
:------------- |:-------------
SINGULARITYENV_LSF_LIBDIR | The path to the lsf lib dir
SINGULARITYENV_LSF_SERVERDIR | The path to the lsf etc dir
SINGULARITYENV_LSF_ENVDIR | The path to the lsf.conf
SINGULARITYENV_LSF_BINDIR | The path to the lsf bin dir
SINGULARITYENV_RIDGEBACK_LSF_SLA | Service SLA for LSF jobs

Optional Variable | Description | Default
:------------- |:------------- |:-------------
SINGULARITYENV_RIDGEBACK_LSF_WALLTIME | walltime limit for LSF jobs | None
SINGULARITYENV_RIDGEBACK_LSF_STACKLIMIT | stacklimit for LSF | None
| Variable | Description |
| :------------------------------- | :-------------------------- |
| SINGULARITYENV_LSF_LIBDIR | The path to the lsf lib dir |
| SINGULARITYENV_LSF_SERVERDIR | The path to the lsf etc dir |
| SINGULARITYENV_LSF_ENVDIR | The path to the lsf.conf |
| SINGULARITYENV_LSF_BINDIR | The path to the lsf bin dir |
| SINGULARITYENV_RIDGEBACK_LSF_SLA | Service SLA for LSF jobs |

| Optional Variable | Description | Default |
| :-------------------------------------- | :----------------- | :------ |
| SINGULARITYENV_RIDGEBACK_LSF_STACKLIMIT | stacklimit for LSF | None |

##### Celery

Optional Variable | Description | Default
:--- | :--- | :---
SINGULARITYENV_CELERY_LOG_PATH | Path to store the celery log files | /tmp
SINGULARITYENV_CELERY_PID_PATH | Path to store the celery pid files | /tmp
SINGULARITYENV_CELERY_BEAT_SCHEDULE_PATH | Path to store the beat schedule path | /tmp



| Optional Variable | Description | Default |
| :--------------------------------------- | :----------------------------------- | :------ |
| SINGULARITYENV_CELERY_LOG_PATH | Path to store the celery log files | /tmp |
| SINGULARITYENV_CELERY_PID_PATH | Path to store the celery pid files | /tmp |
| SINGULARITYENV_CELERY_BEAT_SCHEDULE_PATH | Path to store the beat schedule path | /tmp |

#### Configure singularity mount points

Expand All @@ -95,6 +87,7 @@ export SINGULARITY_BIND="/juno,$SINGULARITYENV_LSF_LIBDIR,$SINGULARITYENV_LSF_SE
#### Running an instance

Running the following command will create a ridgeback instance named `ridgeback_service`

```
singularity instance start ridgeback_service.sif ridgeback_service
```
Expand Down
16 changes: 3 additions & 13 deletions container/ridgeback_service.def
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ Includecmd: no
fi

### LSF Parameters to communicate with LSF
if [ -z "$RIDGEBACK_LSF_WALLTIME" ]; then
echo "ERROR: SINGULARITYENV_RIDGEBACK_LSF_WALLTIME not set."
exit 1
fi

if [ -z "$RIDGEBACK_LSF_SLA" ]; then
echo "ERROR: SINGULARITYENV_RIDGEBACK_LSF_SLA not set."
exit 1
fi

if [ -z "$LSF_ENVDIR" ]; then
echo "ERROR: SINGULARITYENV_LSF_ENVDIR is not set."
exit 1
Expand All @@ -124,7 +114,7 @@ Includecmd: no
echo "ERROR: SINGULARITYENV_LSF_SERVERDIR is not set."
exit 1
fi

python3 ${RIDGEBACK_PATH}/manage.py migrate
yes | python3 ${RIDGEBACK_PATH}/manage.py collectstatic
python3 ${RIDGEBACK_PATH}/manage.py migrate --noinput
python3 ${RIDGEBACK_PATH}/manage.py collectstatic --noinput
python3 ${RIDGEBACK_PATH}/manage.py runserver 0.0.0.0:$RIDGEBACK_PORT > /dev/null 2>&1 < /dev/null &
27 changes: 27 additions & 0 deletions integration_tests/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
pipeline {
agent any
stages {
stage('Deploy to Stage') {
steps {
build job: 'ridgeback-deploy/develop', parameters: [[$class: 'StringParameterValue', name: 'SERVER', value: 'STAGE']], propagate: true, wait: true
}
}
stage('Run integration tests') {
steps {
build job: 'beagle_deployment_staging', propagate: true, wait: true
}
}
}
post {
failure {
slackSend channel: '#robot-house',
color: 'bad',
message: "The pipeline ${currentBuild.fullDisplayName} failed."
}
success {
slackSend channel: '#robot-house',
color: 'good',
message: "The pipeline ${currentBuild.fullDisplayName} completed successfully."
}
}
}
Empty file added integration_tests/__init__.py
Empty file.
1 change: 0 additions & 1 deletion orchestrator/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def cleanup_files(self, request, queryset):
Already cleaned up {cleaned_up}
"""
for job in queryset:

if all([job.job_store_clean_up, job.working_dir_clean_up]):
already_cleaned_up_projects = already_cleaned_up_projects + 1
elif any([job.job_store_clean_up, job.working_dir_clean_up]):
Expand Down
1 change: 1 addition & 0 deletions orchestrator/commands/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CommandType(IntEnum):
SUSPEND = 4
RESUME = 5
SET_OUTPUT_PERMISSION = 6
CHECK_HANGING = 7


class Command(object):
Expand Down
23 changes: 23 additions & 0 deletions orchestrator/migrations/0013_auto_20231116_1546.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.2.24 on 2023-11-16 20:46

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("orchestrator", "0012_job_base_dir"),
]

operations = [
migrations.AddField(
model_name="job",
name="tool_walltime",
field=models.IntegerField(default=1440),
),
migrations.AlterField(
model_name="job",
name="walltime",
field=models.IntegerField(default=7200),
),
]
4 changes: 3 additions & 1 deletion orchestrator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def message_default():
"log": "",
"failed_jobs": {},
"unknown_jobs": {},
"alerts": [],
"info": "",
}
return message_default_dict
Expand Down Expand Up @@ -173,7 +174,8 @@ class Job(BaseModel):
submitted = models.DateTimeField(blank=True, null=True)
finished = models.DateTimeField(blank=True, null=True)
track_cache = JSONField(blank=True, null=True)
walltime = models.IntegerField(default=4320)
walltime = models.IntegerField(default=7200)
tool_walltime = models.IntegerField(default=1440)
memlimit = models.CharField(blank=True, null=True, default=None, max_length=20)
metadata = JSONField(blank=True, null=True, default=dict)

Expand Down
14 changes: 9 additions & 5 deletions orchestrator/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def get_jobs_to_submit():
LONG: 7200 <= walltime
"""
short_jobs_count = Job.objects.filter(
status__gte=Status.SUBMITTING, status__lt=Status.COMPLETED, walltime__lt=settings.SHORT_JOB_MAX_DURATION
status__gte=Status.SUBMITTING,
status__lt=Status.COMPLETED,
walltime__lt=settings.SHORT_JOB_MAX_DURATION,
).count()
medium_jobs_count = Job.objects.filter(
status__gte=Status.SUBMITTING,
Expand All @@ -28,19 +30,21 @@ def get_jobs_to_submit():
walltime__lt=settings.MEDIUM_JOB_MAX_DURATION,
).count()
long_jobs_count = Job.objects.filter(
status__gte=Status.SUBMITTING, status__lt=Status.COMPLETED, walltime__gte=settings.MEDIUM_JOB_MAX_DURATION
status__gte=Status.SUBMITTING,
status__lt=Status.COMPLETED,
walltime__gte=settings.MEDIUM_JOB_MAX_DURATION,
).count()
pending_jobs_short = Job.objects.filter(
status__lt=Status.SUBMITTING, walltime__lt=settings.SHORT_JOB_MAX_DURATION
).order_by("created_date")[: settings.SHORT_JOB_QUEUE - short_jobs_count]
).order_by("created_date")[: max(settings.SHORT_JOB_QUEUE - short_jobs_count, 0)]
pending_jobs_medium = Job.objects.filter(
status__lt=Status.SUBMITTING,
walltime__gte=settings.SHORT_JOB_MAX_DURATION,
walltime__lt=settings.MEDIUM_JOB_MAX_DURATION,
).order_by("created_date")[: settings.MEDIUM_JOB_QUEUE - medium_jobs_count]
).order_by("created_date")[: max(settings.MEDIUM_JOB_QUEUE - medium_jobs_count, 0)]
pending_jobs_long = Job.objects.filter(
status__lt=Status.SUBMITTING, walltime__gte=settings.MEDIUM_JOB_MAX_DURATION
).order_by("created_date")[: settings.LONG_JOB_QUEUE - long_jobs_count]
).order_by("created_date")[: max(settings.LONG_JOB_QUEUE - long_jobs_count, 0)]
jobs_to_submit = []
jobs_to_submit.extend(pending_jobs_short)
jobs_to_submit.extend(pending_jobs_medium)
Expand Down
Loading
Loading