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

Adding AWS HealthOmics as a Module in "Play" tools #954

Merged
merged 183 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
2bf7f7a
sync modularization main with main (#395)
AmrSaber Mar 30, 2023
098081d
backend: Pluginarchitecture (#359)
nikpodsh Mar 31, 2023
b26956b
Added boilerplate for omics module
dlpzx Apr 4, 2023
ef129e6
frontend: simplify dev dockerfile (#396)
AmrSaber Apr 5, 2023
fefc45c
frontend: make styling consistent and remove dead code (#394)
AmrSaber Apr 5, 2023
ec45f74
Adding Omics API
Apr 7, 2023
f26fc01
ignore styling commits in git blame (#405)
AmrSaber Apr 11, 2023
3c4ab2d
Dataset Modularization pt.1 (#413)
nikpodsh Apr 24, 2023
74a249a
Datasets modularization pt.2 (#432)
nikpodsh May 2, 2023
2a4c3d6
Datasets modularization pt.3 (#440)
nikpodsh May 4, 2023
3a9b3d8
Datasets modularization pt.4 (#441)
nikpodsh May 4, 2023
d9b99b3
Datasets modularization pt.5 (#442)
nikpodsh May 10, 2023
fa174f3
Module dependencies (#447)
nikpodsh May 17, 2023
45c1b33
Worksheets modularization (#449)
dbalintx May 17, 2023
07ffa1b
modularization: Merge from main V1.5.2 to the modularization branch (…
nikpodsh May 25, 2023
f2505b5
modularization: MLstudio modularization (#486)
dlpzx Jun 14, 2023
bb6e6c0
modularization: testing extensions (#518)
dlpzx Jun 16, 2023
2b07213
Merge branch 'modularization-main' into modularization/omics-module
dlpzx Jun 20, 2023
a9ab725
Worked on omics-module - still in-progress
dlpzx Jun 20, 2023
f599a8a
modularization: Disable and skip module test directories for modules …
nikpodsh Jun 21, 2023
f3bccc6
modularization: Dataset Sharing modularization (#488)
nikpodsh Jun 26, 2023
79cd32e
modularization: Datapipelines modularization (#457)
dbalintx Jun 27, 2023
ebebe26
Dashboard modularization (#537)
nikpodsh Jul 4, 2023
1ac4c2f
feat: Redshift removal (#551)
dbalintx Jul 6, 2023
db223f5
Fix methods without permissions (#547)
nikpodsh Jul 10, 2023
1dd39e2
Added boilerplate for omics module
dlpzx Apr 4, 2023
8a28d30
Adding Omics API
Apr 7, 2023
1bfcbb9
Worked on omics-module - still in-progress
dlpzx Jun 20, 2023
ff3eb85
Merge remote-tracking branch 'origin/modularization/omics-module' int…
dlpzx Jul 11, 2023
1cba7d8
Update with latest design drafts, added TODOs
dlpzx Jul 11, 2023
94cf683
feat:increase memory limit for local frontend container (#568)
dbalintx Jul 13, 2023
ea0e3e9
Change the pipeline for the modularization (#545)
nikpodsh Jul 13, 2023
e870882
Add generic way to toggle data.all features (#538)
blitzmohit Jul 19, 2023
1b92710
Refactoring of aws calls (#550)
nikpodsh Jul 19, 2023
e859965
Migrate to a new permission checker (#569)
nikpodsh Jul 20, 2023
f2adb7e
Core modularization (#592)
nikpodsh Jul 24, 2023
7d2704f
Merge main into modularization-main branch (#595)
nikpodsh Jul 26, 2023
5b71cac
Resolve modularization inconsistencies (#605)
dbalintx Jul 31, 2023
399769a
Merge remote-tracking branch 'origin/modularization-main' into modula…
dlpzx Jul 31, 2023
99836c7
Modularization-main bugfixes (#604)
dbalintx Aug 3, 2023
3758e68
Modularization: clean up base (#638)
dlpzx Aug 8, 2023
b8d0334
modularization: pivot role policies (#616)
dlpzx Aug 9, 2023
232276f
Minor issues in the modularization (#639)
nikpodsh Aug 10, 2023
2933f18
Move custom resources to Dataset Environment extension (#647)
dlpzx Aug 14, 2023
f182ee2
All modules can be disabled at a time (#643)
nikpodsh Aug 16, 2023
90bc8e8
Update modularization work with the latest main (#661)
nikpodsh Aug 16, 2023
195175a
Change Defaut Cloudfront TLS Feature Flag (#658)
noah-paige Aug 16, 2023
67df2f3
Merge `modularization/frontend` into `modularization-main` (#665)
itsmo-amzn Aug 17, 2023
3ff6360
Refactor and modularize tests (#656)
nikpodsh Aug 17, 2023
9a75de6
Fix module dependency loading. (#675)
nikpodsh Aug 18, 2023
f780e3b
Refactor db names (#677)
dlpzx Aug 18, 2023
9a3ba75
Modularization - Add CDK Bootstrap Exec Policy (#668)
noah-paige Aug 18, 2023
f123cdf
Merge remote-tracking branch 'os/modularization-main' into modulariza…
dlpzx Aug 18, 2023
4bb5343
fixed frontend docker timeout + boto3 for omics
Aug 22, 2023
6ac9998
omics backend changes
Aug 22, 2023
bcab0cc
updated botocore for boto3 omics
Aug 22, 2023
af9dd6a
rebased from patrick-clean-slate and made some frontend changes
Sep 5, 2023
07154a8
Fix imports in frontend to use global imports instead of relative imp…
dlpzx Sep 6, 2023
98bdcdf
fix imports and default filters
dlpzx Sep 7, 2023
be6d53c
made changes to resolve compile issues
Sep 7, 2023
af3a2dd
made changes for ui fixes
Sep 12, 2023
e3a7f8c
Add ECS task to fetch workflows on schedule. Pagination on list_workf…
dlpzx Sep 18, 2023
0db59bb
Squashed commit of the following
Sep 21, 2023
a98e768
updated backend code to include region
Oct 3, 2023
8c1eab7
getworkflow changes
Oct 3, 2023
c152401
Changes to client
dlpzx Oct 3, 2023
3a2bed5
Get workflow changes
Oct 3, 2023
ceb00dd
Merge branch 'kiran-clean-state' of https://git-codecommit.us-east-1.…
Oct 3, 2023
4dea3ac
made changes to common object ObjectBrief.js and other omice view com…
Oct 3, 2023
381a35c
Merge branch 'main-os' into deploy
dlpzx Oct 5, 2023
2dcc552
Add cdk.json values for deployment
dlpzx Oct 5, 2023
0e6fd7a
add context.json for deployment
dlpzx Oct 5, 2023
4ecb752
Add migration script for omics tables
dlpzx Oct 5, 2023
19750da
New decorator type for container task
dlpzx Oct 5, 2023
d23aa54
Adding logs and checking previously registered workflows logic
dlpzx Oct 6, 2023
e65d171
upgrade boto3 version in all requirements files
dlpzx Oct 6, 2023
bdacd8d
Issue with max pagination limit, set to 100
dlpzx Oct 6, 2023
94145b8
Added more logs
dlpzx Oct 6, 2023
d5e6fb5
Fix list_workflows pagination
dlpzx Oct 6, 2023
02dde75
Squashed commit of the following
dlpzx Oct 10, 2023
2e46e8b
Changes to omics createform
dlpzx Oct 10, 2023
0f56fb3
fixed null workflow error
Oct 12, 2023
ed28635
fixing form errors
Oct 12, 2023
58695fb
fixed form validation bugs
Oct 12, 2023
28477bb
Remove unnecessary create run button
dlpzx Oct 13, 2023
63b9fc6
Prettify the frontend
dlpzx Oct 13, 2023
8e37c66
Kiran working session changes
dlpzx Oct 16, 2023
3fd6d8d
Fix issues with permissions
dlpzx Oct 16, 2023
f449762
Added table for list runs and fix create forms and format
dlpzx Oct 17, 2023
336f4bc
Add migraiton script for omics run table
dlpzx Oct 17, 2023
3b1cc5a
Add migraiton script for omics run table
dlpzx Oct 17, 2023
c90a440
made changes to modify the bucket settings
Oct 17, 2023
73ad312
replaced data.all with Amazon ResearchZone
Oct 17, 2023
b982cc9
Merging remote to local
Oct 17, 2023
f6d2c1e
Omics cleanup
dlpzx Oct 18, 2023
5671825
Merge branch 'main-os' into modularization/omics-module
dlpzx Dec 18, 2023
9b72ff4
Clean-up and added TODOs
dlpzx Dec 18, 2023
b9f2351
Merge branch 'main' into modularization/omics-module
dlpzx Jan 11, 2024
5c4c077
clean-up mismatch with main
dlpzx Jan 11, 2024
1d8c672
clean-up mismatch with main-frontend
dlpzx Jan 11, 2024
6149e35
Added permissions to Omics
dlpzx Jan 25, 2024
0007751
Merge branch 'main' into modularization/omics-module
dlpzx Feb 1, 2024
0f92390
Omics - re-do frontend, added to environment, clean-up code, naming c…
dlpzx Feb 2, 2024
5076b0b
Merge branch 'main' into modularization/omics-module
dlpzx Feb 20, 2024
edf86c7
Added testing framework to Omics
dlpzx Feb 20, 2024
cac969d
Omics count_resources and flake
dlpzx Feb 20, 2024
e7002d4
Fixed Omics tests as example
dlpzx Feb 20, 2024
893b4bf
Fix init file - add dataset dependency
dlpzx Feb 20, 2024
c5e53ac
Draft of scoped down permissions
dlpzx Feb 20, 2024
8de80fd
Fixed migration scripts, Rename omics_models, fix issue in pivotrole …
dlpzx Feb 21, 2024
e4a396f
Add Omics migration
dlpzx Feb 21, 2024
44dd4b8
Fixing details in imports and flaking
dlpzx Feb 21, 2024
fac509c
Update omics_client.py for tags placeholder
ironspur5 Mar 1, 2024
4a4e02a
Update env_role_omics_policy.py scoping down permissions
ironspur5 Mar 1, 2024
f54a7da
Update pivot_role_omics_policy.py scoped down permissions
ironspur5 Mar 1, 2024
6a043dc
Update omics_client.py to add Team tag on Run
ironspur5 Mar 1, 2024
b17e332
Merge branch 'main' into modularization/omics-module
dlpzx Mar 5, 2024
5812501
Updates with main - resolve conflicts
dlpzx Mar 5, 2024
25ae62d
Upgrade python version to 3.9
dlpzx Mar 11, 2024
2922a71
Fix issue on prefix used in pivot role policies
dlpzx Mar 11, 2024
963c52f
Fix issue in pivotrole policies List + remove status
dlpzx Mar 11, 2024
e0bbe46
Fix issue in pivotrole policies List
dlpzx Mar 11, 2024
a2e5e06
Update pivot_role_omics_policy.py to include ARN format of Ready2Run …
ironspur5 Mar 14, 2024
9bd2429
Update env_role_omics_policy.py to add support for Ready2Run workflow…
ironspur5 Mar 14, 2024
aa6be2f
Update env_role_omics_policy.py Applying StartRun to Workflow resource
ironspur5 Mar 19, 2024
4a9ea19
Update pivot_role_omics_policy.py Applying StartRun to Workflow resource
ironspur5 Mar 19, 2024
07a5ca5
Update omics_workflows_fetcher.py fixing duplicate workflows in DB at…
ironspur5 Mar 22, 2024
d687b4a
Update omics_workflows_fetcher.py Removing private workflows until fu…
ironspur5 Mar 26, 2024
4f098b4
Added Omics toogle to environment as environment parameter
dlpzx Apr 3, 2024
0289122
Fix accountId and region from OmicsRun gql model
dlpzx Apr 3, 2024
8723d3e
Add search bar in OmicsWorkflows and filter in query
dlpzx Apr 3, 2024
c52875c
Merge branch 'main' into modularization/omics-module
dlpzx Apr 3, 2024
3ec41e3
Fix formatting for Omics
dlpzx Apr 3, 2024
8c31586
Fix duplicates in omics fetcher by looking at id
dlpzx Apr 3, 2024
5bc855d
Added tests and fixed omics fetcher
dlpzx Apr 3, 2024
55c0ab7
Merge branch 'main' into modularization/omics-module
dlpzx Apr 10, 2024
ae1df23
Modified code from new main features
dlpzx Apr 10, 2024
57002e0
Add omics tests and fix glitch
dlpzx Apr 10, 2024
88dab90
Formatting using ruff
dlpzx Apr 10, 2024
5d5c283
adding needed IAM permissions and trust relationship to environment a…
Apr 12, 2024
ccaadcb
Add checks for source None
dlpzx Apr 16, 2024
dff83c8
Remove unnecessary decoration in listOmicsRuns
dlpzx Apr 17, 2024
33b8d84
Merge branch 'main' into modularization/omics-module
dlpzx Apr 17, 2024
0c1382e
Update the omics migration script
dlpzx Apr 17, 2024
b397b0c
Fix has_group_permissions import
dlpzx Apr 17, 2024
0650dcc
Linting
dlpzx Apr 17, 2024
197d2bf
Merge branch 'main' into modularization/omics-module
dlpzx Apr 22, 2024
25785bd
added MUI Data Grid component to list and select Runs
Apr 30, 2024
47e3727
Fix permissions for run in Omics
dlpzx May 3, 2024
fed88af
Fix output S3 in list Runs
dlpzx May 3, 2024
607b197
Adding frontend button and initial logic for Delete Runs
May 5, 2024
4747083
Continuing adding deleteRuns backend and frontend code
May 7, 2024
b3de0b7
delete run backend clean up continued
May 10, 2024
89ba76a
placeholder code for delete runs unit tests
May 14, 2024
7f71160
Remove TODOs, revert changes in files that should not be edited
dlpzx May 14, 2024
d6954d4
removing unneeded comments and TODOs
May 14, 2024
f7f4b93
WIP delete runs testing
May 14, 2024
deca034
Change input type for deleteOmicsRun.js and fix minor issues
dlpzx May 15, 2024
099f43a
Fix order of giving permissions
dlpzx May 15, 2024
abe594a
Fix delete omics test bugs
dlpzx May 17, 2024
aa358f2
Merge branch 'refs/heads/main' into modularization/omics-module
dlpzx May 17, 2024
e5b3d7d
Fix alembic head for omics
dlpzx May 17, 2024
a28154e
Fix changes from main
dlpzx May 17, 2024
16576cc
linting
dlpzx May 17, 2024
3a0598e
Fix imports
dlpzx May 17, 2024
ce96ff9
finishing delete runs unit tests
May 17, 2024
c43797f
Merge branch 'refs/heads/main' into modularization/omics-module
dlpzx May 21, 2024
46d3876
Fix alembic, linting and integration tests with changes from main
dlpzx May 21, 2024
82e997c
Fix PR self-review
dlpzx May 21, 2024
a6214b6
Fix PR self-review - omics client without references to db objects
dlpzx May 21, 2024
77418a4
removing omics runs as environment resources
May 21, 2024
2387e0b
Addressing bulk of Noah's PR comments; will address the rest later th…
Jun 5, 2024
5c35cd0
Merge remote-tracking branch 'refs/remotes/origin/main' into modulari…
dlpzx Jun 7, 2024
a14c177
Fix migrations, PR comments and merge format
dlpzx Jun 7, 2024
0753a28
Move listS3DatasetsOwnedByEnvGroup to global services - shared by omi…
dlpzx Jun 7, 2024
0ebf4f3
Add query to listOmicsEnvironments in ECS task
dlpzx Jun 7, 2024
a0951bc
scoping pivot role permissions for Omics testing
Jun 10, 2024
f255f48
no environments case
dlpzx Jun 10, 2024
94a2797
addressing misc PR comments
Jun 11, 2024
f7deeb9
Merge remote-tracking branch 'refs/remotes/origin/main' into modulari…
dlpzx Jun 14, 2024
3ce3085
Fix tests and enable in config to have tests always enabled in PR
dlpzx Jun 14, 2024
5346eee
Disable omics from config.json
dlpzx Jun 14, 2024
d39fc19
linting
dlpzx Jun 14, 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
52 changes: 52 additions & 0 deletions backend/dataall/base/cdkproxy/cdk.context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
dlpzx marked this conversation as resolved.
Show resolved Hide resolved
"vpc-provider:account=856197974211:filter.isDefault=true:region=us-east-1:returnAsymmetricSubnets=true": {
"vpcId": "vpc-0bbcc12ab6cb2cc19",
"vpcCidrBlock": "172.31.0.0/16",
"ownerAccountId": "856197974211",
"availabilityZones": [],
"subnetGroups": [
{
"name": "Public",
"type": "Public",
"subnets": [
{
"subnetId": "subnet-0881ca6af336c69ca",
"cidr": "172.31.16.0/20",
"availabilityZone": "us-east-1a",
"routeTableId": "rtb-0e84eedc7b0edeb73"
},
{
"subnetId": "subnet-0b0dcf15be9546df8",
"cidr": "172.31.32.0/20",
"availabilityZone": "us-east-1b",
"routeTableId": "rtb-0e84eedc7b0edeb73"
},
{
"subnetId": "subnet-00518b260815523ec",
"cidr": "172.31.0.0/20",
"availabilityZone": "us-east-1c",
"routeTableId": "rtb-0e84eedc7b0edeb73"
},
{
"subnetId": "subnet-03d3d4329052576f6",
"cidr": "172.31.80.0/20",
"availabilityZone": "us-east-1d",
"routeTableId": "rtb-0e84eedc7b0edeb73"
},
{
"subnetId": "subnet-0abb0e50f5744a661",
"cidr": "172.31.48.0/20",
"availabilityZone": "us-east-1e",
"routeTableId": "rtb-0e84eedc7b0edeb73"
},
{
"subnetId": "subnet-08a2a4636d9f4c0b9",
"cidr": "172.31.64.0/20",
"availabilityZone": "us-east-1f",
"routeTableId": "rtb-0e84eedc7b0edeb73"
}
]
}
]
}
}
6 changes: 3 additions & 3 deletions backend/dataall/base/cdkproxy/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aws-cdk-lib==2.99.0
boto3==1.24.85
boto3-stubs==1.24.85
botocore==1.27.85
boto3==1.28.23
boto3-stubs==1.28.23
botocore==1.31.23
cdk-nag==2.7.2
constructs==10.0.73
starlette==0.27.0
Expand Down
60 changes: 60 additions & 0 deletions backend/dataall/modules/catalog/api/registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from dataclasses import dataclass
from typing import Type, Dict, Optional, Protocol, Union

from dataall.base.api import gql
from dataall.base.api.gql.graphql_union_type import UnionTypeRegistry
from dataall.base.db import Resource
from dataall.modules.catalog.indexers.base_indexer import BaseIndexer


class Identifiable(Protocol):
@classmethod
def uri(cls):
...


@dataclass
dlpzx marked this conversation as resolved.
Show resolved Hide resolved
class GlossaryDefinition:
"""Glossary's definition used for registration references of other modules"""
target_type: str
object_type: str
model: Union[Type[Resource], Identifiable] # should be an intersection, but python typing doesn't have one yet
reindexer: Type[BaseIndexer] = None # a callback to reindex glossaries in open search

def target_uri(self):
return self.model.uri()


class GlossaryRegistry(UnionTypeRegistry):
"""Registry of glossary definition and API to retrieve and reindex data"""
_DEFINITIONS: Dict[str, GlossaryDefinition] = {}

@classmethod
def register(cls, glossary: GlossaryDefinition) -> None:
cls._DEFINITIONS[glossary.target_type] = glossary

@classmethod
def find_model(cls, target_type: str) -> Optional[Resource]:
definition = cls._DEFINITIONS[target_type]
return definition.model if definition is not None else None

@classmethod
def find_object_type(cls, model: Resource) -> Optional[str]:
for _, definition in cls._DEFINITIONS.items():
if isinstance(model, definition.model):
return definition.object_type
return None

@classmethod
def definitions(cls):
return cls._DEFINITIONS.values()

@classmethod
def types(cls):
return [gql.Ref(definition.object_type) for definition in cls._DEFINITIONS.values()]

@classmethod
def reindex(cls, session, target_type: str, target_uri: str):
definition = cls._DEFINITIONS[target_type]
if definition.reindexer:
definition.reindexer.upsert(session, target_uri)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import logging

from botocore.exceptions import ClientError

from dataall.base.aws.sts import SessionHelper

log = logging.getLogger('aws:codepipeline')


class CodepipelineDatapipelineClient:
dlpzx marked this conversation as resolved.
Show resolved Hide resolved
def __init__(self, aws_account_id, region) -> None:
self._aws_account_id = aws_account_id
self._region = region
self._session = SessionHelper.remote_session(aws_account_id)
self._client = self._session.client('codepipeline', region_name=region)

def get_pipeline_execution_summaries(self, codepipeline_name):
executions = []
try:
response = self._client.list_pipeline_executions(
pipelineName=codepipeline_name
)
executions = response['pipelineExecutionSummaries']
except ClientError as e:
log.warning(
f'Could not retrieve pipeline executions for {codepipeline_name} aws://{self._aws_account_id}:{self._region}'
)

return executions
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import logging

from botocore.exceptions import ClientError

from dataall.base.aws.sts import SessionHelper

log = logging.getLogger('aws:glue')


class GlueDatapipelineClient:
def __init__(self, aws_account_id, region) -> None:
self._session = SessionHelper.remote_session(aws_account_id)
self._client = self._session.client('glue', region_name=region)

def get_job_runs(self, datapipeline_job_name):
try:
response = self._client.get_job_runs(JobName=datapipeline_job_name)
except ClientError as e:
log.warning(f'Could not retrieve pipeline runs , {str(e)}')
return []
return response['JobRuns']
13 changes: 13 additions & 0 deletions backend/dataall/modules/datapipelines/cdk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from dataall.modules.datapipelines.cdk import datapipelines_cdk_cli_wrapper_extension, datapipelines_cdk_pipeline, \
dlpzx marked this conversation as resolved.
Show resolved Hide resolved
env_role_datapipelines_stepfunctions_policy, env_role_datapipelines_lambda_policy, env_role_datapipelines_cicd_policy, datapipelines_pipeline, \
pivot_role_datapipelines_policy

__all__ = [
'datapipelines_cdk_cli_wrapper_extension',
'datapipelines_cdk_pipeline',
'env_role_datapipelines_stepfunctions_policy',
'env_role_datapipelines_lambda_policy',
'env_role_datapipelines_cicd_policy',
'datapipelines_pipeline',
'pivot_role_datapipelines_policy'
]
35 changes: 35 additions & 0 deletions backend/dataall/modules/omics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Contains the code related to X"""
noah-paige marked this conversation as resolved.
Show resolved Hide resolved
import logging
from typing import Set

from dataall.base.loader import ImportMode, ModuleInterface
from dataall.core.environment.services.environment_resource_manager import EnvironmentResourceManager
from dataall.modules.omics.db.omics_repository import OmicsRepository

log = logging.getLogger(__name__)


class OmicsApiModuleInterface(ModuleInterface):
"""Implements ModuleInterface for omics GraphQl lambda"""

@staticmethod
def is_supported(modes: Set[ImportMode]) -> bool:
return ImportMode.API in modes

def __init__(self):
import dataall.modules.omics.api
from dataall.modules.omics.services.omics_permissions import GET_OMICS_RUN, UPDATE_OMICS_RUN
dlpzx marked this conversation as resolved.
Show resolved Hide resolved

log.info("API of omics has been imported")


class OmicsCdkModuleInterface(ModuleInterface):
"""Implements ModuleInterface for omics ecs tasks"""

@staticmethod
def is_supported(modes: Set[ImportMode]) -> bool:
return ImportMode.CDK in modes

def __init__(self):
import dataall.modules.omics.cdk
log.info("API of Omics has been imported")
5 changes: 5 additions & 0 deletions backend/dataall/modules/omics/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""The package defines the schema for Omics Pipelines"""

from dataall.modules.omics.api import input_types, mutations, queries, types, resolvers

__all__ = ["types", "input_types", "queries", "mutations", "resolvers"]
37 changes: 37 additions & 0 deletions backend/dataall/modules/omics/api/input_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""The module defines GraphQL input types for Omics Runs"""

from dataall.base.api import gql

NewOmicsRunInput = gql.InputType(
name="NewOmicsRunInput",
arguments=[
gql.Field("environmentUri", type=gql.NonNullableType(gql.String)),
gql.Field("workflowId", type=gql.NonNullableType(gql.String)),
gql.Field("label", type=gql.NonNullableType(gql.String)),
gql.Field("destination", type=gql.String),
gql.Field("parameterTemplate", type=gql.String),
gql.Field("SamlAdminGroupName", type=gql.NonNullableType(gql.String)),
],
)

dlpzx marked this conversation as resolved.
Show resolved Hide resolved
# UpdateOmicsRunInput = gql.InputType(
# name="UpdateOmicsRunInput",
# arguments=[
# gql.Argument(name="label", type=gql.String),
# gql.Argument(name="description", type=gql.String),
# gql.Argument(name="tags", type=gql.ArrayType(gql.String)),
# gql.Argument(name="S3InputBucket", type=gql.String),
# gql.Argument(name="S3InputPrefix", type=gql.String),
# gql.Argument(name="S3OutputBucket", type=gql.String),
# gql.Argument(name="S3OutputPrefix", type=gql.String),
# ],
# )

OmicsFilter = gql.InputType(
name="OmicsFilter",
arguments=[
gql.Argument(name="term", type=gql.String),
gql.Argument(name="page", type=gql.Integer),
gql.Argument(name="pageSize", type=gql.Integer),
],
)
34 changes: 34 additions & 0 deletions backend/dataall/modules/omics/api/mutations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""The module defines GraphQL mutations for Omics Pipelines"""

from dataall.base.api import gql
from .resolvers import *
dlpzx marked this conversation as resolved.
Show resolved Hide resolved

createOmicsRun = gql.MutationField(
name="createOmicsRun",
type=gql.Ref("OmicsRun"),
args=[gql.Argument(name="input", type=gql.NonNullableType(gql.Ref("NewOmicsRunInput")))],
resolver=create_omics_run,
)
# TODO implement updates to runs!
# updateOmicsRun = gql.MutationField(
# name="updateOmicsRun",
# type=gql.Ref("OmicsRun"),
# args=[
# gql.Argument(name="OmicsRunUri", type=gql.NonNullableType(gql.String)),
# gql.Argument(name="input", type=gql.Ref("UpdateOmicsRunInput")),
# ],
# resolver=update_omics_pipeline,
# )

# TODO: not used in the frontend at the moment
# deleteOmicsRun = gql.MutationField(
# name="deleteOmicsRun",
# type=gql.Boolean,
# args=[
# gql.Argument(name="runUri", type=gql.NonNullableType(gql.String)),
# gql.Argument(name="deleteFromAWS", type=gql.Boolean),
# ],
# resolver=delete_omics_run,
# )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement missing methods or remove them from the code


dlpzx marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 25 additions & 0 deletions backend/dataall/modules/omics/api/queries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""The module defines GraphQL queries for Omics runs"""

from dataall.base.api import gql
from .resolvers import *

listOmicsRuns = gql.QueryField(
name="listOmicsRuns",
args=[gql.Argument(name="filter", type=gql.Ref("OmicsFilter"))],
resolver=list_omics_runs,
type=gql.Ref("OmicsRunSearchResults"),
)

getOmicsWorkflow = gql.QueryField(
name="getOmicsWorkflow",
args=[gql.Argument(name="workflowId", type=gql.NonNullableType(gql.String))],
type=gql.Ref("OmicsWorkflow"),
resolver=get_omics_workflow,
)

listOmicsWorkflows = gql.QueryField(
name="listOmicsWorkflows",
args=[gql.Argument(name="filter", type=gql.Ref("OmicsFilter"))],
type=gql.Ref("OmicsWorkflows"),
resolver=list_omics_workflows,
)
Loading