-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from nulib/prototype-opensearch-vectors
Add chat search to API using OpenSearch
- Loading branch information
Showing
170 changed files
with
1,625 additions
and
189 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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,53 @@ | ||
name: Build and deploy API documentation | ||
on: | ||
push: | ||
branches: | ||
- deploy/staging | ||
- main | ||
paths: | ||
- .github/workflows/docs.yaml | ||
- docs/* | ||
workflow_dispatch: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
jobs: | ||
publish-docs: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }} | ||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@master | ||
with: | ||
role-to-assume: arn:aws:iam::${{ secrets.AwsAccount }}:role/github-actions-role | ||
aws-region: us-east-1 | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: 1.4.2 | ||
- name: Install dependencies | ||
run: poetry install | ||
working-directory: ./docs | ||
- name: Build docs | ||
run: poetry run mkdocs build --clean | ||
working-directory: ./docs | ||
- name: Determine correct deploy domain for environment | ||
run: sed -i s/API_HOST/${HOSTNAME}/g docs/site/spec/openapi.* | ||
env: | ||
HOSTNAME: ${{ secrets.Hostname }}.${{ secrets.HostedZone }} | ||
- name: Generate JSON API | ||
uses: openapi-generators/openapitools-generator-action@v1 | ||
with: | ||
generator: openapi | ||
openapi-file: docs/site/spec/openapi.yaml | ||
command-args: -o docs/site/spec | ||
- name: Copy to S3 | ||
run: aws s3 sync --delete docs/site/ s3://${HOST}-docs.${ZONE}/ | ||
env: | ||
HOST: ${{ secrets.Hostname }} | ||
ZONE: ${{ secrets.HostedZone }} |
This file contains 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,30 @@ | ||
name: Run NodeJS Tests | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/test-node.yml" | ||
- "node/**" | ||
workflow_dispatch: | ||
defaults: | ||
run: | ||
working-directory: ./node | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
AWS_ACCESS_KEY_ID: ci | ||
AWS_SECRET_ACCESS_KEY: ci | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: "npm" | ||
cache-dependency-path: 'node/package-lock.json' | ||
- run: npm ci | ||
- name: Check code style | ||
run: npm run lint && npm run prettier | ||
- name: Run tests | ||
run: npm run test:coverage | ||
- name: Validate OpenAPI spec | ||
run: npm run validate-spec |
This file contains 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,31 @@ | ||
name: Run Python Tests | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/test-python.yml" | ||
- "chat/**" | ||
workflow_dispatch: | ||
defaults: | ||
run: | ||
working-directory: ./chat | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
AWS_ACCESS_KEY_ID: ci | ||
AWS_SECRET_ACCESS_KEY: ci | ||
SKIP_WEAVIATE_SETUP: 'True' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
cache-dependency-path: chat/src/requirements.txt | ||
- run: pip install -r requirements.txt | ||
working-directory: ./chat/src | ||
- name: Check code style | ||
run: ruff check . | ||
- name: Run tests | ||
run: | | ||
coverage run --include='src/**/*' -m unittest | ||
coverage report |
This file contains 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,28 @@ | ||
name: Validate Template | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/validate-template.yml" | ||
- "./template.yml" | ||
workflow_dispatch: | ||
jobs: | ||
validate-template: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
environment: test | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- uses: aws-actions/setup-sam@v1 | ||
- name: sam fix https://github.com/aws/aws-sam-cli/issues/4527 | ||
run: $(dirname $(readlink $(which sam)))/pip install --force-reinstall "cryptography==38.0.4" | ||
- uses: aws-actions/configure-aws-credentials@master | ||
with: | ||
role-to-assume: arn:aws:iam::${{ secrets.AwsAccount }}:role/github-actions-role | ||
aws-region: us-east-1 | ||
- uses: actions/checkout@v3 | ||
- name: Validate template | ||
run: sam build && sam validate |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run lint && npm run prettier | ||
cd node && npm run lint && npm run prettier && cd - | ||
cd chat/src && ruff check . && cd - |
This file contains 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
nodejs 16.14.0 | ||
java corretto-19.0.1.10.1 | ||
aws-sam-cli 1.107.0 | ||
python 3.10.5 |
Oops, something went wrong.