Compare commits
25 Commits
v2.15.0-am
...
ci-in-dock
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3086e8569a | ||
|
|
8e27ce9fc6 | ||
|
|
de81eb3d98 | ||
|
|
741cc7091a | ||
|
|
08021ecf01 | ||
|
|
8634ffd953 | ||
|
|
15ffc6422f | ||
|
|
a56a6116ed | ||
|
|
1997eddc8e | ||
|
|
4cdb536c3f | ||
|
|
cae54f5308 | ||
|
|
d89d53712c | ||
|
|
d5a06f7539 | ||
|
|
71c035b5a6 | ||
|
|
7179ced028 | ||
|
|
99d9675e08 | ||
|
|
c6839fdfa0 | ||
|
|
5af434d5df | ||
|
|
935fda33df | ||
|
|
15676f2557 | ||
|
|
efdd450b09 | ||
|
|
ce665d2c1b | ||
|
|
dd53f8d6b1 | ||
|
|
74fa6184b1 | ||
|
|
892f948866 |
2
.github/workflows/diff.yaml
vendored
2
.github/workflows/diff.yaml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
# pull_request:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**/*.md"
|
||||
|
||||
61
.github/workflows/reusable_build.yaml
vendored
Normal file
61
.github/workflows/reusable_build.yaml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: Build Memgraph
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build_name:
|
||||
description: Which build type will be used (community, debug, release ...)?
|
||||
required: true
|
||||
type: string
|
||||
threads:
|
||||
description: How many threads will be used to build memgraph?
|
||||
default: 24
|
||||
type: number
|
||||
os:
|
||||
description: Base image with which os will be used?
|
||||
default: debian-10
|
||||
type: string
|
||||
toolchain_version:
|
||||
description: Which toolchain version will be used in the build?
|
||||
default: 4
|
||||
type: number
|
||||
|
||||
env:
|
||||
TAG: "memgraph/mgbuilder:${{ github.sha }}-${{ inputs.build_name }}"
|
||||
OS: ${{ inputs.os }}
|
||||
TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
|
||||
THREADS: ${{ inputs.threads }}
|
||||
MEMGRAPH_ENTERPRISE_LICENSE: ${{ secrets.MEMGRAPH_ENTERPRISE_LICENSE }}
|
||||
MEMGRAPH_ORGANIZATION_NAME: ${{ secrets.MEMGRAPH_ORGANIZATION_NAME }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "${{ github.sha }}-${{ inputs.build_name }}"
|
||||
runs-on: [self-hosted, Linux, X64, Diff]
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Set up repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Number of commits to fetch. `0` indicates all history for all
|
||||
# branches and tags. (default: 1)
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build memgraph/mgbuilder:${{ github.sha }}-${{ inputs.build_name }}
|
||||
run: ./docker/ci.bash build ${{ inputs.build_name }}
|
||||
|
||||
- name: Push mgbuilder image
|
||||
run: docker push $TAG
|
||||
|
||||
- name: Clean up
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
docker container prune -f
|
||||
docker image prune -f
|
||||
docker builder prune -f
|
||||
docker image rm $TAG
|
||||
60
.github/workflows/reusable_test.yaml
vendored
Normal file
60
.github/workflows/reusable_test.yaml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Run a test
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
test_name:
|
||||
description: Which test will be run?
|
||||
required: true
|
||||
type: string
|
||||
mgbuilder:
|
||||
description: Which mgbuilder image is needed to perform the test?
|
||||
type: string
|
||||
required: true
|
||||
threads:
|
||||
description: How many threads will be used to build memgraph?
|
||||
default: 24
|
||||
type: number
|
||||
os:
|
||||
description: Base image with which os will be used?
|
||||
default: debian-10
|
||||
type: string
|
||||
toolchain_version:
|
||||
description: Which toolchain version will be used in the build?
|
||||
default: 4
|
||||
type: number
|
||||
|
||||
env:
|
||||
OS: ${{ inputs.os }}
|
||||
TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
|
||||
THREADS: ${{ inputs.threads }}
|
||||
MEMGRAPH_ENTERPRISE_LICENSE: ${{ secrets.MEMGRAPH_ENTERPRISE_LICENSE }}
|
||||
MEMGRAPH_ORGANIZATION_NAME: ${{ secrets.MEMGRAPH_ORGANIZATION_NAME }}
|
||||
TEST_CONTAINER: "${{ inputs.test_name }}-${{ github.run_id }}"
|
||||
|
||||
jobs:
|
||||
RunTest:
|
||||
name: "Run ${{ inputs.test_name }} test"
|
||||
runs-on: [self-hosted, Linux, X64, Diff]
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Pull ${{ inputs.mgbuilder_tag }}
|
||||
run: docker pull ${{ inputs.mgbuilder }}
|
||||
|
||||
- name: Run ${{ inputs.test_name }}
|
||||
run: |
|
||||
docker run --rm \
|
||||
--name $TEST_CONTAINER \
|
||||
--entrypoint /bin/bash \
|
||||
${{ inputs.mgbuilder }} \
|
||||
-c "./memgraph/docker/ci.bash test ${{ inputs.test_name }}"
|
||||
|
||||
- name: Clean up
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
docker image rm ${{ inputs.mgbuilder }}
|
||||
126
.github/workflows/testflow.yaml
vendored
Normal file
126
.github/workflows/testflow.yaml
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
name: Test workflow
|
||||
concurrency:
|
||||
group: ${{ github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**/*.md"
|
||||
- ".clang-format"
|
||||
- "CODEOWNERS"
|
||||
- "licenses/*"
|
||||
|
||||
env:
|
||||
THREADS: 24
|
||||
MEMGRAPH_ENTERPRISE_LICENSE: ${{ secrets.MEMGRAPH_ENTERPRISE_LICENSE }}
|
||||
MEMGRAPH_ORGANIZATION_NAME: ${{ secrets.MEMGRAPH_ORGANIZATION_NAME }}
|
||||
OS: "debian-10"
|
||||
TOOLCHAIN_VERSION: "4"
|
||||
|
||||
jobs:
|
||||
########################################################################################
|
||||
######################################## BUILDS ########################################
|
||||
########################################################################################
|
||||
MgbuilderCommunity:
|
||||
if: false
|
||||
uses: ./.github/workflows/reusable_build.yaml
|
||||
with:
|
||||
build_name: community
|
||||
threads: 24
|
||||
os: debian-10
|
||||
toolchain_version: 4
|
||||
secrets: inherit
|
||||
|
||||
MgbuilderDebug:
|
||||
if: false
|
||||
uses: ./.github/workflows/reusable_build.yaml
|
||||
with:
|
||||
build_name: debug
|
||||
threads: 24
|
||||
os: debian-10
|
||||
toolchain_version: 4
|
||||
secrets: inherit
|
||||
|
||||
MgbuilderRelease:
|
||||
# if: false
|
||||
uses: ./.github/workflows/reusable_build.yaml
|
||||
with:
|
||||
build_name: release
|
||||
threads: 24
|
||||
os: debian-10
|
||||
toolchain_version: 4
|
||||
secrets: inherit
|
||||
|
||||
MgbuilderExperimentalHA:
|
||||
if: false
|
||||
uses: ./.github/workflows/reusable_build.yaml
|
||||
with:
|
||||
build_name: experimental_ha
|
||||
threads: 24
|
||||
os: debian-10
|
||||
toolchain_version: 4
|
||||
secrets: inherit
|
||||
|
||||
MgbuilderExperimentalMT:
|
||||
if: false
|
||||
uses: ./.github/workflows/reusable_build.yaml
|
||||
with:
|
||||
build_name: experimental_mt
|
||||
threads: 24
|
||||
os: debian-10
|
||||
toolchain_version: 4
|
||||
secrets: inherit
|
||||
|
||||
########################################################################################
|
||||
######################################## TESTS #########################################
|
||||
########################################################################################
|
||||
StressTestPlain:
|
||||
needs: [MgbuilderRelease]
|
||||
uses: ./.github/workflows/reusable_test.yaml
|
||||
with:
|
||||
test_name: stress
|
||||
mgbuilder: "memgraph/mgbuilder:${{ github.sha }}-release"
|
||||
threads: 24
|
||||
secrets: inherit
|
||||
|
||||
StressTestSSL:
|
||||
needs: [MgbuilderRelease]
|
||||
uses: ./.github/workflows/reusable_test.yaml
|
||||
with:
|
||||
test_name: stress_ssl
|
||||
mgbuilder: "memgraph/mgbuilder:${{ github.sha }}-release"
|
||||
threads: 24
|
||||
secrets: inherit
|
||||
|
||||
DurabilityTest:
|
||||
needs: [MgbuilderRelease]
|
||||
uses: ./.github/workflows/reusable_test.yaml
|
||||
with:
|
||||
test_name: durability
|
||||
mgbuilder: "memgraph/mgbuilder:${{ github.sha }}-release"
|
||||
threads: 24
|
||||
secrets: inherit
|
||||
|
||||
UnitTest:
|
||||
needs: [MgbuilderRelease]
|
||||
uses: ./.github/workflows/reusable_test.yaml
|
||||
with:
|
||||
test_name: unit
|
||||
mgbuilder: "memgraph/mgbuilder:${{ github.sha }}-release"
|
||||
threads: 24
|
||||
secrets: inherit
|
||||
|
||||
GQLBehaveTest:
|
||||
needs: [MgbuilderRelease]
|
||||
uses: ./.github/workflows/reusable_test.yaml
|
||||
with:
|
||||
test_name: gql_behave
|
||||
mgbuilder: "memgraph/mgbuilder:${{ github.sha }}-release"
|
||||
threads: 24
|
||||
secrets: inherit
|
||||
169
docker/ci.bash
Executable file
169
docker/ci.bash
Executable file
@@ -0,0 +1,169 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
ROOT_DIR=$DIR/..
|
||||
BUILD_DIR=$ROOT_DIR/build
|
||||
|
||||
OS=${OS:-debian-10}
|
||||
TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:-4}
|
||||
THREADS=${THREADS:-$(nproc)}
|
||||
TAG=${TAG:-memgraph/mgbuilder:12345}
|
||||
DOCKERFILE_PATH=${DOCKERFILE_PATH:-$DIR/mgbuilder/Dockerfile}
|
||||
DOCKER_CONTEXT_PATH=${DOCKER_CONTEXT_PATH:-$DIR/..}
|
||||
TOOLCHAIN_ACTIVATE=${TOOLCHAIN_ACTIVATE:-"source /opt/toolchain-v${TOOLCHAIN_VERSION}/activate"}
|
||||
|
||||
print_help() {
|
||||
echo -e "$0 build BUILD_TYPE | test TEST_NAME"
|
||||
exit 1
|
||||
}
|
||||
|
||||
build() {
|
||||
case "$1" in
|
||||
community)
|
||||
cmake_cmd="cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMG_ENTERPRISE=OFF .."
|
||||
make_cmd="make -j$THREADS"
|
||||
;;
|
||||
debug)
|
||||
cmake_cmd="cmake -DCMAKE_BUILD_TYPE=Debug .."
|
||||
make_cmd="make -j$THREADS"
|
||||
;;
|
||||
jepsen)
|
||||
cmake_cmd="cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .."
|
||||
make_cmd="make -j$THREADS memgraph"
|
||||
;;
|
||||
release)
|
||||
cmake_cmd="cmake -DCMAKE_BUILD_TYPE=Release .."
|
||||
make_cmd="make -j$THREADS"
|
||||
;;
|
||||
experimental_mt)
|
||||
cmake_cmd="cmake -DCMAKE_BUILD_TYPE=Release -DMG_EXPERIMENTAL_REPLICATION_MULTITENANCY=ON .."
|
||||
make_cmd="make -j$THREADS"
|
||||
;;
|
||||
experimental_ha)
|
||||
cmake_cmd="cmake -DCMAKE_BUILD_TYPE=Release -DMG_EXPERIMENTAL_HIGH_AVAILABILITY=ON .."
|
||||
make_cmd="make -j$THREADS"
|
||||
;;
|
||||
*)
|
||||
print_help build
|
||||
;;
|
||||
esac
|
||||
|
||||
docker buildx build \
|
||||
-f $DOCKERFILE_PATH \
|
||||
-t $TAG \
|
||||
--build-arg CMAKE_CMD="$cmake_cmd" \
|
||||
--build-arg MAKE_CMD="$make_cmd" \
|
||||
--build-arg OS=$OS \
|
||||
--build-arg THREADS=$THREADS \
|
||||
--build-arg TOOLCHAIN_VERSION=$TOOLCHAIN_VERSION \
|
||||
$DOCKER_CONTEXT_PATH
|
||||
|
||||
}
|
||||
|
||||
unit_test() {
|
||||
$TOOLCHAIN_ACTIVATE
|
||||
cd $BUILD_DIR
|
||||
ctest -R memgraph__unit --output-on-failure -j$THREADS
|
||||
}
|
||||
|
||||
leftover_ctests() {
|
||||
$TOOLCHAIN_ACTIVATE
|
||||
cd $BUILD_DIR
|
||||
ctest -E "(memgraph__unit|memgraph__benchmark)" --output-on-failure
|
||||
}
|
||||
|
||||
drivers_test() {
|
||||
cd $ROOT_DIR
|
||||
./tests/drivers/run.sh
|
||||
}
|
||||
|
||||
integration_test() {
|
||||
cd $ROOT_DIR
|
||||
tests/integration/run.sh
|
||||
}
|
||||
|
||||
cppcheck_and_clang_format() {
|
||||
$TOOLCHAIN_ACTIVATE
|
||||
cd $ROOT_DIR/tools/github
|
||||
./cppcheck_and_clang_format diff
|
||||
}
|
||||
|
||||
stress_test () {
|
||||
cd $ROOT_DIR/tests/stress
|
||||
source ve3/bin/activate
|
||||
case "$1" in
|
||||
plain)
|
||||
./continuous_integration
|
||||
;;
|
||||
ssl)
|
||||
./continuous_integration --use-ssl
|
||||
;;
|
||||
*)
|
||||
print_help test
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
durability_test() {
|
||||
cd $ROOT_DIR/tests/stress
|
||||
source ve3/bin/activate
|
||||
python3 durability --num-steps 5
|
||||
}
|
||||
|
||||
gql_behave_test() {
|
||||
$TOOLCHAIN_ACTIVATE
|
||||
cd $ROOT_DIR/tests/gql_behave
|
||||
./continuous_integration
|
||||
}
|
||||
|
||||
run_test() {
|
||||
case "$1" in
|
||||
unit)
|
||||
unit_test
|
||||
;;
|
||||
leftover-CTest)
|
||||
leftover_ctest
|
||||
;;
|
||||
drivers)
|
||||
drivers_test
|
||||
;;
|
||||
integration)
|
||||
integration_test
|
||||
;;
|
||||
cppcheck-and-clang-format)
|
||||
cppcheck_and_clang_format
|
||||
;;
|
||||
stress)
|
||||
stress_test plain
|
||||
;;
|
||||
stress_ssl)
|
||||
stress_test ssl
|
||||
;;
|
||||
durability)
|
||||
durability_test
|
||||
;;
|
||||
gql_behave)
|
||||
gql_behave_test
|
||||
;;
|
||||
*)
|
||||
print_help test
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
print_help
|
||||
else
|
||||
case "$1" in
|
||||
build)
|
||||
build $2
|
||||
;;
|
||||
test)
|
||||
run_test $2
|
||||
;;
|
||||
*)
|
||||
print_help
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
32
docker/mgbuilder-base/debian-10/Dockerfile
Normal file
32
docker/mgbuilder-base/debian-10/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM debian:10
|
||||
|
||||
ARG TOOLCHAIN_VERSION=4
|
||||
ENV TOOLCHAIN="toolchain-v${TOOLCHAIN_VERSION}"
|
||||
ENV TOOLCHAIN_ACTIVATE="source /opt/$TOOLCHAIN/activate"
|
||||
ENV OS=debian-10
|
||||
ENV TARGETARCH=amd64
|
||||
|
||||
# Stops tzdata interactive configuration.
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt update && apt install -y \
|
||||
ca-certificates wget git
|
||||
# Do NOT be smart here and clean the cache because the container is used in the
|
||||
# stateful context.
|
||||
|
||||
RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/$TOOLCHAIN/$TOOLCHAIN-binaries-$OS-$TARGETARCH.tar.gz \
|
||||
-O $TOOLCHAIN-binaries-$OS-$TARGETARCH.tar.gz \
|
||||
&& tar xzvf $TOOLCHAIN-binaries-$OS-$TARGETARCH.tar.gz -C /opt \
|
||||
&& rm $TOOLCHAIN-binaries-$OS-$TARGETARCH.tar.gz
|
||||
|
||||
COPY . /memgraph
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
RUN cd memgraph && \
|
||||
git remote set-url origin https://github.com/memgraph/memgraph.git && \
|
||||
./environment/os/$OS.sh install TOOLCHAIN_RUN_DEPS && \
|
||||
./environment/os/$OS.sh install MEMGRAPH_BUILD_DEPS && \
|
||||
cd / && rm -rf memgraph
|
||||
|
||||
ENTRYPOINT ["sleep", "infinity"]
|
||||
26
docker/mgbuilder/Dockerfile
Normal file
26
docker/mgbuilder/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
ARG TOOLCHAIN_VERSION=4
|
||||
ARG OS=debian-10
|
||||
|
||||
FROM memgraph/mgbuilder-base:toolchain-v${TOOLCHAIN_VERSION}_${OS}
|
||||
|
||||
ARG BUILD_TYPE=Release
|
||||
ARG THREADS
|
||||
ENV BUILD_TYPE=${BUILD_TYPE}
|
||||
ENV THREADS=${THREADS}
|
||||
ARG CMAKE_CMD="cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .."
|
||||
ARG MAKE_CMD="make -j$THREADS"
|
||||
|
||||
COPY . /memgraph
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
# Initialize deps
|
||||
RUN cd memgraph && \
|
||||
git remote set-url origin https://github.com/memgraph/memgraph.git && \
|
||||
$TOOLCHAIN_ACTIVATE && \
|
||||
./init && \
|
||||
cd build && \
|
||||
$CMAKE_CMD && \
|
||||
$MAKE_CMD
|
||||
|
||||
ENTRYPOINT ["sleep", "infinity"]
|
||||
Reference in New Issue
Block a user