Skip to content

Fg/ontology resource api#215

Merged
fedorgrab merged 16 commits into
mainfrom
fg/ontology-resource-api
Apr 29, 2026
Merged

Fg/ontology resource api#215
fedorgrab merged 16 commits into
mainfrom
fg/ontology-resource-api

Conversation

@fedorgrab

@fedorgrab fedorgrab commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces a Cell Ontology Resource API (#214) and a new build-and-deploy workflow for CAS services.

New Features

  • Cell Ontology endpoint — returns precomputed CL ontology data: term-to-cell-type mappings, hierarchy children, and shortest/longest path lengths from the cell root
  • create_cell_ontology_resource.py script — parses a CL OWL file and generates the precomputed JSON resource
  • build-and-deploy-workflow.yml — new reusable GitHub Actions workflow for building Docker images and deploying to GCP Artifact Registry / Cloud Run

Changes

  • Added name field to OntologicalColumnInfo model (Alembic migration included)
  • Updated CASModel schema to expose ontological_columns via AliasPath
  • Added CellOntologyResourceResponse Pydantic schema
  • Updated cellarium_general_service and cellarium_general data manager with new ontology resource logic

Security

  • Fixed script injection vulnerability in build-and-deploy-workflow.yml and deploy-workflow.yml: inputs.image-tag is now assigned to an env: variable instead of being interpolated directly into run: blocks

Dependency Updates

  • Downgraded torch and cellarium-ml for compatibility
  • Updated poetry.lock and pyproject.toml

Tests

  • Full unit test coverage for the new script (test_create_cell_ontology_resource_script.py)
  • Updated test_cellarium_general_service.py and related fixtures

This PR closes #214

@fedorgrab fedorgrab force-pushed the fg/ontology-resource-api branch from 214b004 to 63d2ee5 Compare April 15, 2026 21:19
Base automatically changed from fg/update-model-inference to main April 15, 2026 21:41
@fedorgrab fedorgrab force-pushed the fg/ontology-resource-api branch from 63d2ee5 to f72fec9 Compare April 15, 2026 21:44
@fedorgrab fedorgrab force-pushed the fg/ontology-resource-api branch from f72fec9 to 42a537b Compare April 15, 2026 21:49
@fedorgrab fedorgrab force-pushed the fg/ontology-resource-api branch from 64da0db to 1ac2c95 Compare April 16, 2026 17:23
@fedorgrab fedorgrab force-pushed the fg/ontology-resource-api branch from 1ac2c95 to bed1336 Compare April 16, 2026 17:37
Comment thread .github/workflows/build-and-deploy-workflow.yml Fixed
Comment thread .github/workflows/build-and-deploy-workflow.yml Fixed
@fedorgrab fedorgrab self-assigned this Apr 18, 2026
@fedorgrab fedorgrab added the enhancement New feature or request label Apr 18, 2026
@fedorgrab fedorgrab marked this pull request as ready for review April 18, 2026 21:13
@fedorgrab fedorgrab requested a review from sjfleming April 18, 2026 21:15
Comment thread pyproject.toml
{ version = ">=2.2.0,<2.7.0", markers = "sys_platform == 'darwin'" },
{ version = ">=2.2.0,<2.7.0", markers = "sys_platform == 'linux'", source = "pytorch-cpu" }
{ version = ">=2.2.0,<2.5.0", markers = "sys_platform == 'darwin'"},
{ version = ">=2.2.0,<2.5.0", markers = "sys_platform == 'linux'", source = "pytorch-cpu" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this pytorch version limitation will be true until cellarium-ai/cellarium-ml#325

Comment thread pyproject.toml
packaging = "24.2"
pydantic = "2.8.2"
pydantic-settings = "2.3.4"
numpy = "1.26.4"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

did you remove a pinned numpy version? or is this somehow taken care of by poetry?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Poetry does take care of it since it is a dependency of other dependencies (pytorch, anndata, etc). So there is pinned version of numpy in poetry.lock. It now decides which one to use, based on other dependencies.

@sjfleming sjfleming left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, though admittedly I'm not sure I followed every detail :)

@sonarqubecloud

Copy link
Copy Markdown

@fedorgrab fedorgrab merged commit 6255b5a into main Apr 29, 2026
3 checks passed
@fedorgrab fedorgrab deleted the fg/ontology-resource-api branch April 29, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ontology Resource API

3 participants