Skip to content

Commit 2e1dce7

Browse files
authored
Support ARM in CI (NVIDIA#73)
* Run the test CI stage on both Amd64 and Arm64. * Document installing QEMU to run CI for Arm64 on an Amd64 system. * Disable `examples/simple/tests/test_web_query_tool.py` test on Arm due to a known issue with Faiss NVIDIA#72 Requires NVIDIA#59 to be merged first ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) URL: NVIDIA#73
1 parent 69508ae commit 2e1dce7

File tree

6 files changed

+48
-8
lines changed

6 files changed

+48
-8
lines changed

.github/workflows/ci_pipe.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ jobs:
8080
test:
8181
name: Test
8282
needs: [check]
83-
runs-on: linux-amd64-cpu4
83+
runs-on: linux-${{ matrix.arch }}-cpu4
8484
timeout-minutes: 30
8585
container:
8686
image: ${{ inputs.container }}
8787
strategy:
8888
fail-fast: true
89+
matrix:
90+
arch: ["amd64", "arm64"]
8991

9092
steps:
9193
- name: Checkout
@@ -94,7 +96,7 @@ jobs:
9496
fetch-tags: true
9597
path: 'agentiq'
9698

97-
- name: Test:linux
99+
- name: Test:linux:${{ matrix.arch }}
98100
shell: bash
99101
run: ./agentiq/ci/scripts/github/tests.sh
100102

@@ -103,7 +105,7 @@ jobs:
103105
# Upload test results even if the tests fail
104106
if: ${{ always() }}
105107
with:
106-
name: "test-results"
108+
name: "test-results-${{ matrix.arch }}"
107109
path: "${{ github.workspace }}/tmp/*.xml"
108110
if-no-files-found: error
109111

@@ -152,6 +154,7 @@ jobs:
152154
- name: Checkout
153155
uses: actions/checkout@v4
154156
with:
157+
fetch-depth: 0
155158
fetch-tags: true
156159
path: 'agentiq'
157160

ci/scripts/run_ci_local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ GIT_COMMIT=$(git log -n 1 --pretty=format:%H)
5353
# Specifies whether to mount the current git repo or to use a clean clone (the default)
5454
USE_HOST_GIT=${USE_HOST_GIT:-0}
5555

56-
LOCAL_CI_TMP=${LOCAL_CI_TMP:-${AGENTIQ_ROOT}/.tmp/local_ci_tmp}
56+
LOCAL_CI_TMP=${LOCAL_CI_TMP:-${AGENTIQ_ROOT}/.tmp/local_ci_tmp/${CI_ARCH}}
5757
DOCKER_EXTRA_ARGS=${DOCKER_EXTRA_ARGS:-""}
5858

5959
CI_CONTAINER=${CI_CONTAINER:-"ghcr.io/astral-sh/uv:python3.12-bookworm"}

ci/vale/styles/config/vocabularies/aiq/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ DB(s?)
4747
[Ee]ngineerable
4848
[Ee]val
4949
[Ee]xplainability
50+
Faiss
5051
[Gg]eneratable
5152
glog
5253
GPU(s?)

docs/source/advanced/running-ci-locally.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,37 @@ From this point you can manually copy/paste the commands which would normally be
5757

5858
| Name | Description | Location |
5959
|--|--|--|
60-
| Artifacts | Test results, wheels, and documentation | `.tmp/local_ci_tmp/local_ci_workspace` |
61-
| Cache | `uv` and `pre-commit` package caches | `.tmp/local_ci_tmp/cache` |
62-
| Virtual Environment | Python virtual environment | `.tmp/local_ci_tmp/local_ci_workspace/.venv` |
63-
| Bootstrap Script | The script used to bootstrap the CI environment within the CI container | `.tmp/local_ci_tmp/bootstrap_local_ci.sh` |
60+
| Artifacts | Test results, wheels, and documentation | `.tmp/local_ci_tmp/<arch>local_ci_workspace` |
61+
| Cache | `uv` and `pre-commit` package caches | `.tmp/local_ci_tmp/<arch>cache` |
62+
| Virtual Environment | Python virtual environment | `.tmp/local_ci_tmp/<arch>local_ci_workspace/.venv` |
63+
| Bootstrap Script | The script used to bootstrap the CI environment within the CI container | `.tmp/local_ci_tmp/<arch>bootstrap_local_ci.sh` |
64+
65+
Where `<arch>` is the architecture of the host machine at time of writing this will be either `amd64` or `arm64`.
6466

6567
> Note: In some situations it may be necessary to delete the `.tmp/local_ci_tmp` directory to clear out old artifacts and caches. This is especially true if you are switching between branches or if you are running into issues with the CI pipeline.
68+
69+
## Multi-Architecture CI
70+
To run the CI pipeline on a different architecture other than your own, QEMU can be used to emulate the target architecture.
71+
72+
> Note: This assumes you have an amd64 system and want to run the CI pipeline on arm64. If you are using an arm64 and want to emulate amd64, you will need to adjust the commands accordingly.
73+
74+
On an apt based system, this can be done with the following commands:
75+
```bash
76+
sudo apt install qemu-utils qemu-system-arm qemu-user-static
77+
```
78+
79+
Register QEMU with Docker:
80+
```bash
81+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
82+
```
83+
84+
Verify that the registration was successful:
85+
```bash
86+
docker run --platform=linux/arm64 --rm -t ubuntu:noble uname -m
87+
```
88+
89+
### Run CI on arm64
90+
The `CI_ARCH` environment variable can be set to the desired architecture to run CI, for example to run the CI pipeline on arm64, you can use the following command:
91+
```bash
92+
CI_ARCH=arm64 ./ci/scripts/run_ci_local.sh all
93+
```

docs/source/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ This is the first general release of AgentIQ.
3030
- LlamaIndex
3131

3232
## Known Issues
33+
- Faiss is currently broken on Arm64. This is a known issue [#72](https://github.com/NVIDIA/AgentIQ/issues/72) caused by an upstream bug in the Faiss library [https://github.com/facebookresearch/faiss/issues/3936](https://github.com/facebookresearch/faiss/issues/3936).
3334
- AgentIQ applications must use the same name for both the distribution and root package. This is a current implementation limitation and will be addressed in a future release.
3435
- Refer to [https://github.com/NVIDIA/AgentIQ/issues](https://github.com/NVIDIA/AgentIQ/issues) for an up to date list of current issues.

examples/simple/tests/test_web_query_tool.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
import platform
17+
18+
import pytest
1619
from aiq_simple.register import WebQueryToolConfig
1720

1821
from aiq.builder.workflow_builder import WorkflowBuilder
1922
from aiq.test.embedder import EmbedderTestConfig
2023

2124

25+
@pytest.mark.skipif(platform.machine() == "aarch64",
26+
reason="faiss not working on arm64 https://github.com/NVIDIA/AgentIQ/issues/72")
2227
async def test_web_query_config():
2328

2429
config = WebQueryToolConfig(webpage_url="https://www.google.com",
@@ -36,6 +41,8 @@ async def test_web_query_config():
3641
assert fn.description == config.description
3742

3843

44+
@pytest.mark.skipif(platform.machine() == "aarch64",
45+
reason="faiss not working on arm64 https://github.com/NVIDIA/AgentIQ/issues/72")
3946
async def test_web_query_tool():
4047

4148
config = WebQueryToolConfig(webpage_url="https://www.google.com",

0 commit comments

Comments
 (0)