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

TSPS-354 add pipeline quotas table #149

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading