-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multinode-HA Vespa Setup for Local Testing (#1071)
Co-authored-by: yihanzhao <yihan@marqo.ai>
- Loading branch information
Showing
32 changed files
with
1,740 additions
and
328 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Runs unit tests on 4 cases: | ||
# 1. single node vespa | ||
# 2. multinode vespa: 1 shard, 1 replica | ||
# 3. multinode vespa: 2 shard, 0 replicas | ||
# 4. multinode vespa: 2 shards, 1 replicas | ||
# Runs only once on PR approval | ||
|
||
name: Unit Tests with Shards and Replicas | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request_review: | ||
types: [submitted] | ||
branches: | ||
- mainline | ||
- 'releases/*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
Unit-Tests-1-Shard-0-Replica: | ||
uses: ./.github/workflows/unit_test_200gb_CI.yml | ||
secrets: inherit | ||
if: github.event_name == 'workflow_dispatch' || github.event.review.state == 'approved' | ||
with: | ||
number_of_shards: 1 | ||
number_of_replicas: 0 | ||
|
||
Unit-Tests-1-Shard-1-Replica: | ||
uses: ./.github/workflows/unit_test_200gb_CI.yml | ||
secrets: inherit | ||
if: github.event_name == 'workflow_dispatch' || github.event.review.state == 'approved' | ||
with: | ||
number_of_shards: 1 | ||
number_of_replicas: 1 | ||
|
||
Unit-Tests-2-Shard-0-Replica: | ||
uses: ./.github/workflows/unit_test_200gb_CI.yml | ||
secrets: inherit | ||
if: github.event_name == 'workflow_dispatch' || github.event.review.state == 'approved' | ||
with: | ||
number_of_shards: 2 | ||
number_of_replicas: 0 | ||
|
||
Unit-Tests-2-Shard-1-Replica: | ||
uses: ./.github/workflows/unit_test_200gb_CI.yml | ||
secrets: inherit | ||
if: github.event_name == 'workflow_dispatch' || github.event.review.state == 'approved' | ||
with: | ||
number_of_shards: 2 | ||
number_of_replicas: 1 |
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
Empty file.
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,58 @@ | ||
# Setting up Vespa locally | ||
When running Marqo or the unit test suite locally, a Vespa node or cluster needs to be running. To assist with this, | ||
this directory comes with scripts to set up either a single node (1 container) or multinode-HA Vespa on your machine. | ||
|
||
### Set Vespa version | ||
- By default, this script will use Vespa 8.431.32, as defined in `vespa_local.py`. To change it, set the `VESPA_VERSION` | ||
variable to the desired version. For example: | ||
```commandline | ||
export VESPA_VERSION="latest" | ||
``` | ||
## Single Node Vespa (default & recommended) | ||
- Runs 1 Vespa container on your machine. This serves as the config, api, and content node. | ||
- This is equivalent to running Vespa with 0 replicas and 1 shard. | ||
- Start with this command: | ||
```commandline | ||
python vespa_local.py start | ||
``` | ||
- This will run the Vespa docker container then copy the `services.xml` file from the `singlenode/` directory to | ||
this directory. This will be bundled into the Vespa application upon deployment. | ||
|
||
## Multi-node Vespa | ||
- Runs a Vespa cluster with the following nodes: | ||
- 3 config nodes | ||
- `m` content nodes, where `m` is `number_of_shards * (1 + number_of_replicas)` | ||
- `n` API nodes, where `n` is `max(2, number_of_content_nodes)` | ||
- For example, with 2 shards and 1 replica, it will run 4 content nodes and 2 API nodes. | ||
- Start with this command: | ||
```commandline | ||
python vespa_local.py start --Shards 2 --Replicas 1 | ||
``` | ||
|
||
## Deployment | ||
- After starting the Vespa node(s), you can deploy the Vespa application with the files in this directory using: | ||
```commandline | ||
python vespa_local.py deploy-config | ||
``` | ||
- For single node, you can check for readiness using: | ||
``` | ||
curl -s http://localhost:19071/state/v1/health | ||
``` | ||
- For multi-node, the start script will output a list of URLs corresponding to the API and content nodes. | ||
You can curl each one to check for readiness. | ||
|
||
## Other Commands | ||
### Stop Vespa | ||
```commandline | ||
python vespa_local.py stop | ||
``` | ||
### Restart Vespa | ||
```commandline | ||
python vespa_local.py restart | ||
``` | ||
|
||
## Notes | ||
- When running other commands in this script (stop, restart), it will check for the presence of a container named | ||
`vespa`, and will assume setup is single node if it finds one. If not, it will assume setup is multi-node. | ||
- For multi-node, expect config and API nodes to take ~1gb of memory, while content nodes take ~500mb each. Adjust your | ||
resource allotment accordingly. |
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.