Skip to content

Commit

Permalink
add pipeline quotas table
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Soto committed Oct 30, 2024
1 parent ddf4f41 commit 27227b8
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/workflow-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ jobs:
needs: [ bump-check, build, tests-and-sonarqube ]
runs-on: ubuntu-latest
steps:
- name: "Notify WSM Slack"
# post to WSM Slack when a regular push (i.e. non-bumper push) is made to main branch
- name: "Notify Teaspoons Slack"
# post to Teaspoons Slack when a regular push (i.e. non-bumper push) is made to main branch
if: always() && github.event_name == 'push' && needs.bump-check.outputs.is-bump == 'no'
uses: broadinstitute/[email protected]
# see https://github.com/broadinstitute/action-slack
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package bio.terra.pipelines.db.entities;

import bio.terra.pipelines.common.utils.PipelinesEnum;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Entity
@Getter
@Setter
@NoArgsConstructor
@Table(name = "pipeline_quotas")
public class PipelineQuota {
@Id
@Column(name = "id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "pipeline_name", nullable = false)
private PipelinesEnum pipelineName;

@Column(name = "default_quota")
private Long defaultQuota;

public PipelineQuota(PipelinesEnum pipelineName, Long defaultQuota) {
this.pipelineName = pipelineName;
this.defaultQuota = defaultQuota;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package bio.terra.pipelines.db.repositories;

import bio.terra.pipelines.common.utils.PipelinesEnum;
import bio.terra.pipelines.db.entities.PipelineQuota;
import org.springframework.data.repository.CrudRepository;

public interface PipelineQuotasRepository extends CrudRepository<PipelineQuota, Long> {
PipelineQuota findByPipelineName(PipelinesEnum pipelineName);
}
1 change: 1 addition & 0 deletions service/src/main/resources/db/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<include file="changesets/20240911_remove_isSuccess.yaml" relativeToChangelogFile="true"/>
<include file="changesets/20240923_update_input_defs_bucket_paths.yaml" relativeToChangelogFile="true"/>
<include file="changesets/20240925_update_ref_panel_prefix_input.yaml" relativeToChangelogFile="true"/>
<include file="changesets/20241030_add_pipeline_quotas.yaml" relativeToChangelogFile="true"/>

<include file="changesets/20240412-testdata.yaml" relativeToChangelogFile="true"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
databaseChangeLog:
- changeSet:
id: add pipeline quotas table
author: ks
changes:
# add pipeline_quotas table
- createTable:
tableName: pipeline_quotas
remarks: |
this table describes the quota allowed per pipeline
columns:
- column:
name: id
type: serial
constraints:
primaryKey: true
nullable: false
- column:
name: pipeline_name
type: text
constraints:
nullable: false
unique: true
- column:
name: default_quota
type: int
constraints:
nullable: false
# add default quota for imputation_beagle to pipeline_quotas table
- insert:
tableName: pipeline_quotas
columns:
- column:
name: pipeline_name
value: imputation_beagle
- column:
name: default_quota
value: 10000

0 comments on commit 27227b8

Please sign in to comment.