|
| 1 | +name: E2E GCP |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: {} |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + id-token: write |
| 9 | + |
| 10 | +env: |
| 11 | + PULUMI_CONFIG_PASSPHRASE: "ci-ephemeral" |
| 12 | + |
| 13 | +jobs: |
| 14 | + run: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + timeout-minutes: 90 |
| 17 | + environment: gcp-e2e |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + |
| 23 | + - name: Authenticate to GCP |
| 24 | + id: auth |
| 25 | + uses: google-github-actions/auth@v2 |
| 26 | + with: |
| 27 | + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} |
| 28 | + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} |
| 29 | + |
| 30 | + - name: Set up gcloud CLI |
| 31 | + uses: google-github-actions/setup-gcloud@v2 |
| 32 | + |
| 33 | + - uses: astral-sh/setup-uv@v5 |
| 34 | + |
| 35 | + - uses: actions/setup-python@v5 |
| 36 | + with: |
| 37 | + python-version: "3.12" |
| 38 | + |
| 39 | + - name: Install Pulumi CLI |
| 40 | + uses: pulumi/actions@v6 |
| 41 | + |
| 42 | + - name: Install kubectl |
| 43 | + uses: azure/setup-kubectl@v4 |
| 44 | + |
| 45 | + - name: Run wizard (headless) |
| 46 | + id: wizard |
| 47 | + env: |
| 48 | + PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} |
| 49 | + GCP_PROJECT: staging-pinecone-byoc |
| 50 | + PINECONE_REGION: us-central1 |
| 51 | + PINECONE_AZS: "us-central1-a,us-central1-b" |
| 52 | + PINECONE_VPC_CIDR: "10.112.0.0/12" |
| 53 | + PINECONE_DELETION_PROTECTION: "false" |
| 54 | + PINECONE_PUBLIC_ACCESS: "false" |
| 55 | + PINECONE_PROJECT_NAME: "pinecone-byoc" |
| 56 | + run: | |
| 57 | + uv run --with rich --with pyyaml python setup/wizard.py \ |
| 58 | + --cloud gcp \ |
| 59 | + --headless \ |
| 60 | + --stack-name ci \ |
| 61 | + --skip-install \ |
| 62 | + --output-dir ./e2e-project |
| 63 | +
|
| 64 | + - name: Patch __main__.py with CI overrides |
| 65 | + working-directory: ./e2e-project |
| 66 | + run: | |
| 67 | + python3 << 'PATCH' |
| 68 | + path = "__main__.py" |
| 69 | + content = open(path).read() |
| 70 | + content = content.replace( |
| 71 | + " labels=config.get_object(\"labels\") or {},", |
| 72 | + """ labels=config.get_object("labels") or {}, |
| 73 | + global_env=config.require("global-env"), |
| 74 | + api_url=config.require("api-url"), |
| 75 | + auth0_domain=config.require("auth0-domain"), |
| 76 | + amp_aws_account_id=config.require("amp-aws-account-id"),""", |
| 77 | + ) |
| 78 | + open(path, "w").write(content) |
| 79 | + PATCH |
| 80 | +
|
| 81 | + - name: Replace PyPI dep with local source |
| 82 | + working-directory: ./e2e-project |
| 83 | + run: | |
| 84 | + sed -i 's|"pulumi-pinecone-byoc\[gcp\]"|"pulumi-pinecone-byoc[gcp] @ file://'"$GITHUB_WORKSPACE"'"|' pyproject.toml |
| 85 | +
|
| 86 | + - name: Install dependencies |
| 87 | + working-directory: ./e2e-project |
| 88 | + run: uv sync |
| 89 | + |
| 90 | + - name: Setup Pulumi stack |
| 91 | + working-directory: ./e2e-project |
| 92 | + run: | |
| 93 | + pulumi login --local |
| 94 | + pulumi stack select --create ci |
| 95 | +
|
| 96 | + - name: Set Pulumi config |
| 97 | + working-directory: ./e2e-project |
| 98 | + env: |
| 99 | + PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} |
| 100 | + run: | |
| 101 | + pulumi config set --secret pinecone-api-key "$PINECONE_API_KEY" --stack ci |
| 102 | + pulumi config set global-env ci --stack ci |
| 103 | + pulumi config set api-url "https://api-staging.pinecone.io" --stack ci |
| 104 | + pulumi config set auth0-domain "https://internal-beta-pinecone-io.us.auth0.com" --stack ci |
| 105 | + pulumi config set amp-aws-account-id "115740606080" --stack ci |
| 106 | +
|
| 107 | + - name: Pulumi up |
| 108 | + id: up |
| 109 | + working-directory: ./e2e-project |
| 110 | + run: pulumi up --yes --stack ci |
| 111 | + |
| 112 | + - name: Pulumi destroy |
| 113 | + if: always() && steps.wizard.outcome == 'success' |
| 114 | + working-directory: ./e2e-project |
| 115 | + run: pulumi destroy --yes --stack ci |
| 116 | + |
| 117 | + - name: Pulumi stack rm |
| 118 | + if: always() && steps.wizard.outcome == 'success' |
| 119 | + working-directory: ./e2e-project |
| 120 | + run: pulumi stack rm ci --yes --force |
0 commit comments