Skip to content

Commit ca9b065

Browse files
Done modifications in config, Makefile and cluster for ARM support (#717)
* done modifications in config, Makefile and cluster for ARM support * changes in config * modified config file for ARM support changes * changes in config file * changes in config file * chnages in config * changes in config file * modified config file to reuse environment variables * Updated TEST_RESOURCES env var in config file * remaned linuv to x86 in config file * add note in changelog * fixed indentation and chages linux to x86 in comment part of config file
1 parent 3905439 commit ca9b065

File tree

4 files changed

+137
-36
lines changed

4 files changed

+137
-36
lines changed

.circleci/config.yml

Lines changed: 121 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,35 @@ executors:
55
golang-executor:
66
docker:
77
- image: gcr.io/gcr-for-testing/golang:1.24.9
8-
machine-executor:
8+
9+
x86-machine-executor:
910
machine:
1011
image: ubuntu-2204:current
1112
docker_layer_caching: true
13+
14+
arm-machine-executor:
15+
machine:
16+
image: ubuntu-2204:current
17+
resource_class: arm.medium
1218
aliases:
1319
- &notify_slack_on_fail
1420
slack/notify:
1521
channel: 'C056RL4BXG9' #status-go channel
1622
event: fail
1723
template: basic_fail_1
24+
25+
# Common environment variables for integration tests (shared between x86 and ARM)
26+
# NOTE: TEST_RESOURCES must match the attach_workspace path below - it tells the Makefile
27+
# where to find resources on the host machine so it can mount them into Docker containers
28+
- &integration_test_env
29+
TEST_RESOURCES: "/home/circleci/resources/"
30+
ARANGODB: << pipeline.parameters.arangodbImage >>
31+
GOIMAGE: << pipeline.parameters.goImage >>
32+
ALPINE_IMAGE: << pipeline.parameters.alpineImage >>
33+
STARTER: << pipeline.parameters.starterImage >>
34+
ENABLE_DATABASE_EXTRA_FEATURES: << parameters.enable-extra-db-features >>
35+
TEST_DISALLOW_UNKNOWN_FIELDS: false
36+
VERBOSE: 1
1837

1938
parameters:
2039
goImage:
@@ -42,56 +61,93 @@ jobs:
4261
- run: make linter
4362

4463
run-unit-tests:
45-
executor: machine-executor
64+
executor: x86-machine-executor
4665
steps:
4766
- checkout
4867
- run: make run-unit-tests
4968
environment:
5069
GOIMAGE: << pipeline.parameters.goImage >>
5170

71+
download-demo-data:
72+
executor: x86-machine-executor
73+
steps:
74+
- checkout
75+
- run: mkdir -p $HOME/resources
76+
- run:
77+
name: Download itzpapalotl demo foxx service
78+
command: |
79+
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
80+
echo "This is not a pull request. Skipping..."
81+
exit 0
82+
fi
83+
if ! [ -f "$HOME/resources/itzpapalotl-v1.2.0.zip" ]; then
84+
curl -L0 -o $HOME/resources/itzpapalotl-v1.2.0.zip \
85+
"https://github.com/arangodb-foxx/demo-itzpapalotl/archive/v1.2.0.zip"
86+
fi
87+
- persist_to_workspace:
88+
root: /home/circleci/resources
89+
paths:
90+
- itzpapalotl-v1.2.0.zip
91+
92+
93+
# ----------------------------------------
94+
# UNIFIED INTEGRATION TEST JOB X86
95+
# ----------------------------------------
5296
run-integration-tests:
53-
executor: machine-executor
97+
executor: x86-machine-executor
5498
parameters:
5599
test-to-run:
56100
type: string
57-
default: "run-tests-single"
58101
enable-extra-db-features:
59102
type: boolean
60103
default: false
61104
steps:
62105
- checkout
106+
# Attach workspace to download demo data from download-demo-data job
107+
# NOTE: This path must match TEST_RESOURCES env var - Makefile uses TEST_RESOURCES
108+
# to mount this directory into Docker containers
109+
- attach_workspace:
110+
at: /home/circleci/resources
63111
- run:
64-
name: make << parameters.test-to-run >>
65-
command: |
66-
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
67-
echo "This is not a pull request. Skipping..."
68-
exit 0
69-
fi
70-
make << parameters.test-to-run >>
112+
name: Ensure resources directory exists
113+
command: mkdir -p $HOME/resources
114+
- run:
115+
name: Run integration tests
116+
command: make << parameters.test-to-run >>
71117
environment:
72-
TEST_RESOURCES: "${HOME}/resources/"
73-
ARANGODB: << pipeline.parameters.arangodbImage >>
74-
GOIMAGE: << pipeline.parameters.goImage >>
75-
ALPINE_IMAGE: << pipeline.parameters.alpineImage >>
76-
STARTER: << pipeline.parameters.starterImage >>
77-
ENABLE_DATABASE_EXTRA_FEATURES: << parameters.enable-extra-db-features >>
78-
TEST_DISALLOW_UNKNOWN_FIELDS: false
79-
VERBOSE: 1
118+
<<: *integration_test_env
80119

81-
download-demo-data:
82-
executor: machine-executor
120+
# ----------------------------------------
121+
# ARM INTEGRATION TEST JOB
122+
# ----------------------------------------
123+
run-integration-tests-arm:
124+
executor: arm-machine-executor
125+
parameters:
126+
test-to-run:
127+
type: string
128+
enable-extra-db-features:
129+
type: boolean
130+
default: false
83131
steps:
84-
- run: mkdir -p $HOME/resources
132+
- checkout
133+
# Attach workspace to download demo data from download-demo-data job
134+
# NOTE: This path must match TEST_RESOURCES env var - Makefile uses TEST_RESOURCES
135+
# to mount this directory into Docker containers
136+
- attach_workspace:
137+
at: /home/circleci/resources
85138
- run:
86-
name: Download itzpapalotl demo foxx service
139+
name: Ensure resources directory exists
140+
command: mkdir -p $HOME/resources
141+
- run:
142+
name: Set platform-specific environment variables
87143
command: |
88-
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
89-
echo "This is not a pull request. Skipping..."
90-
exit 0
91-
fi
92-
if ! [ -f "$HOME/resources/itzpapalotl-v1.2.0.zip" ]; then
93-
curl -L0 -o $HOME/resources/itzpapalotl-v1.2.0.zip "https://github.com/arangodb-foxx/demo-itzpapalotl/archive/v1.2.0.zip"
94-
fi
144+
echo 'export DOCKER_PLATFORM="--platform linux/arm64"' >> $BASH_ENV
145+
echo 'export DOCKER_BUILD_PLATFORM="--platform linux/arm64"' >> $BASH_ENV
146+
- run:
147+
name: Run integration tests
148+
command: make << parameters.test-to-run >>
149+
environment:
150+
<<: *integration_test_env
95151

96152
vulncheck:
97153
executor: golang-executor
@@ -117,16 +173,30 @@ workflows:
117173
requires:
118174
- run-unit-tests
119175

176+
# ========================
177+
# V1 Tests x86
178+
# ========================
120179
- run-integration-tests:
121180
name: Test V1 cluster
122181
requires:
123182
- download-demo-data
124183
test-to-run: run-tests-cluster
184+
185+
- run-integration-tests:
186+
name: Test V1 single
187+
requires:
188+
- download-demo-data
189+
test-to-run: run-tests-single
190+
191+
# ========================
192+
# V2 Tests x86
193+
# ========================
125194
- run-integration-tests:
126195
name: Test V2 cluster
127196
requires:
128197
- download-demo-data
129198
test-to-run: run-v2-tests-cluster
199+
130200
- run-integration-tests:
131201
name: Test V2 cluster - DB extra features (compression)
132202
requires:
@@ -135,12 +205,29 @@ workflows:
135205
enable-extra-db-features: true
136206

137207
- run-integration-tests:
138-
name: Test V1 single
208+
name: Test V2 single
139209
requires:
140210
- download-demo-data
141-
test-to-run: run-tests-single
142-
- run-integration-tests:
143-
name: Test V2 single
211+
test-to-run: run-v2-tests-single
212+
213+
# ========================
214+
# V2 Tests ARM
215+
# ========================
216+
- run-integration-tests-arm:
217+
name: Test V2 cluster (ARM)
218+
requires:
219+
- download-demo-data
220+
test-to-run: run-v2-tests-cluster
221+
222+
- run-integration-tests-arm:
223+
name: Test V2 cluster - DB extra features (compression) (ARM)
224+
requires:
225+
- download-demo-data
226+
test-to-run: run-v2-tests-cluster
227+
enable-extra-db-features: true
228+
229+
- run-integration-tests-arm:
230+
name: Test V2 single (ARM)
144231
requires:
145232
- download-demo-data
146233
test-to-run: run-v2-tests-single

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ ALPINE_IMAGE ?= alpine:3.21
1212
TMPDIR := ${SCRIPTDIR}/.tmp
1313

1414
DOCKER_CMD:=docker run
15+
DOCKER_PLATFORM ?=
16+
DOCKER_BUILD_PLATFORM ?= $(DOCKER_PLATFORM)
17+
DOCKER_CMD:=docker run $(DOCKER_PLATFORM)
1518

1619
GOBUILDTAGS:=$(TAGS)
1720
GOBUILDTAGSOPT=-tags "$(GOBUILDTAGS)"
@@ -463,11 +466,13 @@ __test_v2_go_test:
463466
__test_debug__:
464467
ifeq ("$(DEBUG)", "true")
465468
@docker build -f Dockerfile.debug --build-arg GOVERSION=$(GOVERSION) --build-arg GOTOOLCHAIN=$(GOTOOLCHAIN) --build-arg "TESTS_DIRECTORY=./test" -t $(GOIMAGE) .
469+
@docker build $(DOCKER_BUILD_PLATFORM) -f Dockerfile.debug --build-arg GOVERSION=$(GOVERSION) --build-arg GOTOOLCHAIN=$(GOTOOLCHAIN) --build-arg "TESTS_DIRECTORY=./test" -t $(GOIMAGE) .
466470
endif
467471

468472
__test_v2_debug__:
469473
ifeq ("$(DEBUG)", "true")
470474
@docker build -f Dockerfile.debug --build-arg GOVERSION=$(GOVERSION) --build-arg GOTOOLCHAIN=$(GOTOOLCHAIN) --build-arg "TESTS_DIRECTORY=./tests" --build-arg "TESTS_ROOT_PATH=v2" -t $(GOIMAGE) .
475+
@docker build $(DOCKER_BUILD_PLATFORM) -f Dockerfile.debug --build-arg GOVERSION=$(GOVERSION) --build-arg GOTOOLCHAIN=$(GOTOOLCHAIN) --build-arg "TESTS_DIRECTORY=./tests" --build-arg "TESTS_ROOT_PATH=v2" -t $(GOIMAGE) .
471476
endif
472477

473478
__dir_setup:

test/cluster.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ if [ "$CMD" == "start" ]; then
5252
if [ -n "$ENABLE_DATABASE_EXTRA_FEATURES" ]; then
5353
STARTERARGS="$STARTERARGS --all.database.extended-names-databases=true --args.all.http.compress-response-threshold=1 --args.all.http.handle-content-encoding-for-unauthenticated-requests=true"
5454
fi
55-
if [[ "$OSTYPE" == "darwin"* ]]; then
55+
# Use DOCKER_PLATFORM if set (e.g., from CircleCI for ARM), otherwise use macOS default
56+
if [ -n "$DOCKER_PLATFORM" ]; then
57+
DOCKERPLATFORMARG="$DOCKER_PLATFORM"
58+
DOCKERARGS="$DOCKERARGS $DOCKERPLATFORMARG"
59+
elif [[ "$OSTYPE" == "darwin"* ]]; then
5660
DOCKERPLATFORMARG="--platform linux/x86_64"
5761
DOCKERARGS="$DOCKERARGS $DOCKERPLATFORMARG"
5862
fi
@@ -76,7 +80,11 @@ if [ "$CMD" == "start" ]; then
7680
set -x
7781

7882
# pull latest version of ArangoDB image
79-
docker pull ${ARANGODB}
83+
if [ -n "$DOCKER_PLATFORM" ]; then
84+
docker pull ${DOCKER_PLATFORM} ${ARANGODB}
85+
else
86+
docker pull ${ARANGODB}
87+
fi
8088

8189
# Start starters
8290
# arangodb/arangodb-starter 0.7.0 or higher is needed.

v2/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [master](https://github.com/arangodb/go-driver/tree/master) (N/A)
44
- Add endpoint to fetch deployment id
5+
- Add ARM Support for V2 testcases
56

67
## [2.1.6](https://github.com/arangodb/go-driver/tree/v2.1.6) (2025-11-06)
78
- Add missing endpoints from replication

0 commit comments

Comments
 (0)