-
Notifications
You must be signed in to change notification settings - Fork 14
Implement tiledb_soma_healthcheck component #1055
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
Open
DriesSchaumont
wants to merge
7
commits into
main
Choose a base branch
from
implement_tiledbsoma_healthcheck
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4ef230c
Implement tiledb_soma_healthcheck component
DriesSchaumont c877585
Update PR number
DriesSchaumont 15f2d7a
Merge branch 'main' into implement_tiledbsoma_healthcheck
DriesSchaumont 3854733
Update CHANGELOG
DriesSchaumont 3cdc642
Merge remote-tracking branch 'origin/main' into implement_tiledbsoma_…
DriesSchaumont 89d1adc
Update CHANGELOG
DriesSchaumont fd0dd50
Update input_uri argument description
DriesSchaumont File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: tiledb_healthcheck | ||
namespace: query | ||
scope: "public" | ||
description: | | ||
Checks if a provided location can be queried as a TileDB-SOMA database. | ||
authors: | ||
- __merge__: /src/authors/dries_schaumont.yaml | ||
roles: [ author, maintainer ] | ||
argument_groups: | ||
- name: Input database | ||
description: "Open a TileDB SOMA database by URI." | ||
arguments: | ||
- name: "--input_uri" | ||
type: string | ||
description: "If specified, a URI containing the TileDB-SOMA objects." | ||
required: true | ||
example: "s3://bucket/path" | ||
- name: "--s3_region" | ||
description: | | ||
Region where the TileDB-SOMA database is hosted. | ||
type: string | ||
required: true | ||
resources: | ||
- type: python_script | ||
path: script.py | ||
- path: /src/utils/setup_logger.py | ||
test_resources: | ||
- type: python_script | ||
path: test.py | ||
engines: | ||
- type: docker | ||
image: python:3.12 | ||
setup: | ||
- type: python | ||
packages: | ||
- tiledbsoma | ||
test_setup: | ||
- type: python | ||
__merge__: [ /src/base/requirements/viashpy.yaml, .] | ||
runners: | ||
- type: executable | ||
- type: nextflow | ||
directives: | ||
label: [highmem, midcpu] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import sys | ||
import tiledbsoma | ||
|
||
## VIASH START | ||
par = { | ||
"input_uri": "s3://cellxgene-census-public-us-west-2/cell-census/2025-01-30/soma/", | ||
"s3_region": "us-west-2", | ||
} | ||
meta = {"resources_dir": "src/utils"} | ||
## VIASH END | ||
|
||
sys.path.append(meta["resources_dir"]) | ||
from setup_logger import setup_logger | ||
|
||
logger = setup_logger() | ||
|
||
|
||
def main(par): | ||
logger.info("Component started") | ||
|
||
tiledb_config = { | ||
"vfs.s3.no_sign_request": "false", | ||
"vfs.s3.region": par["s3_region"], | ||
} | ||
context = tiledbsoma.SOMATileDBContext(tiledb_config=tiledb_config) | ||
logger.info( | ||
"Trying to access '%s' in region '%s'", par["input_uri"], par["s3_region"] | ||
) | ||
with tiledbsoma.open(par["input_uri"], "w", context=context) as _: | ||
logger.info("Connection successful!") | ||
logger.info("Component finished") | ||
|
||
|
||
if __name__ == "__main__": | ||
main(par) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sys | ||
import pytest | ||
|
||
## VIASH START | ||
meta = { | ||
"resources_dir": "./resources_test/", | ||
"executable": "./target/executable/query/tiledb_hea", | ||
"config": "/home/di/code/openpipeline/src/query/cellxgene_census/config.vsh.yaml", | ||
} | ||
## VIASH END | ||
|
||
|
||
def test_healthcheck(run_component): | ||
run_component( | ||
[ | ||
"--input_uri", | ||
"s3://cellxgene-census-public-us-west-2/cell-census/2025-01-30/soma/", | ||
"--s3_region", | ||
"us-west-2", | ||
] | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(pytest.main([__file__])) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a logger statement be added with some information in case the health check is unsuccesful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could; what extra information are you looking for? Mostly tiledbsoma already adds information in the error message.