Skip to content

Commit a07a879

Browse files
committed
Merge branch 'master' into api-test
# Conflicts: # .github/workflows/maven.yml # src/test/resources/arangodb.properties
2 parents 934640d + 1585ee2 commit a07a879

File tree

66 files changed

+1023
-622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1023
-622
lines changed

.github/workflows/maven.yml

Lines changed: 95 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- api-test
7+
pull_request:
8+
types: [ opened, synchronize, reopened ]
9+
branches:
10+
- api-test
711

812
jobs:
913

@@ -16,58 +20,123 @@ jobs:
1620
matrix:
1721
docker-img:
1822
- docker.io/arangodb/arangodb:3.7.15
19-
- docker.io/arangodb/arangodb:3.8.1
23+
- docker.io/arangodb/arangodb:3.8.4
24+
- docker.io/arangodb/arangodb-preview:3.9.0-alpha.1
25+
- docker.io/arangodb/enterprise:3.7.15
26+
- docker.io/arangodb/enterprise:3.8.4
27+
- docker.io/arangodb/enterprise-preview:3.9.0-alpha.1
2028
topology:
2129
- single
2230
- cluster
23-
- active-failover
31+
- activefailover
32+
db-ext-names:
33+
- false
34+
java-version:
35+
- 8
36+
user-language:
37+
- en
2438

2539
steps:
26-
- uses: actions/checkout@v1
27-
- name: Set up JDK 1.8
28-
uses: actions/setup-java@v1
40+
- uses: actions/checkout@v2
41+
- name: Set up JDK
42+
uses: actions/setup-java@v2
2943
with:
30-
java-version: 1.8
44+
java-version: ${{matrix.java-version}}
45+
distribution: 'adopt'
3146
- name: Start Database
32-
run: ./docker/start_db_${{ matrix.topology }}_retry_fail.sh ${{ matrix.docker-img }}
47+
run: ./docker/start_db.sh
3348
env:
3449
ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }}
50+
STARTER_MODE: ${{matrix.topology}}
51+
DOCKER_IMAGE: ${{matrix.docker-img}}
52+
DATABASE_EXTENDED_NAMES: ${{matrix.db-ext-names}}
53+
- name: Cache local Maven repository
54+
uses: actions/cache@v2
55+
with:
56+
path: ~/.m2/repository
57+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
58+
restore-keys: ${{ runner.os }}-maven-
59+
- name: Info
60+
run: mvn -version
3561
- name: Test
36-
run: mvn --no-transfer-progress test
37-
- name: Debug containers
62+
run: mvn --no-transfer-progress test -DargLine="-Duser.language=${{matrix.user-language}}"
63+
- name: Collect docker logs on failure
3864
if: ${{ cancelled() || failure() }}
39-
run: ./docker/debug_containers_${{ matrix.topology }}.sh
65+
uses: jwalton/gh-docker-logs@v1
66+
with:
67+
dest: './logs'
68+
- name: Tar logs
69+
if: ${{ cancelled() || failure() }}
70+
run: tar cvzf ./logs.tgz ./logs
71+
- name: Upload logs to GitHub
72+
if: ${{ cancelled() || failure() }}
73+
uses: actions/upload-artifact@master
74+
with:
75+
name: logs.tgz
76+
path: ./logs.tgz
4077

41-
test-locale:
78+
test-jwt:
4279
timeout-minutes: 20
4380
runs-on: ubuntu-latest
4481

4582
strategy:
4683
fail-fast: false
4784
matrix:
4885
docker-img:
49-
# - docker.io/arangodb/arangodb:3.7.15
50-
- docker.io/arangodb/arangodb:3.8.1
51-
# - docker.io/arangodb/enterprise:3.7.15
52-
# - docker.io/arangodb/enterprise:3.8.1
53-
86+
- docker.io/arangodb/enterprise:3.8.4
5487
topology:
5588
- single
56-
# - cluster
57-
# - active-failover
89+
- cluster
90+
- activefailover
91+
db-ext-names:
92+
- false
93+
java-version:
94+
- 17
95+
user-language:
96+
- en
5897

5998
steps:
60-
- uses: actions/checkout@v1
61-
- name: Set up JDK 1.8
62-
uses: actions/setup-java@v1
99+
- uses: actions/checkout@v2
100+
- name: Set up JDK
101+
uses: actions/setup-java@v2
63102
with:
64-
java-version: 1.8
103+
java-version: ${{matrix.java-version}}
104+
distribution: 'adopt'
65105
- name: Start Database
66-
run: ./docker/start_db_${{ matrix.topology }}_retry_fail.sh ${{ matrix.docker-img }}
106+
run: ./docker/start_db.sh
67107
env:
68108
ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }}
109+
STARTER_MODE: ${{matrix.topology}}
110+
DOCKER_IMAGE: ${{matrix.docker-img}}
111+
DATABASE_EXTENDED_NAMES: ${{matrix.db-ext-names}}
112+
- name: Cache local Maven repository
113+
uses: actions/cache@v2
114+
with:
115+
path: ~/.m2/repository
116+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
117+
restore-keys: ${{ runner.os }}-maven-
118+
- name: Set JWT
119+
run: |
120+
ENDPOINT=$(./docker/find_active_endpoint.sh)
121+
echo "Active endpoint: $ENDPOINT"
122+
JWT=$(curl "http://$ENDPOINT/_db/_system/_open/auth" -X POST -d '{"username":"root","password":"test"}' | jq ".jwt" | xargs)
123+
echo "Setting JWT: $JWT"
124+
sed -i "/arangodb.password/c\arangodb.jwt=$JWT" src/test/resources/arangodb.properties
125+
- name: Info
126+
run: mvn -version
69127
- name: Test
70-
run: mvn --no-transfer-progress test -DargLine="-Duser.language=tr"
71-
- name: Debug containers
128+
run: mvn --no-transfer-progress test -DargLine="-Duser.language=${{matrix.user-language}}"
129+
- name: Collect docker logs on failure
72130
if: ${{ cancelled() || failure() }}
73-
run: ./docker/debug_containers_${{ matrix.topology }}.sh
131+
uses: jwalton/gh-docker-logs@v1
132+
with:
133+
dest: './logs'
134+
- name: Tar logs
135+
if: ${{ cancelled() || failure() }}
136+
run: tar cvzf ./logs.tgz ./logs
137+
- name: Upload logs to GitHub
138+
if: ${{ cancelled() || failure() }}
139+
uses: actions/upload-artifact@master
140+
with:
141+
name: logs.tgz
142+
path: ./logs.tgz

ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
## [6.15.0] - 2021-12-29
10+
11+
- JWT authentication (#421)
12+
- fixed swallowing connection exceptions (#420)
13+
- fixed `stopwords` analyzer (#414)
14+
- set max retries for active failover redirects (#412)
15+
- fixed deserializing `null` value as String (#411)
16+
917
## [6.14.0] - 2021-10-01
1018

1119
- fixed issues with non-English locales (#407)

docker/clean_active-failover.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

docker/clean_cluster.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

docker/clean_single.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

docker/debug_containers_active-failover.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

docker/debug_containers_cluster.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

docker/debug_containers_single.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

docker/find_active_endpoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
COORDINATORS=("172.17.0.1:8529" "172.17.0.1:8539" "172.17.0.1:8549")
4+
5+
for a in ${COORDINATORS[*]} ; do
6+
if curl -u root:test --silent --fail "http://$a"; then
7+
echo "$a"
8+
exit 0
9+
fi
10+
done
11+
12+
echo "Could not find any active endpoint!"
13+
exit 1

docker/start_db.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
3+
# Configuration environment variables:
4+
# STARTER_MODE: (single|cluster|activefailover), default single
5+
# DOCKER_IMAGE: ArangoDB docker image, default docker.io/arangodb/arangodb:latest
6+
# SSL: (true|false), default false
7+
# DATABASE_EXTENDED_NAMES: (true|false), default false
8+
# ARANGO_LICENSE_KEY: only required for ArangoDB Enterprise
9+
10+
# EXAMPLE:
11+
# STARTER_MODE=cluster SSL=true ./start_db.sh
12+
13+
STARTER_MODE=${STARTER_MODE:=single}
14+
DOCKER_IMAGE=${DOCKER_IMAGE:=docker.io/arangodb/arangodb:latest}
15+
SSL=${SSL:=false}
16+
DATABASE_EXTENDED_NAMES=${DATABASE_EXTENDED_NAMES:=false}
17+
18+
STARTER_DOCKER_IMAGE=docker.io/arangodb/arangodb-starter:latest
19+
20+
# exit when any command fails
21+
set -e
22+
23+
docker pull $STARTER_DOCKER_IMAGE
24+
docker pull $DOCKER_IMAGE
25+
26+
LOCATION=$(pwd)/$(dirname "$0")
27+
28+
echo "Averysecretword" > "$LOCATION"/jwtSecret
29+
docker run --rm -v "$LOCATION"/jwtSecret:/jwtSecret "$STARTER_DOCKER_IMAGE" auth header --auth.jwt-secret /jwtSecret > "$LOCATION"/jwtHeader
30+
AUTHORIZATION_HEADER=$(cat "$LOCATION"/jwtHeader)
31+
32+
STARTER_ARGS=
33+
SCHEME=http
34+
ARANGOSH_SCHEME=http+tcp
35+
COORDINATORS=("172.17.0.1:8529" "172.17.0.1:8539" "172.17.0.1:8549")
36+
37+
if [ "$STARTER_MODE" == "single" ]; then
38+
COORDINATORS=("172.17.0.1:8529")
39+
fi
40+
41+
if [ "$SSL" == "true" ]; then
42+
STARTER_ARGS="$STARTER_ARGS --ssl.keyfile=server.pem"
43+
SCHEME=https
44+
ARANGOSH_SCHEME=http+ssl
45+
fi
46+
47+
if [ "$DATABASE_EXTENDED_NAMES" == "true" ]; then
48+
STARTER_ARGS="${STARTER_ARGS} --all.database.extended-names-databases=true"
49+
fi
50+
51+
docker run -d \
52+
--name=adb \
53+
-p 8528:8528 \
54+
-v "$LOCATION"/server.pem:/server.pem \
55+
-v "$LOCATION"/jwtSecret:/jwtSecret \
56+
-v /var/run/docker.sock:/var/run/docker.sock \
57+
-e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" \
58+
$STARTER_DOCKER_IMAGE \
59+
$STARTER_ARGS \
60+
--docker.container=adb \
61+
--auth.jwt-secret=/jwtSecret \
62+
--starter.address=172.17.0.1 \
63+
--docker.image="${DOCKER_IMAGE}" \
64+
--starter.local --starter.mode=${STARTER_MODE} --all.log.level=debug --all.log.output=+ --log.verbose
65+
66+
67+
wait_server() {
68+
# shellcheck disable=SC2091
69+
until $(curl --output /dev/null --insecure --fail --silent --head -i -H "$AUTHORIZATION_HEADER" "$SCHEME://$1/_api/version"); do
70+
printf '.'
71+
sleep 1
72+
done
73+
}
74+
75+
echo "Waiting..."
76+
77+
for a in ${COORDINATORS[*]} ; do
78+
wait_server "$a"
79+
done
80+
81+
set +e
82+
for a in ${COORDINATORS[*]} ; do
83+
docker run --rm ${DOCKER_IMAGE} arangosh --server.endpoint="$ARANGOSH_SCHEME://$a" --server.authentication=false --javascript.execute-string='require("org/arangodb/users").update("root", "test")'
84+
done
85+
set -e
86+
87+
for a in ${COORDINATORS[*]} ; do
88+
echo ""
89+
curl -u root:test --insecure --fail "$SCHEME://$a/_api/version"
90+
done
91+
92+
echo ""
93+
echo ""
94+
echo "Done, your deployment is reachable at: "
95+
for a in ${COORDINATORS[*]} ; do
96+
echo "$SCHEME://$a"
97+
echo ""
98+
done

0 commit comments

Comments
 (0)