Skip to content
Open
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
27 changes: 27 additions & 0 deletions apps/cr-hypervr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1

WORKDIR /app

# System deps (minimal)
RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*

COPY requirements.txt ./
RUN pip install --upgrade pip && pip install -r requirements.txt

# Preload base model for offline CPU inference (no heredoc for wider builder support)
RUN python -c "from sentence_transformers import SentenceTransformer; import os; os.makedirs('models/base-minilm', exist_ok=True); SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2').save('models/base-minilm'); print('Base MiniLM model cached at models/base-minilm')"

COPY app ./app
COPY scripts ./scripts
COPY pipeline ./pipeline
COPY training ./training

EXPOSE 8080

ENV MODEL_DIR=""
ENV BASE_MODEL_DIR="models/base-minilm"
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
21 changes: 21 additions & 0 deletions apps/cr-hypervr/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 YP

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 47 additions & 0 deletions apps/cr-hypervr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
PY ?= python3

.PHONY: gcp-provision gcp-secrets gcp-verify gcp-build gcp-deploy gcp-deploy-infra gcp-jobs-deploy gcp-job-run-phase2 gcp-job-run-phase3 db-apply-cloudsql export-openapi

# GCP: Core provisioning (Artifact Registry, bucket, Cloud SQL, SAs, secret)
gcp-provision:
bash scripts/provision_core.sh

# GCP: Create/update Secret Manager entries (e.g., DATABASE_URL, Kaggle creds)
gcp-secrets:
bash scripts/setup_secrets.sh

# GCP: Sanity checks (services, AR repo, Cloud SQL, SAs)
gcp-verify:
bash scripts/gcp_verify.sh

# GCP: Build container in Cloud Build and push to Artifact Registry
gcp-build:
gcloud builds submit --region=$${REGION:-europe-west2} --config=cloudbuild.yaml --substitutions=_REGION=$${REGION:-europe-west2}

# GCP: Deploy primary API service (embedding-service)
gcp-deploy:
bash scripts/deploy_cloud_run.sh

# GCP: Deploy infra-service (graph‑focused, POST‑only)
gcp-deploy-infra:
bash scripts/deploy_graph_service.sh

# GCP: Deploy Cloud Run Jobs for data pipelines and validation
gcp-jobs-deploy:
bash scripts/deploy_jobs.sh

# Run Phase 2 (join → profiles → hyperedges + validation) as a Cloud Run Job
gcp-job-run-phase2:
PROJECT_ID=$${PROJECT_ID} REGION=$${REGION:-europe-west2} bash -lc 'gcloud beta run jobs execute pipeline-phase2 --region $$REGION'

# Run Phase 3 (fine‑tune → ONNX → INT8) as a Cloud Run Job
gcp-job-run-phase3:
PROJECT_ID=$${PROJECT_ID} REGION=$${REGION:-europe-west2} bash -lc 'gcloud beta run jobs execute pipeline-phase3 --region $$REGION'

# Apply schema + pgvector to Cloud SQL (uses Cloud SQL connect)
db-apply-cloudsql:
bash scripts/db_apply_cloudsql.sh

# Export OpenAPI JSON (writes openapi.json in repo root)
export-openapi:
$(PY) scripts/export_openapi.py
Loading