labdao / plex

Platform for running comp bio applications on distributed compute and storage infrastructure
https://lab.bio
MIT License
54 stars 14 forks source link

checkout processing updates #995

Closed acashmoney closed 1 month ago

acashmoney commented 1 month ago

What type of PR is this?

Description

This PR initiates a Stripe billing meter event upon successful job completion only. We utilize the "points" field in the RayJobResponse for dynamically tracking compute usage.

Features to be included in next Stripe PR

Ray Job Response

{
  "response": {
    "uuid": "29bf1262-6c0e-4aa5-b71f-580c888271c2_original",
    "pdb": {
      "uri": "s3://convexity/app/outputs/colabfold/29bf1262-6c0e-4aa5-b71f-580c888271c2_original_unrelaxed_rank_001_alphafold2_multimer_v3_model_1_seed_000.pdb"
    },
    "all_pdb": null,
    "structure_metrics": {
      "uri": "s3://convexity/app/outputs/colabfold/29bf1262-6c0e-4aa5-b71f-580c888271c2_original_scores_rank_001_alphafold2_multimer_v3_model_1_seed_000.json"
    },
    "all_structure_metrics": null,
    "plots": [
      {
        "uri": "s3://convexity/app/outputs/colabfold/29bf1262-6c0e-4aa5-b71f-580c888271c2_original_plddt.png"
      },
      {
        "uri": "s3://convexity/app/outputs/colabfold/29bf1262-6c0e-4aa5-b71f-580c888271c2_original_pae.png"
      },
      {
        "uri": "s3://convexity/app/outputs/colabfold/29bf1262-6c0e-4aa5-b71f-580c888271c2_original_coverage.png"
      }
    ],
    "msa": {
      "uri": "s3://convexity/app/outputs/colabfold/29bf1262-6c0e-4aa5-b71f-580c888271c2_original.a3m"
    },
    "plddt": 85.08113924050629,
    "i_pae": 1.06,
    "time": 569.6802875995636,
    "points": 18
  }
}

Stripe Billing Meter Event

{
  "identifier": "usage-1721704803",
  "timestamp": 1721704804,
  "event_name": "compute_units",
  "payload": {
    "stripe_customer_id": "cus_[ID]",
    "value": "18"
  }
}

Screenshot 2024-07-22 at 11 44 38 PM

linear[bot] commented 1 month ago

LAB-1510 Stripe checkout correct processing

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **docs** | ⬜️ Ignored ([Inspect](https://vercel.com/convexitylabs/docs/2nieWStLamwTnRNktThd3Z2xSLQj)) | [Visit Preview](https://docs-git-993-lab-1510-stripe-checkout-corr-fcb833-convexitylabs.vercel.app) | | Jul 23, 2024 2:50am |