Skip to content
Merged
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
57 changes: 57 additions & 0 deletions .github/actions/test-data-plane/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Test Data Plane'
description: 'Runs tests on the Pinecone data plane'

# - pod vs serverless
# - grpc vs rest
# - metric -> vector vs sparse vector
# - namespace: default vs custom
# - environment: free vs paid
# - with metadata vs without metadata

inputs:
metric:
description: 'The metric of the index'
required: true
spec:
description: 'The deploy spec of the index'
required: true
use_grpc:
description: 'Whether to use gRPC or REST'
required: true
freshness_timeout_seconds:
description: 'The number of seconds to wait for the index to become fresh'
required: false
default: '60'
PINECONE_API_KEY:
description: 'The Pinecone API key'
required: true

outputs:
index_name:
description: 'The name of the index, including randomized suffix'
value: ${{ steps.create-index.outputs.index_name }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this referring to a different create-index step that's present in this action, or is it assuming it's been run prior? It's working properly so I'm just going to assume the scope for steps.<whatever> is global to the whole workflow. 😅

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this outputs declaration is just accidental copy/pasta from the create-index action I made earlier this week for dependency testing purposes so it can be removed. If I wanted to use it I could by having my test suite write the name of the index it creates to the GITHUB_OUTPUT location (see here in script used by create-index action) but in this case it's not needed since the test creates and deletes the index.


runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Setup Poetry
uses: ./.github/actions/setup-poetry
with:
include_grpc: ${{ inputs.use_grpc }}
include_dev: 'true'

- name: Run data plane tests
id: data-plane-tests
shell: bash
run: poetry run pytest tests/integration/data
env:
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
USE_GRPC: ${{ inputs.use_grpc }}
METRIC: ${{ inputs.metric }}
SPEC: ${{ inputs.spec }}
FRESHNESS_TIMEOUT_SECONDS: ${{ inputs.freshness_timeout_seconds }}
16 changes: 10 additions & 6 deletions .github/workflows/alpha-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ on:
default: 'rc1'

jobs:
testing-rest:
uses: './.github/workflows/testing-rest.yaml'
unit-tests:
uses: './.github/workflows/testing-unit.yaml'
secrets: inherit
testing-grpc:
uses: './.github/workflows/testing-grpc.yaml'
integration-tests:
uses: './.github/workflows/testing-integration.yaml'
secrets: inherit
dependency-tests:
uses: './.github/workflows/testing-dependency.yaml'
secrets: inherit

pypi:
uses: './.github/workflows/publish-to-pypi.yaml'
needs:
- testing-rest
- testing-grpc
- unit-tests
- integration-tests
- dependency-tests
with:
isPrerelease: true
ref: ${{ inputs.ref }}
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ on:
- cron: '0 0 * * *'

jobs:
testing-rest:
uses: './.github/workflows/testing-rest.yaml'
unit-tests:
uses: './.github/workflows/testing-unit.yaml'
secrets: inherit
testing-grpc:
uses: './.github/workflows/testing-grpc.yaml'
integration-tests:
uses: './.github/workflows/testing-integration.yaml'
secrets: inherit
dependency-tests:
uses: './.github/workflows/testing-dependency.yaml'
secrets: inherit

pypi-nightly:
needs:
- testing-rest
- testing-grpc
- unit-tests
- integration-tests
- dependency-tests
timeout-minutes: 30
name: pypi-nightly
runs-on: ubuntu-latest
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
workflow_dispatch: {}

jobs:
run-tests-rest:
uses: './.github/workflows/testing-rest.yaml'
unit-tests:
uses: './.github/workflows/testing-unit.yaml'
secrets: inherit
run-tests-grpc:
uses: './.github/workflows/testing-grpc.yaml'
integration-tests:
uses: './.github/workflows/testing-integration.yaml'
secrets: inherit
dependency-tests:
uses: './.github/workflows/testing-dependency.yaml'
secrets: inherit
package:
name: Check packaging
Expand All @@ -31,8 +34,6 @@ jobs:
- name: Package
run: poetry build



build-docs:
name: Build docs with pdoc
runs-on: ubuntu-latest
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ on:
- 'major' # breaking changes

jobs:
testing-rest:
uses: './.github/workflows/testing-rest.yaml'
unit-tests:
uses: './.github/workflows/testing-unit.yaml'
secrets: inherit
testing-grpc:
uses: './.github/workflows/testing-grpc.yaml'
integration-tests:
uses: './.github/workflows/testing-integration.yaml'
secrets: inherit
dependency-tests:
uses: './.github/workflows/testing-dependency.yaml'
secrets: inherit

pypi:
uses: './.github/workflows/publish-to-pypi.yaml'
needs:
- testing-rest
- testing-grpc
- unit-tests
- integration-tests
- dependency-tests
with:
isPrerelease: false
ref: ${{ inputs.ref }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,11 @@
name: Testing GRPC
name: Dependency Testing

on:
workflow_call: {}

jobs:
units-grpc:
name: Unit tests (GRPC)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
uses: ./.github/actions/setup-poetry
with:
include_grpc: true

- name: Run unit tests (GRPC)
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit_grpc

- name: mypy check
run: |
# Still lots of errors when running on the whole package (especially
# in the generated core module), but we can check these subpackages
# so we don't add new regressions.
poetry run mypy pinecone --exclude pinecone/core

dependency-matrix-grpc-setup:
name: Deps setup (GRPC)
dependency-matrix-setup:
name: Deps setup
runs-on: ubuntu-latest
outputs:
index_name: ${{ steps.setup-index.outputs.index_name }}
Expand All @@ -46,13 +16,13 @@ jobs:
uses: ./.github/actions/create-index
timeout-minutes: 5
with:
name_prefix: depstest-grpc-${{ github.run_number }}
name_prefix: depstest-${{ github.run_number }}
dimension: 2
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}

dependency-matrix-grpc:
name: Deps (GRPC)
needs: dependency-matrix-grpc-setup
needs: dependency-matrix-setup
runs-on: ubuntu-latest
strategy:
max-parallel: 5
Expand Down Expand Up @@ -124,5 +94,49 @@ jobs:
command: poetry run pytest tests/dependency/grpc -s -v
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
INDEX_NAME: ${{ needs.dependency-matrix-grpc-setup.outputs.index_name }}

INDEX_NAME: ${{ needs.dependency-matrix-setup.outputs.index_name }}




dependency-matrix-rest:
name: Deps (REST)
runs-on: ubuntu-latest
needs: dependency-matrix-setup
strategy:
max-parallel: 5
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
- '3.10'
- 3.11
Comment on lines +111 to +114

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything but 3.8 is commented out in dependency-matrix-grpc, is that intentional?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, not exactly. Mainly just trying to save some time and resources while iterating. I should bring them back on the grpc job.

urllib3-version:
- 1.26.0
- 1.26.18
- 2.0.2
- 2.0.5
- 2.1.0
steps:
- uses: actions/checkout@v4
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python-version }}'
- name: Setup Poetry
uses: ./.github/actions/setup-poetry
with:
include_grpc: false
include_types: false
- name: 'Install urllib3 ${{ matrix.urllib3-version }}'
run: 'poetry add urllib3==${{ matrix.urllib3-version }}'
- uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
retry_on: error
command: poetry run pytest tests/dependency/rest -s -v
env:
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
INDEX_NAME: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
91 changes: 91 additions & 0 deletions .github/workflows/testing-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: "Integration Tests"
'on':
workflow_call: {}

jobs:
data-plane-serverless:
name: Data plane serverless integration tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
use_grpc: [true, false]
metric:
- cosine
# - euclidean
# - dotproduct
Comment on lines +15 to +16

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming you want to keep these commented out for now, but if not.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, leaving them out while still fleshing out the tests and iterating heavily. Dotproduct is having some kind of performance issue at the moment the db team are looking into.

spec:
- '{ "serverless": { "region": "us-west-2", "cloud": "aws" }}'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test-data-plane
with:
use_grpc: '${{ matrix.use_grpc }}'
metric: '${{ matrix.metric }}'
spec: '${{ matrix.spec }}'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
freshness_timeout_seconds: 600

# data-plane-pod:
# name: Data plane pod integration tests
# runs-on: ubuntu-latest
# strategy:
# max-parallel: 1
# matrix:
# use_grpc: [true, false]
# metric: [cosine, dotproduct]
# spec:
# - '{ "pod": { "environment": "us-east1-gcp", "pod_type": "p1" }}'
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/test-data-plane
# with:
# use_grpc: '${{ matrix.use_grpc }}'
# metric: '${{ matrix.metric }}'
# spec: '${{ matrix.spec }}'
# PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'

control-rest:
name: control plane
runs-on: ubuntu-latest
strategy:
matrix:
pineconeEnv:
- prod
testConfig:
- python-version: 3.8 # Do one test run with 3.8 for sanity check
pod: { environment: 'us-east1-gcp'}
serverless: { cloud: 'aws', region: 'us-west-2'}
- python-version: 3.11
pod: { environment: 'us-east1-gcp'}
serverless: { cloud: 'aws', region: 'us-west-2'}
max-parallel: 1
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: 'Set up Python ${{ matrix.testConfig.python-version }}'
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.testConfig.python-version }}'
- name: Setup Poetry
uses: ./.github/actions/setup-poetry
- name: 'Run integration tests (REST, prod)'
if: matrix.pineconeEnv == 'prod'
run: poetry run pytest tests/integration/control -s -v
env:
PINECONE_CONTROLLER_HOST: 'https://api.pinecone.io'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
GITHUB_BUILD_NUMBER: '${{ github.run_number }}-p-${{ matrix.testConfig.python-version}}'
POD_ENVIRONMENT: '${{ matrix.testConfig.pod.environment }}'
SERVERLESS_CLOUD: '${{ matrix.testConfig.serverless.cloud }}'
SERVERLESS_REGION: '${{ matrix.testConfig.serverless.region }}'
- name: 'Run integration tests (REST, staging)'
if: matrix.pineconeEnv == 'staging'
run: poetry run pytest tests/integration -s -v
env:
PINECONE_CONTROLLER_HOST: 'https://api-staging.pinecone.io'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY_STAGING }}'
GITHUB_BUILD_NUMBER: '${{ github.run_number }}-s-${{ matrix.testConfig.python-version}}'
POD_ENVIRONMENT: '${{ matrix.testConfig.pod.environment }}'
SERVERLESS_CLOUD: '${{ matrix.testConfig.serverless.cloud }}'
SERVERLESS_REGION: '${{ matrix.testConfig.serverless.region }}'
Loading