From d4cf574be0c02ee0803574fe79ba3d4ae1075227 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:04:29 -0500 Subject: [PATCH 01/11] x --- .github/workflows/_test.yml | 57 ------------------- .../workflows/{langserve_ci.yml => ci.yml} | 22 ++++++- 2 files changed, 19 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/_test.yml rename .github/workflows/{langserve_ci.yml => ci.yml} (77%) diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml deleted file mode 100644 index 04be6a2c..00000000 --- a/.github/workflows/_test.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: test - -on: - workflow_call: - inputs: - working-directory: - required: true - type: string - description: "From which folder this pipeline executes" - -env: - POETRY_VERSION: "1.5.1" - -jobs: - build: - defaults: - run: - working-directory: ${{ inputs.working-directory }} - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.8" - - "3.9" - - "3.10" - - "3.11" - name: Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ matrix.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: core - - - name: Install dependencies - shell: bash - run: poetry install - - - name: Run core tests - shell: bash - run: make test - - - name: Ensure the tests did not create any additional files - shell: bash - run: | - set -eu - - STATUS="$(git status)" - echo "$STATUS" - - # grep will exit non-zero if the target message isn't found, - # and `set -e` above will cause the step to fail. - echo "$STATUS" | grep 'nothing to commit, working tree clean' diff --git a/.github/workflows/langserve_ci.yml b/.github/workflows/ci.yml similarity index 77% rename from .github/workflows/langserve_ci.yml rename to .github/workflows/ci.yml index 6eee23de..97e0545f 100644 --- a/.github/workflows/langserve_ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,7 @@ on: paths: - '.github/actions/poetry_setup/action.yml' - '.github/workflows/_lint.yml' - - '.github/workflows/_test.yml' - - '.github/workflows/langserve_ci.yml' + - '.github/workflows/ci.yml' - 'backend/**' workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI @@ -36,6 +35,7 @@ jobs: secrets: inherit test: + name: Python ${{ matrix.python-version }} tests timeout-minutes: 5 runs-on: ubuntu-latest defaults: @@ -48,8 +48,24 @@ jobs: - "3.9" - "3.10" - "3.11" - name: Python ${{ matrix.python-version }} tests + services: + # label used to access the service container + redis: + # ensure the image version matches the version using locally and on prod + image: redislabs/redisearch:latest + ports: + # maps tcp port 5432 on service container to the host + - 5432:5432 + # set health checks to wait until postgres has started + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - name: "Check redis is reachable" + run: redis-cli -h localhost -p 5432 ping - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} From f711cb944564b8ccf08ce90a0314c6599474fbe4 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:07:02 -0500 Subject: [PATCH 02/11] x --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97e0545f..fe3980ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,6 @@ jobs: secrets: inherit test: - name: Python ${{ matrix.python-version }} tests timeout-minutes: 5 runs-on: ubuntu-latest defaults: @@ -63,6 +62,7 @@ jobs: --health-timeout 5s --health-retries 5 + name: Python ${{ matrix.python-version }} tests steps: - name: "Check redis is reachable" run: redis-cli -h localhost -p 5432 ping From ebd3e7d162f3df35e2e1b8eccf8e35b7a476471e Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:08:25 -0500 Subject: [PATCH 03/11] x --- .github/workflows/ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe3980ea..b5040edd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,25 +47,8 @@ jobs: - "3.9" - "3.10" - "3.11" - services: - # label used to access the service container - redis: - # ensure the image version matches the version using locally and on prod - image: redislabs/redisearch:latest - ports: - # maps tcp port 5432 on service container to the host - - 5432:5432 - # set health checks to wait until postgres has started - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - name: Python ${{ matrix.python-version }} tests steps: - - name: "Check redis is reachable" - run: redis-cli -h localhost -p 5432 ping - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} From f561c409306ed10f17fc5117be9845981c87b3e9 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:09:22 -0500 Subject: [PATCH 04/11] x --- .github/workflows/_test.yml | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/_test.yml diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml new file mode 100644 index 00000000..04be6a2c --- /dev/null +++ b/.github/workflows/_test.yml @@ -0,0 +1,57 @@ +name: test + +on: + workflow_call: + inputs: + working-directory: + required: true + type: string + description: "From which folder this pipeline executes" + +env: + POETRY_VERSION: "1.5.1" + +jobs: + build: + defaults: + run: + working-directory: ${{ inputs.working-directory }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + name: Python ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" + with: + python-version: ${{ matrix.python-version }} + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: ${{ inputs.working-directory }} + cache-key: core + + - name: Install dependencies + shell: bash + run: poetry install + + - name: Run core tests + shell: bash + run: make test + + - name: Ensure the tests did not create any additional files + shell: bash + run: | + set -eu + + STATUS="$(git status)" + echo "$STATUS" + + # grep will exit non-zero if the target message isn't found, + # and `set -e` above will cause the step to fail. + echo "$STATUS" | grep 'nothing to commit, working tree clean' From 1db44c3e63bc5c14ea96fb2063a6d2dd9b7b28b1 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:09:28 -0500 Subject: [PATCH 05/11] x --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5040edd..6eee23de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,8 @@ on: paths: - '.github/actions/poetry_setup/action.yml' - '.github/workflows/_lint.yml' - - '.github/workflows/ci.yml' + - '.github/workflows/_test.yml' + - '.github/workflows/langserve_ci.yml' - 'backend/**' workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI From a4056aa2358a24a9fe5fa30129af711f16d48aaa Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:14:25 -0500 Subject: [PATCH 06/11] x --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6eee23de..74b27a6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ concurrency: env: POETRY_VERSION: "1.5.1" - WORKDIR: "backend/" + WORKDIR: "." jobs: lint: From 23a9d363ef01c1668b71984ec30b63db44659a06 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:17:47 -0500 Subject: [PATCH 07/11] x --- .github/workflows/_test.yml | 57 ------------------------------------- .github/workflows/ci.yml | 1 - 2 files changed, 58 deletions(-) delete mode 100644 .github/workflows/_test.yml diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml deleted file mode 100644 index 04be6a2c..00000000 --- a/.github/workflows/_test.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: test - -on: - workflow_call: - inputs: - working-directory: - required: true - type: string - description: "From which folder this pipeline executes" - -env: - POETRY_VERSION: "1.5.1" - -jobs: - build: - defaults: - run: - working-directory: ${{ inputs.working-directory }} - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.8" - - "3.9" - - "3.10" - - "3.11" - name: Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ matrix.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: core - - - name: Install dependencies - shell: bash - run: poetry install - - - name: Run core tests - shell: bash - run: make test - - - name: Ensure the tests did not create any additional files - shell: bash - run: | - set -eu - - STATUS="$(git status)" - echo "$STATUS" - - # grep will exit non-zero if the target message isn't found, - # and `set -e` above will cause the step to fail. - echo "$STATUS" | grep 'nothing to commit, working tree clean' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74b27a6e..e5105e50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: paths: - '.github/actions/poetry_setup/action.yml' - '.github/workflows/_lint.yml' - - '.github/workflows/_test.yml' - '.github/workflows/langserve_ci.yml' - 'backend/**' workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI From bf2e72a82156e194334c514d90a6869a5ee6d8f8 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:19:13 -0500 Subject: [PATCH 08/11] x --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5105e50..10ed8ab4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,14 +24,14 @@ concurrency: env: POETRY_VERSION: "1.5.1" - WORKDIR: "." + WORKDIR: "/backend" jobs: lint: uses: ./.github/workflows/_lint.yml with: - working-directory: ${{ env.WORKDIR }} + working-directory: "/backend" secrets: inherit test: From 378671fb992fa6d15a30346f4cc645735fe65cfa Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:20:03 -0500 Subject: [PATCH 09/11] x --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10ed8ab4..16d1d2d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,14 +24,14 @@ concurrency: env: POETRY_VERSION: "1.5.1" - WORKDIR: "/backend" + WORKDIR: "./backend" jobs: lint: uses: ./.github/workflows/_lint.yml with: - working-directory: "/backend" + working-directory: "./backend" secrets: inherit test: From a40d2c865014cf617086566f0808ba4b7f341814 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:21:23 -0500 Subject: [PATCH 10/11] x --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16d1d2d3..0360071c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,8 +62,8 @@ jobs: - name: Install dependencies shell: bash run: | - echo "Running extended tests, installing dependencies with poetry..." - poetry install --with test,lint --extras all + echo "Running tests, installing dependencies with poetry..." + poetry install --with test,lint - name: Run tests run: make test From 3c9801ee8c0463d4e5c1327d5152be3b4e2c4b0b Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:24:27 -0500 Subject: [PATCH 11/11] x --- backend/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Makefile b/backend/Makefile index 5afa0ce3..62897287 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -11,7 +11,7 @@ all: help TEST_FILE ?= tests/unit_tests/ test: - poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE) + poetry run pytest $(TEST_FILE) test_watch: poetry run ptw . -- $(TEST_FILE)