yasithdev opened a new pull request, #157:
URL: https://github.com/apache/airavata-portals/pull/157

   ## Summary
   First step of **Track D** — repointing the portal from the legacy Thrift API 
to the new Airavata **gRPC/REST** backend. **Additive and non-breaking**: it 
introduces the new gRPC client (`airavata-python-sdk` 3.0.0 `AiravataClient`) 
*alongside* the existing Thrift client, so `apps/api` views can be migrated 
resource family by resource family (D2+).
   
   - `django_airavata/airavata_grpc.py` — build an `AiravataClient` from a 
request's Keycloak access token (`GRPC_API_HOST`/`PORT`/`SECURE` + 
`GATEWAY_ID`); SDK imported lazily.
   - `middleware.airavata_grpc_client` — attach `request.airavata` as a 
`SimpleLazyObject` so the client (and the `airavata_sdk` import) is built 
**only when a view first uses it**, and the channel is closed after the 
response. Coexists with `request.airavata_client` (Thrift). No view uses it 
yet, so this is inert until D2.
   - `settings` — `GRPC_API_*` defaults targeting the tilt server on :9090.
   - management command `airavata_grpc_smoketest` — authenticated round-trip 
check.
   
   ## ⚠️ Dependency change to review (the reason I didn't self-merge)
   The new gRPC SDK requires **protobuf>=4.25** (and grpcio>=1.60). This repo 
pinned `google-api-python-client==1.12.8`, whose old `google-api-core` pinned 
`protobuf<4` — bumped to `>=2.0` to clear it. **protobuf>=4 breaks the legacy 
MFT storage stubs** in `airavata-django-portal-sdk` (generated for 
protobuf<=3.20). The dev `DjangoFileSystemProvider` path is unaffected and MFT 
stub regeneration is planned for **D4 (storage)** — but this changes the 
protobuf baseline for the whole repo, so it deserves a maintainer's eyes before 
merge.
   
   Also: the new gRPC SDK shares the `airavata-python-sdk` PyPI/import name 
with the legacy 2.2.7 Thrift SDK, so they can't pip-coexist. During the 
transition the new SDK is provided on **PYTHONPATH** from the local 
`apache/airavata` checkout 
(`PYTHONPATH=/path/to/airavata/airavata-python-sdk`); both legacy SDKs are 
dropped at D6. Wiring the new SDK into the portal container (tilt) is a small 
dev-infra follow-up; until then `request.airavata` is simply never accessed 
(lazy), so nothing breaks.
   
   ## Test plan
   - `manage.py check` — no issues (new middleware loads).
   - `pip check` — no protobuf/google-api conflicts after the bumps.
   - `airavata_grpc_smoketest --token <keycloak-jwt>` round-trips to the 
running backend: `research.get_user_experiments -> list (count=0)` against 
:9090.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to