Skip to content

Commit

Permalink
chore(ci): simplify CI
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousben committed Nov 21, 2024
1 parent 0ad2623 commit 8a4ea5d
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 147 deletions.
105 changes: 0 additions & 105 deletions .github/workflows/test.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Acceptance Tests
name: Tests

on:
push:
Expand All @@ -11,14 +11,24 @@ on:
paths:
- 'server/**'
- 'python-sdk/**'
- '.github/workflows/acceptance_tests.yaml'
- '.github/workflows/tests.yaml'

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build
lint_server:
name: Lint Indexify Server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint indexify-server
run: |
cd server
make check
build_server:
name: Build Indexify Server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -29,19 +39,54 @@ jobs:
with:
cache-directories: |
server/target
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-directories: |
server/target
- name: Build indexify-server
run: |
cd server
cargo build
- name: Lint indexify-server
run: |
cd server
make check
- name: Test indexify-server
run: |
cd server
cargo test --workspace -- --test-threads 1
- name: Upload indexify-server
uses: actions/upload-artifact@v4
with:
name: indexify-server
path: server/target/debug/indexify-server

lint_python_sdk:
name: Lint Indexify Python SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'poetry'
- name: Install python dependencies
run: |
cd python-sdk
poetry install
- name: Lint python-sdk
run: |
cd python-sdk
make check
acceptance_tests:
name: Run Acceptance Tests
needs: build
needs: [build_server, lint_python_sdk]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -60,6 +105,10 @@ jobs:
run: |
cd python-sdk
poetry install
- name: Lint python-sdk
run: |
cd python-sdk
make check
- name: Start Background Indexify Server
uses: JarvusInnovations/background-action@v1
with:
Expand Down Expand Up @@ -131,7 +180,7 @@ jobs:
last_release_acceptance_tests:
name: 'Last Release Acceptance Tests (trigger with label: ci_compat_test)'
if: contains(github.event.pull_request.labels.*.name, 'ci_compat_test')
needs: build
needs: [build_server, lint_python_sdk]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: UI

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
paths:
- 'server/ui/**'
- '.github/workflows/tests_ui.yaml'

jobs:
lint:
name: Lint Checks
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
if: ${{ needs.changes.outputs.ui == 'true' }}
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Npm Install
if: ${{ needs.changes.outputs.ui == 'true' }}
run: cd server/ui && npm ci

- name: UI Lint Check
if: ${{ needs.changes.outputs.ui == 'true' }}
run: cd server/ui && npm run lint
12 changes: 6 additions & 6 deletions python-sdk/indexify/functions_sdk/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def add_node(
return self

if issubclass(indexify_fn, IndexifyFunction) and indexify_fn.accumulate:
self.accumulator_zero_values[
indexify_fn.name
] = indexify_fn.accumulate().model_dump()
self.accumulator_zero_values[indexify_fn.name] = (
indexify_fn.accumulate().model_dump()
)

self.nodes[indexify_fn.name] = indexify_fn
return self
Expand Down Expand Up @@ -244,9 +244,9 @@ def _run(
queue = deque([(self._start_node, initial_input)])
while queue:
node_name, input = queue.popleft()
function_outputs: Union[
FunctionCallResult, RouterCallResult
] = self._invoke_fn(node_name, input)
function_outputs: Union[FunctionCallResult, RouterCallResult] = (
self._invoke_fn(node_name, input)
)
self._log_local_exec_tracebacks(function_outputs)
if isinstance(function_outputs, RouterCallResult):
for edge in function_outputs.edges:
Expand Down
22 changes: 13 additions & 9 deletions python-sdk/indexify/functions_sdk/indexify_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ def run(self, *args, **kwargs):

attrs = {
"name": name if name else fn.__name__,
"description": description
if description
else (fn.__doc__ or "").strip().replace("\n", ""),
"description": (
description
if description
else (fn.__doc__ or "").strip().replace("\n", "")
),
"image": image,
"placement_constraints": placement_constraints,
"encoder": encoder,
Expand Down Expand Up @@ -174,9 +176,11 @@ def run(self, *args, **kwargs):

attrs = {
"name": name if name else fn.__name__,
"description": description
if description
else (fn.__doc__ or "").strip().replace("\n", ""),
"description": (
description
if description
else (fn.__doc__ or "").strip().replace("\n", "")
),
"image": image,
"placement_constraints": placement_constraints,
"accumulate": accumulate,
Expand Down Expand Up @@ -205,9 +209,9 @@ def __init__(
indexify_function: Union[IndexifyFunction, IndexifyRouter],
context: GraphInvocationContext,
):
self.indexify_function: Union[
IndexifyFunction, IndexifyRouter
] = indexify_function()
self.indexify_function: Union[IndexifyFunction, IndexifyRouter] = (
indexify_function()
)
self.indexify_function._ctx = context

def get_output_model(self) -> Any:
Expand Down
Loading

0 comments on commit 8a4ea5d

Please sign in to comment.