Skip to content
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

Egress Billing Rollout [Parent] #159

Open
10 of 13 tasks
travis opened this issue Oct 9, 2024 · 3 comments
Open
10 of 13 tasks

Egress Billing Rollout [Parent] #159

travis opened this issue Oct 9, 2024 · 3 comments
Assignees

Comments

@travis
Copy link
Member

travis commented Oct 9, 2024

Rollout Plan

Phase 1

Egress Traffic Tracking Without Billing

During this phase, we will deploy the system to the Dev, Staging, and Production environments to begin tracking egress traffic without charging customers. This is possible because Stripe's new Billing Meter API allows us to record metrics for customers even if they are not associated with a price, which is critical for our existing customer base—we need to verify that everything is functioning correctly before initiating billing.

Tasks

Phase 2

@fforbeck
Copy link
Member

Test Plan: Egress Tracking System – Rollout Phase 1

Objective

Validate the Egress Tracking System functionality in the staging environment without billing the customer. This test ensures that egress traffic is correctly recorded in the DynamoDB table and is properly sent to Stripe, linked to the customer account.


Scope

The test will:

  • Verify content serving capability.
  • Confirm egress events are recorded in the egress_traffic DynamoDB table.
  • Ensure egress events are sent to Stripe, associated with the correct customer account.

Prerequisites

  1. Access Requirements:

    • Ensure you have access to the Freeway staging environment.
    • Verify the local agent is configured and authenticated to the staging environment:
      export W3UP_SERVICE_DID=did:web:staging.web3.storage
      export W3UP_SERVICE_URL=https://staging.up.web3.storage
      export W3UP_RECEIPTS_ENDPOINT=https://staging.up.web3.storage
    • Add these env vars before authenticating your client. If you already authenticated without adding these env vars, make sure you backup your w3cli.json from the ~/.config/w3access:
    cd ~/.config/w3access
    cp w3cli.json w3cli.json-backup
    rm w3cli.json
    • And then authenticate the Agent again after exporting the new env vars. By default the Agent is authenticated to Production environment.
    w3 login user@domain
  2. Scripts:

    • delegate-serve.js script in the Freeway is available and functioning.
  3. Environment Configuration:

    • DynamoDB staging table (staging-w3infra-egress-traffic) is accessible.
    • Staging Stripe environment is configured with test API keys.
  4. Required Details:

    • Content CID to test the serve functionality.
    • Staging Gateway URL: https://freeway-staging.dag.haus is up and running.

Test Steps

Step 1: Create a New Space

  1. Run the delegate-serve.js script in the Freeway project:

    node delegate-serve.js --token=<YOUR_TOKEN> --accountDID=did:mailto:<DOMAIN>:<USER> --gatewayDID=did:web:staging.w3s.link
    • Expected Output:
      • The script creates a new "space".
      • Outputs a delegation stub required for the gateway request.
  2. Confirm in the logs script delegation of the space/content/serve/* capability to the staging gateway, e.g:

    Delegation: space/content/serve/* with did:key:...

Step 2: Prepare Gateway Request

  • Use the delegation stub generated in Step 1 as a query parameter in the gateway request.
  • The request will simulate the delegation being retrieved by the gateway.

Example Request:

curl -X GET "https://freeway-staging.dag.haus/ipfs/<CONTENT_CID>?stub_space=did:key:<SPACE_ID>&stub_delegation=<DELEGATION>&authToken=<AUTH_TOKEN>"

Replace:

  • <CONTENT_CID>: Content identifier.
  • <SPACE_ID>: Space DID from generated by the script.
  • <DELEGATION>: Stub delegation generated by the script.
  • <AUTH_TOKEN>: Valid authentication token you provided to the delete_serve.js script.

Step 3: Validate the Results

Expected Results:

  1. HTTP Response:

    • The content is successfully served.
    • The HTTP status code is 200.
  2. DynamoDB Recording:

    • Check the staging-w3infra-egress-traffic table in DynamoDB for a new entry corresponding to the request:
      • Ensure it contains the SPACE, RESOURCE, SERVED_AT, BYTES, CUSTOMER and CAUSE attributes.
  3. Stripe Integration:

    • Verify the egress event is sent to the test Stripe environment with the correct byte count.
    • Confirm the event is linked to the customer you found in staging-w3infra-egress-traffic.

Notes

  • The test simulates a delegation retrieval process, which will be replaced with actual storage in future implementations.
  • Billing functionality is not activated in this phase. Ensure that no charges are applied during the test.

@fforbeck fforbeck changed the title Egress Rollout Egress Rollout - Phase 1 Nov 20, 2024
@fforbeck fforbeck changed the title Egress Rollout - Phase 1 Egress Rollout Nov 25, 2024
@fforbeck fforbeck moved this from In Progress to Stuck / Dead Issue in Storacha Project Planning Nov 25, 2024
@fforbeck
Copy link
Member

fforbeck commented Nov 25, 2024

To complete this task we need to complete:

@fforbeck fforbeck moved this from Stuck / Dead Issue to In Progress in Storacha Project Planning Dec 19, 2024
@fforbeck fforbeck moved this from In Progress to Stuck / Dead Issue in Storacha Project Planning Dec 22, 2024
@fforbeck fforbeck moved this from Stuck / Dead Issue to In Progress in Storacha Project Planning Jan 7, 2025
@fforbeck fforbeck moved this from In Progress to Stuck / Dead Issue in Storacha Project Planning Jan 8, 2025
@fforbeck fforbeck moved this from Stuck / Dead Issue to In Progress in Storacha Project Planning Jan 8, 2025
@fforbeck fforbeck moved this from In Progress to Stuck / Dead Issue in Storacha Project Planning Jan 15, 2025
@fforbeck
Copy link
Member

Blocked:

  • We need the Indexer Service running in production and retrieving content with the space info, and the consolidation of the w3up and upload-service repos must be completed.
  • we are NOT going to get spaces from the indexer either until we finish the upload service / w3up merge and migrate over the changes to write directly into the indexer with spaces in the location claims.

@fforbeck fforbeck changed the title Egress Rollout Egress Rollout [Parent] Jan 15, 2025
@fforbeck fforbeck moved this from Stuck / Dead Issue to In Progress in Storacha Project Planning Jan 15, 2025
@fforbeck fforbeck changed the title Egress Rollout [Parent] Egress Rollout Jan 15, 2025
@fforbeck fforbeck changed the title Egress Rollout Egress Rollout [Parent] Jan 15, 2025
@fforbeck fforbeck moved this from In Progress to Ice Box in Storacha Project Planning Jan 15, 2025
@fforbeck fforbeck moved this from Ice Box to Stuck / Dead Issue in Storacha Project Planning Jan 15, 2025
@fforbeck fforbeck changed the title Egress Rollout [Parent] Egress Billing [Parent] Jan 16, 2025
@fforbeck fforbeck changed the title Egress Billing [Parent] Egress Billing Rollout [Parent] Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Stuck / Dead Issue
Development

No branches or pull requests

2 participants