forked from danswer-ai/danswer
-
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 #55 from mindvalley/chore/merge-upstream-2024091301
chore/merge upstream 2024091301
- Loading branch information
Showing
340 changed files
with
12,016 additions
and
4,178 deletions.
There are no files selected for viewing
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,76 @@ | ||
name: 'Build and Push Docker Image with Retry' | ||
description: 'Attempts to build and push a Docker image, with a retry on failure' | ||
inputs: | ||
context: | ||
description: 'Build context' | ||
required: true | ||
file: | ||
description: 'Dockerfile location' | ||
required: true | ||
platforms: | ||
description: 'Target platforms' | ||
required: true | ||
pull: | ||
description: 'Always attempt to pull a newer version of the image' | ||
required: false | ||
default: 'true' | ||
push: | ||
description: 'Push the image to registry' | ||
required: false | ||
default: 'true' | ||
load: | ||
description: 'Load the image into Docker daemon' | ||
required: false | ||
default: 'true' | ||
tags: | ||
description: 'Image tags' | ||
required: true | ||
cache-from: | ||
description: 'Cache sources' | ||
required: false | ||
cache-to: | ||
description: 'Cache destinations' | ||
required: false | ||
retry-wait-time: | ||
description: 'Time to wait before retry in seconds' | ||
required: false | ||
default: '5' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Build and push Docker image (First Attempt) | ||
id: buildx1 | ||
uses: docker/build-push-action@v5 | ||
continue-on-error: true | ||
with: | ||
context: ${{ inputs.context }} | ||
file: ${{ inputs.file }} | ||
platforms: ${{ inputs.platforms }} | ||
pull: ${{ inputs.pull }} | ||
push: ${{ inputs.push }} | ||
load: ${{ inputs.load }} | ||
tags: ${{ inputs.tags }} | ||
cache-from: ${{ inputs.cache-from }} | ||
cache-to: ${{ inputs.cache-to }} | ||
|
||
- name: Wait to retry | ||
if: steps.buildx1.outcome != 'success' | ||
run: | | ||
echo "First attempt failed. Waiting ${{ inputs.retry-wait-time }} seconds before retry..." | ||
sleep ${{ inputs.retry-wait-time }} | ||
shell: bash | ||
|
||
- name: Build and push Docker image (Retry Attempt) | ||
if: steps.buildx1.outcome != 'success' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ inputs.context }} | ||
file: ${{ inputs.file }} | ||
platforms: ${{ inputs.platforms }} | ||
pull: ${{ inputs.pull }} | ||
push: ${{ inputs.push }} | ||
load: ${{ inputs.load }} | ||
tags: ${{ inputs.tags }} | ||
cache-from: ${{ inputs.cache-from }} | ||
cache-to: ${{ inputs.cache-to }} |
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,67 @@ | ||
# This workflow is intentionally disabled while we're still working on it | ||
# It's close to ready, but a race condition needs to be fixed with | ||
# API server and Vespa startup, and it needs to have a way to build/test against | ||
# local containers | ||
|
||
name: Helm - Lint and Test Charts | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint-test: | ||
runs-on: Amd64 | ||
|
||
# fetch-depth 0 is required for helm/chart-testing-action | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v4.2.0 | ||
with: | ||
version: v3.14.4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
backend/requirements/default.txt | ||
backend/requirements/dev.txt | ||
backend/requirements/model_server.txt | ||
- run: | | ||
python -m pip install --upgrade pip | ||
pip install -r backend/requirements/default.txt | ||
pip install -r backend/requirements/dev.txt | ||
pip install -r backend/requirements/model_server.txt | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@v2.6.1 | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
|
||
- name: Run chart-testing (lint) | ||
# if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --all --config ct.yaml --target-branch ${{ github.event.repository.default_branch }} | ||
|
||
- name: Create kind cluster | ||
# if: steps.list-changed.outputs.changed == 'true' | ||
uses: helm/kind-action@v1.10.0 | ||
|
||
- name: Run chart-testing (install) | ||
# if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --all --config ct.yaml | ||
# run: ct install --target-branch ${{ github.event.repository.default_branch }} | ||
|
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,57 @@ | ||
name: Connector Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
# This cron expression runs the job daily at 16:00 UTC (9am PT) | ||
- cron: "0 16 * * *" | ||
|
||
env: | ||
# Confluence | ||
CONFLUENCE_TEST_SPACE_URL: ${{ secrets.CONFLUENCE_TEST_SPACE_URL }} | ||
CONFLUENCE_TEST_SPACE: ${{ secrets.CONFLUENCE_TEST_SPACE }} | ||
CONFLUENCE_IS_CLOUD: ${{ secrets.CONFLUENCE_IS_CLOUD }} | ||
CONFLUENCE_TEST_PAGE_ID: ${{ secrets.CONFLUENCE_TEST_PAGE_ID }} | ||
CONFLUENCE_USER_NAME: ${{ secrets.CONFLUENCE_USER_NAME }} | ||
CONFLUENCE_ACCESS_TOKEN: ${{ secrets.CONFLUENCE_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
connectors-check: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
PYTHONPATH: ./backend | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
cache-dependency-path: | | ||
backend/requirements/default.txt | ||
backend/requirements/dev.txt | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r backend/requirements/default.txt | ||
pip install -r backend/requirements/dev.txt | ||
- name: Run Tests | ||
shell: script -q -e -c "bash --noprofile --norc -eo pipefail {0}" | ||
run: py.test -o junit_family=xunit2 -xv --ff backend/tests/daily/connectors | ||
|
||
- name: Alert on Failure | ||
if: failure() && github.event_name == 'schedule' | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
run: | | ||
curl -X POST \ | ||
-H 'Content-type: application/json' \ | ||
--data '{"text":"Scheduled Connector Tests failed! Check the run at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' \ | ||
$SLACK_WEBHOOK |
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
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
Oops, something went wrong.