-
Notifications
You must be signed in to change notification settings - Fork 1
Azure support #20
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
Merged
Merged
Azure support #20
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2cd8b3b
Azure support
benny-n 1d399a9
format + fix azure ci
benny-n badc0d0
feedback + lint
benny-n 9fef222
more feedback
benny-n 6218144
more feedback + fix ci
benny-n 309a3e0
fix zones
benny-n 842453d
remove separate storage account
benny-n 6dcee4e
naming
benny-n be379ff
feedback
benny-n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,209 @@ | ||
| name: E2E Azure | ||
|
|
||
| on: | ||
| workflow_call: {} | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| up: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| environment: azure-e2e | ||
| env: | ||
| ARM_USE_OIDC: "true" | ||
| ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
| ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
| ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set stack name | ||
| run: | | ||
| if [ -n "$PR_NUMBER" ]; then | ||
| echo "STACK_NAME=ci-azure-pr${PR_NUMBER}-${GITHUB_SHA::7}" >> "$GITHUB_ENV" | ||
| else | ||
| echo "STACK_NAME=ci-azure-${GITHUB_SHA::7}" >> "$GITHUB_ENV" | ||
| fi | ||
| env: | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
|
|
||
| - name: Azure login (OIDC) | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Pulumi CLI | ||
| uses: pulumi/actions@v6 | ||
|
|
||
| - name: Install kubectl | ||
| uses: azure/setup-kubectl@v4 | ||
|
|
||
| - name: Run wizard (headless) | ||
| id: wizard | ||
| env: | ||
| PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | ||
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
| PINECONE_REGION: eastus2 | ||
| PINECONE_AZS: "1,3" | ||
| PINECONE_VPC_CIDR: "10.0.0.0/16" | ||
| PINECONE_DELETION_PROTECTION: "false" | ||
| PINECONE_PUBLIC_ACCESS: "false" | ||
| PINECONE_PROJECT_NAME: "pinecone-byoc" | ||
| run: | | ||
| uv run --with rich --with pyyaml python setup/wizard.py \ | ||
| --cloud azure \ | ||
| --headless \ | ||
| --stack-name "$STACK_NAME" \ | ||
| --skip-install \ | ||
| --output-dir ./e2e-project | ||
|
|
||
| - name: Patch __main__.py with CI overrides | ||
| working-directory: ./e2e-project | ||
| run: | | ||
| python3 << 'PATCH' | ||
| path = "__main__.py" | ||
| content = open(path).read() | ||
| content = content.replace( | ||
| " tags=config.get_object(\"tags\"),", | ||
| """ tags=config.get_object("tags"), | ||
| global_env=config.require("global-env"), | ||
| api_url=config.require("api-url"), | ||
| auth0_domain=config.require("auth0-domain"),""", | ||
| ) | ||
| open(path, "w").write(content) | ||
| PATCH | ||
|
|
||
| - name: Replace PyPI dep with local source | ||
| working-directory: ./e2e-project | ||
| run: | | ||
| sed -i 's|"pulumi-pinecone-byoc\[azure\]"|"pulumi-pinecone-byoc[azure] @ file://'"$GITHUB_WORKSPACE"'"|' pyproject.toml | ||
| grep -q 'file://' pyproject.toml || { echo "ERROR: local source substitution failed"; exit 1; } | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./e2e-project | ||
| run: uv sync | ||
|
|
||
| - name: Setup Pulumi stack | ||
| working-directory: ./e2e-project | ||
| env: | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| run: | | ||
| pulumi stack select --create "$STACK_NAME" | ||
|
|
||
| - name: Set Pulumi config | ||
| working-directory: ./e2e-project | ||
| env: | ||
| PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| run: | | ||
| pulumi config set --secret pinecone-api-key "$PINECONE_API_KEY" --stack "$STACK_NAME" | ||
| pulumi config set global-env ci --stack "$STACK_NAME" | ||
| pulumi config set api-url "https://api-staging.pinecone.io" --stack "$STACK_NAME" | ||
| pulumi config set auth0-domain "https://internal-beta-pinecone-io.us.auth0.com" --stack "$STACK_NAME" | ||
|
|
||
| - name: Pulumi up | ||
| working-directory: ./e2e-project | ||
| env: | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| run: pulumi up --yes --stack "$STACK_NAME" | ||
|
|
||
| down: | ||
| needs: up | ||
| if: always() && needs.up.result != 'skipped' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| environment: azure-e2e | ||
| env: | ||
| ARM_USE_OIDC: "true" | ||
| ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
| ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
| ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set stack name | ||
| run: | | ||
| if [ -n "$PR_NUMBER" ]; then | ||
| echo "STACK_NAME=ci-azure-pr${PR_NUMBER}-${GITHUB_SHA::7}" >> "$GITHUB_ENV" | ||
| else | ||
| echo "STACK_NAME=ci-azure-${GITHUB_SHA::7}" >> "$GITHUB_ENV" | ||
| fi | ||
| env: | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
|
|
||
| - name: Azure login (OIDC) | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Pulumi CLI | ||
| uses: pulumi/actions@v6 | ||
|
|
||
| - name: Run wizard (headless) | ||
| env: | ||
| PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | ||
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
| PINECONE_REGION: eastus2 | ||
| PINECONE_AZS: "1,3" | ||
| PINECONE_VPC_CIDR: "10.0.0.0/16" | ||
| PINECONE_DELETION_PROTECTION: "false" | ||
| PINECONE_PUBLIC_ACCESS: "false" | ||
| PINECONE_PROJECT_NAME: "pinecone-byoc" | ||
| run: | | ||
| uv run --with rich --with pyyaml python setup/wizard.py \ | ||
| --cloud azure \ | ||
| --headless \ | ||
| --stack-name "$STACK_NAME" \ | ||
| --skip-install \ | ||
| --output-dir ./e2e-project | ||
|
|
||
| - name: Replace PyPI dep with local source | ||
| working-directory: ./e2e-project | ||
| run: | | ||
| sed -i 's|"pulumi-pinecone-byoc\[azure\]"|"pulumi-pinecone-byoc[azure] @ file://'"$GITHUB_WORKSPACE"'"|' pyproject.toml | ||
| grep -q 'file://' pyproject.toml || { echo "ERROR: local source substitution failed"; exit 1; } | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./e2e-project | ||
| run: uv sync | ||
|
|
||
| - name: Cancel stale locks | ||
| working-directory: ./e2e-project | ||
| env: | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| run: pulumi cancel --yes --stack "$STACK_NAME" 2>/dev/null || true | ||
|
|
||
| - name: Pulumi destroy | ||
| working-directory: ./e2e-project | ||
| env: | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| run: pulumi destroy --yes --stack "$STACK_NAME" | ||
|
|
||
| - name: Pulumi stack rm | ||
| working-directory: ./e2e-project | ||
| env: | ||
| PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
| run: pulumi stack rm "$STACK_NAME" --yes --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.