Skip to content

Commit

Permalink
Merge pull request #17795 from mvdbeek/optimize_job_loading
Browse files Browse the repository at this point in the history
[24.0] Defer job attributes that are usually not needed
  • Loading branch information
mvdbeek authored Mar 19, 2024
2 parents 020bfcd + b1042fc commit b36e5a1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/jobs/runners/pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,8 @@ def __async_update(self, full_status):
remote_job_id = full_status["job_id"]
if len(remote_job_id) == 32:
# It is a UUID - assign_ids = uuid in destination params...
stmt = select(model.Job).filter(model.Job.job_runner_external_id == remote_job_id)
galaxy_job_id = self.app.model.session.execute(stmt).scalar_one().id
stmt = select(model.Job.id).filter(model.Job.job_runner_external_id == remote_job_id)
galaxy_job_id = self.app.model.session.execute(stmt).scalar_one()
else:
galaxy_job_id = remote_job_id
job, job_wrapper = self.app.job_manager.job_handler.job_queue.job_pair_for_id(galaxy_job_id)
Expand Down
32 changes: 18 additions & 14 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11134,23 +11134,27 @@ def __repr__(self):
# ----------------------------------------------------------------------------------------
# The following statements must not precede the mapped models defined above.

Job.any_output_dataset_collection_instances_deleted = column_property(
exists(HistoryDatasetCollectionAssociation.id).where(
and_(
Job.id == JobToOutputDatasetCollectionAssociation.job_id,
HistoryDatasetCollectionAssociation.id == JobToOutputDatasetCollectionAssociation.dataset_collection_id,
HistoryDatasetCollectionAssociation.deleted == true(),
)
Job.any_output_dataset_collection_instances_deleted = deferred(
column_property(
exists(HistoryDatasetCollectionAssociation.id).where(
and_(
Job.id == JobToOutputDatasetCollectionAssociation.job_id,
HistoryDatasetCollectionAssociation.id == JobToOutputDatasetCollectionAssociation.dataset_collection_id,
HistoryDatasetCollectionAssociation.deleted == true(),
)
),
)
)

Job.any_output_dataset_deleted = column_property(
exists(HistoryDatasetAssociation.id).where(
and_(
Job.id == JobToOutputDatasetAssociation.job_id,
HistoryDatasetAssociation.table.c.id == JobToOutputDatasetAssociation.dataset_id,
HistoryDatasetAssociation.table.c.deleted == true(),
)
Job.any_output_dataset_deleted = deferred(
column_property(
exists(HistoryDatasetAssociation.id).where(
and_(
Job.id == JobToOutputDatasetAssociation.job_id,
HistoryDatasetAssociation.table.c.id == JobToOutputDatasetAssociation.dataset_id,
HistoryDatasetAssociation.table.c.deleted == true(),
)
),
)
)

Expand Down

0 comments on commit b36e5a1

Please sign in to comment.