Compare commits

..

83 Commits

Author SHA1 Message Date
Marko Barišić
c10175d2e5
Merge branch 'master' into run-package-in-mgbuilder 2024-03-25 09:05:59 +01:00
Marko Budiselic
8e6068551b Polish the mgcxx CMake setup + fix gtest LIBDIR 2024-03-24 00:14:02 +00:00
Marko Barišić
c6e591b432
Merge branch 'master' into run-package-in-mgbuilder 2024-03-23 20:24:55 +01:00
Marko Budiselic
6c62348b04 Add mgcxx via existing primitives 2024-03-23 14:50:18 +00:00
Deda
719bb1099a Revert "mgcxx installation fix"
This reverts commit ff6d754c4e.
2024-03-23 11:16:33 +01:00
Andreja Tonev
ff6d754c4e mgcxx installation fix 2024-03-22 18:26:54 +01:00
Marko Barišić
5a9c6097c0
Merge branch 'master' into run-package-in-mgbuilder 2024-03-22 17:36:01 +01:00
Deda
2d4c84ea78 Test RPM fix 2024-03-22 14:55:11 +01:00
Deda
ce8200238f Add validation check for s3_dest_dir if pushing to download.memgraph.com 2024-03-22 14:27:39 +01:00
Marko Barišić
37f4082ee8
Merge branch 'master' into run-package-in-mgbuilder 2024-03-22 13:26:01 +01:00
Andreja Tonev
65b317f53a Fix mgcxx installation 2024-03-22 12:07:59 +01:00
Deda
bbba2a61fa Fix docker relase 2024-03-22 11:34:27 +01:00
Deda
1046178d18 Fix fedora 38 and 39 CPack issue 2024-03-22 11:28:16 +01:00
Deda
144a650dc0 Artifact name modification for docker packages 2024-03-22 10:58:54 +01:00
Deda
86b4e9e87f Fix reusable docker package workflow 2024-03-22 09:50:59 +01:00
Deda
89618d6c6b Fx s3 dest dir 2024-03-22 00:06:33 +01:00
Deda
c7f4a43ed9 Fix push_to_s3 input type 2024-03-21 19:28:46 +01:00
Deda
14e0b69ccf Fix github.event.inputs calls 2024-03-21 19:27:08 +01:00
Deda
d81366e492 Improve description for s3_dest_dir 2024-03-21 19:25:10 +01:00
Deda
16329be7ce Enable push to s3 2024-03-21 19:22:53 +01:00
Deda
b55565edd9 Set debian-12 as default 2024-03-21 19:06:24 +01:00
Deda
a4931d531a Remove jepsen test workflow 2024-03-21 19:03:07 +01:00
Marko Barišić
b261abd100
Merge branch 'master' into run-package-in-mgbuilder 2024-03-21 19:02:19 +01:00
Deda
82c253dec3 Minor fixes to diff.yaml and mgbuild.sh 2024-03-21 16:16:46 +01:00
Deda
2d57b037f8 Fix variable increment 2024-03-21 14:25:54 +01:00
Deda
c5a96fe62b Loop over cluster up jepsen 2024-03-21 14:04:24 +01:00
Marko Barišić
a8a6b7e533
Merge branch 'master' into run-package-in-mgbuilder 2024-03-21 13:43:55 +01:00
Deda
43fc09dae8 Test jepsen cluster refresh 2024-03-21 13:43:27 +01:00
Deda
267de98835 Revert jepsen cluster-refresh commands 2024-03-21 10:58:35 +01:00
Marko Barišić
7cfe26ff43
Merge branch 'master' into run-package-in-mgbuilder 2024-03-21 10:54:43 +01:00
Deda
acbf335f54 Fix jepsen cluster refresh 2024-03-20 16:16:27 +01:00
Deda
9df8c57515 Merge branch 'run-package-in-mgbuilder' of github.com:memgraph/memgraph into run-package-in-mgbuilder 2024-03-20 16:12:51 +01:00
Deda
2c1fc46815 Fix jepsen cluster refresh 2024-03-20 16:12:40 +01:00
Marko Barišić
0a4d2203ac
Merge branch 'master' into run-package-in-mgbuilder 2024-03-20 14:51:37 +01:00
Deda
75423a87f9 Fix openssl bug on fedora-38 and fedora-39 2024-03-20 14:32:46 +01:00
Deda
7e8b36a091 Test Jepsen Error 2024-03-20 10:57:43 +01:00
Deda
2cf89a9c72 Test Jepsen Error 2024-03-20 10:57:17 +01:00
Deda
eaf3b29042 Test Jepsen Error 2024-03-20 10:55:58 +01:00
Deda
0fa0dbf084 Add build argument GIT_REF to mgbuild Dockerfiles 2024-03-20 10:55:44 +01:00
Deda
ab94ea6eca Add docker login to package workflows 2024-03-20 09:39:30 +01:00
Deda
25d0f5dc81 Remove adding custom hosts from Dockerfiles and move to compose files 2024-03-20 09:26:38 +01:00
Deda
d73e0b02c3 Add docker login at start of every job to fix docker anonymous pull rate limit 2024-03-20 09:18:54 +01:00
Deda
097eceeffc Add condition for debian-11-arm and v4 2024-03-19 19:08:20 +01:00
Deda
3ac73a08e6 Fix timeout for docker arm builds 2024-03-19 19:06:02 +01:00
Deda
a6e4bf09d7 Remove commented out lines 2024-03-19 16:25:23 +01:00
Deda
d3802e10aa Fix conditional to check if arch is arm 2024-03-19 16:10:44 +01:00
Deda
aecae7cc38 Fix docker v5 packages 2024-03-19 16:06:37 +01:00
Deda
0192387eab Revert diff back to debian-11 2024-03-19 11:29:38 +01:00
Marko Barišić
9ac68bf10b
Merge branch 'master' into run-package-in-mgbuilder 2024-03-18 16:56:06 +01:00
Deda
5fd2c3000d Modify Dockerfile for debian-12 2024-03-18 16:47:06 +01:00
Deda
a85899d258 Disable dotnet check 2024-03-18 16:29:58 +01:00
Deda
677476e0f3 Fix debian-12-arm dotnet 2024-03-18 16:22:49 +01:00
Deda
550bc31984 Fix dotnet check for debian-12-arm 2024-03-18 16:10:05 +01:00
Deda
3aa782df31 Fix incorrect command call in reusable docker package 2024-03-18 15:44:11 +01:00
Deda
ac21d5f497 Bump sdk to 8.0 for debian-12-arm 2024-03-18 15:40:10 +01:00
Deda
2836723fd1 Fix centos pip install virtualenv 2024-03-18 15:29:19 +01:00
Deda
b886db021b Fix docker action 2024-03-18 15:14:13 +01:00
Deda
a3dbd2c265 Fix install os deps 2024-03-18 15:04:14 +01:00
Deda
4aefe0de9d Upgrade dot net sdk to 8.0 2024-03-18 14:55:41 +01:00
Deda
b0df64397d Merge branch 'run-package-in-mgbuilder' of github.com:memgraph/memgraph into run-package-in-mgbuilder 2024-03-18 12:08:30 +01:00
Deda
74d028deae Fix amzn-2 and centos-7 missing virtualenv 2024-03-18 12:08:17 +01:00
Marko Barišić
f6a74b8b3d
Merge branch 'master' into run-package-in-mgbuilder 2024-03-18 11:58:44 +01:00
Deda
d188fb9306 Fix os checking and rename docker command to package-docker 2024-03-18 11:17:52 +01:00
Marko Barišić
4554180bc9
Merge branch 'master' into run-package-in-mgbuilder 2024-03-18 10:48:41 +01:00
Deda
76d98a5987 Fix reusable docker package workflow name call 2024-03-15 18:51:40 +01:00
Deda
ca4fdc0a78 Add option to create docker amd and arm images 2024-03-15 18:49:34 +01:00
Marko Barišić
eb369eee2a
Merge branch 'master' into run-package-in-mgbuilder 2024-03-15 17:46:21 +01:00
Deda
64fd9a8ce2 Merge branch 'run-package-in-mgbuilder' of github.com:memgraph/memgraph into run-package-in-mgbuilder 2024-03-15 14:49:47 +01:00
Deda
1865a80722 Commit docker builds WIP 2024-03-15 14:49:34 +01:00
Marko Barišić
d3d869ce01
Merge branch 'master' into run-package-in-mgbuilder 2024-03-15 11:53:06 +01:00
Deda
a664c810bc Fix arm builder yaml files 2024-03-15 11:41:27 +01:00
Deda
b444e2171e Switch to debian-12 for all jobs except Jepsen 2024-03-14 18:04:53 +01:00
Deda
8040757b73 Swap netcat with netcat-traditional for debian-12-arm.sh 2024-03-14 17:15:45 +01:00
Deda
22b0d8ad9f Fix netcat dep for debian-12-arm 2024-03-14 17:07:37 +01:00
Deda
44e8644961 Fix write to /etc/hosts for ubuntu 22.04 arm 2024-03-14 15:45:30 +01:00
Deda
033f68a9f7 Enable arm build in package memgraph 2024-03-14 15:29:35 +01:00
Deda
77003410cc Add debian-11-arm to v5 arm builders 2024-03-14 15:29:11 +01:00
Deda
51c60404a9 Revert last commit, add check if all is passed and skip toolchain os combo check 2024-03-14 15:19:43 +01:00
Deda
ece27e76f2 Add all to supported os for v4 and v5 2024-03-14 15:18:27 +01:00
Deda
aac598ec1c Fix arm builders yaml files 2024-03-14 15:18:09 +01:00
Deda
6703b5968b Rename run2.sh to mgbuild.sh call 2024-03-14 14:56:41 +01:00
Marko Barišić
c185e8ff6f
Merge branch 'master' into run-package-in-mgbuilder 2024-03-14 14:50:34 +01:00
Deda
8f0533a009 Modify package memgraph and add reusable package workflow 2024-03-13 12:58:39 +01:00
38 changed files with 1075 additions and 430 deletions

View File

@ -38,6 +38,12 @@ jobs:
# branches and tags. (default: 1) # branches and tags. (default: 1)
fetch-depth: 0 fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Spin up mgbuild container - name: Spin up mgbuild container
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
@ -46,7 +52,7 @@ jobs:
--arch $ARCH \ --arch $ARCH \
run run
- name: Build release binaries - name: Build community binary
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
--toolchain $TOOLCHAIN \ --toolchain $TOOLCHAIN \
@ -97,6 +103,12 @@ jobs:
# branches and tags. (default: 1) # branches and tags. (default: 1)
fetch-depth: 0 fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Spin up mgbuild container - name: Spin up mgbuild container
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
@ -140,7 +152,7 @@ jobs:
--organization-name $MEMGRAPH_ORGANIZATION_NAME \ --organization-name $MEMGRAPH_ORGANIZATION_NAME \
test-memgraph code-analysis --base-branch "${{ env.BASE_BRANCH }}" test-memgraph code-analysis --base-branch "${{ env.BASE_BRANCH }}"
- name: Build combined ASAN, UBSAN and coverage binaries - name: Build combined ASAN, UBSAN and coverage binary
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
--toolchain $TOOLCHAIN \ --toolchain $TOOLCHAIN \
@ -217,6 +229,12 @@ jobs:
# branches and tags. (default: 1) # branches and tags. (default: 1)
fetch-depth: 0 fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Spin up mgbuild container - name: Spin up mgbuild container
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
@ -225,7 +243,7 @@ jobs:
--arch $ARCH \ --arch $ARCH \
run run
- name: Build release binaries - name: Build debug binary
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
--toolchain $TOOLCHAIN \ --toolchain $TOOLCHAIN \
@ -326,6 +344,12 @@ jobs:
# branches and tags. (default: 1) # branches and tags. (default: 1)
fetch-depth: 0 fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Spin up mgbuild container - name: Spin up mgbuild container
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
@ -334,7 +358,7 @@ jobs:
--arch $ARCH \ --arch $ARCH \
run run
- name: Build release binaries - name: Build release binary
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
--toolchain $TOOLCHAIN \ --toolchain $TOOLCHAIN \
@ -499,6 +523,12 @@ jobs:
# branches and tags. (default: 1) # branches and tags. (default: 1)
fetch-depth: 0 fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Spin up mgbuild container - name: Spin up mgbuild container
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
@ -507,7 +537,7 @@ jobs:
--arch $ARCH \ --arch $ARCH \
run run
- name: Build release binaries - name: Build release binary
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
--toolchain $TOOLCHAIN \ --toolchain $TOOLCHAIN \
@ -537,7 +567,7 @@ jobs:
- name: Save Jepsen report - name: Save Jepsen report
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: ${{ always() }} if: always()
with: with:
name: "Jepsen Report" name: "Jepsen Report"
path: tests/jepsen/Jepsen.tar.gz path: tests/jepsen/Jepsen.tar.gz
@ -572,6 +602,12 @@ jobs:
# branches and tags. (default: 1) # branches and tags. (default: 1)
fetch-depth: 0 fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Spin up mgbuild container - name: Spin up mgbuild container
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
@ -580,7 +616,7 @@ jobs:
--arch $ARCH \ --arch $ARCH \
run run
- name: Build release binaries - name: Build release binary
run: | run: |
./release/package/mgbuild.sh \ ./release/package/mgbuild.sh \
--toolchain $TOOLCHAIN \ --toolchain $TOOLCHAIN \

View File

@ -1,24 +1,19 @@
name: Package memgraph name: Package memgraph
# TODO(gitbuda): Cleanup docker container if GHA job was canceled.
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
memgraph_version:
description: "Memgraph version to upload as. Leave this field empty if you don't want to upload binaries to S3. Format: 'X.Y.Z'"
required: false
build_type: build_type:
type: choice type: choice
description: "Memgraph Build type. Default value is Release" description: "Memgraph Build type."
default: 'Release' default: 'Release'
options: options:
- Release - Release
- RelWithDebInfo - RelWithDebInfo
target_os: target_os:
type: choice type: choice
description: "Target OS for which memgraph will be packaged. Select 'all' if you want to package for every listed OS. Default is Ubuntu 22.04" description: "Target OS for which memgraph will be packaged. Select 'all' if you want to package for every listed OS."
default: 'ubuntu-22_04' default: 'debian-12'
options: options:
- all - all
- amzn-2 - amzn-2
@ -28,268 +23,392 @@ on:
- debian-11 - debian-11
- debian-11-arm - debian-11-arm
- debian-11-platform - debian-11-platform
- debian-12
- debian-12-arm
- docker - docker
- docker-arm
- fedora-36 - fedora-36
- ubuntu-18_04 - fedora-38
- ubuntu-20_04 - fedora-39
- ubuntu-22_04 - rocky-9.3
- ubuntu-22_04-arm - ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-22.04-arm
toolchain:
type: choice
description: "Toolchain version with which memgraph will be packaged."
default: 'v5'
options:
- v4
- v5
push_to_s3:
type: boolean
description: "Push final packages to an S3 bucket?"
default: false
s3_bucket:
type: choice
description: "Name of the target S3 bucket. Select 'download.memgraph.io' for official and 'deps.memgraph.io' for unofficial packages."
default: 'download.memgraph.io'
options:
- download.memgraph.com
- deps.memgraph.io
s3_region:
type: choice
description: "Region for the target S3 bucket."
options:
- eu-west-1
s3_dest_dir:
type: string
description: "Target dir path in S3 bucket. For official packages use format 'memgraph/X.Y.Z/'. For unofficial packages use format 'memgraph-unofficial/<SOMETHING>/'."
default: ''
jobs: jobs:
amzn-2: AmazonLinux2:
if: ${{ github.event.inputs.target_os == 'amzn-2' || github.event.inputs.target_os == 'all' }} if: ${{ github.event.inputs.target_os == 'amzn-2' || github.event.inputs.target_os == 'all' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "amzn-2"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | push_to_s3: ${{ github.event.inputs.push_to_s3 }}
./release/package/run.sh package amzn-2 ${{ github.event.inputs.build_type }} s3_bucket: ${{ github.event.inputs.s3_bucket }}
- name: "Upload package" s3_region: ${{ github.event.inputs.s3_region }}
uses: actions/upload-artifact@v4 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
with: secrets: inherit
name: amzn-2
path: build/output/amzn-2/memgraph*.rpm
centos-7: CentOS7:
if: ${{ github.event.inputs.target_os == 'centos-7' || github.event.inputs.target_os == 'all' }} if: ${{ github.event.inputs.target_os == 'centos-7' || github.event.inputs.target_os == 'all' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "centos-7"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | push_to_s3: ${{ github.event.inputs.push_to_s3 }}
./release/package/run.sh package centos-7 ${{ github.event.inputs.build_type }} s3_bucket: ${{ github.event.inputs.s3_bucket }}
- name: "Upload package" s3_region: ${{ github.event.inputs.s3_region }}
uses: actions/upload-artifact@v4 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
with: secrets: inherit
name: centos-7
path: build/output/centos-7/memgraph*.rpm
centos-9: CentOS9:
if: ${{ github.event.inputs.target_os == 'centos-9' || github.event.inputs.target_os == 'all' }} if: ${{ github.event.inputs.target_os == 'centos-9' || github.event.inputs.target_os == 'all' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "centos-9"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | push_to_s3: ${{ github.event.inputs.push_to_s3 }}
./release/package/run.sh package centos-9 ${{ github.event.inputs.build_type }} s3_bucket: ${{ github.event.inputs.s3_bucket }}
- name: "Upload package" s3_region: ${{ github.event.inputs.s3_region }}
uses: actions/upload-artifact@v4 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
with: secrets: inherit
name: centos-9
path: build/output/centos-9/memgraph*.rpm
debian-10: Debian10:
if: ${{ github.event.inputs.target_os == 'debian-10' || github.event.inputs.target_os == 'all' }} if: ${{ (github.event.inputs.target_os == 'debian-10' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v4' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-10"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | push_to_s3: ${{ github.event.inputs.push_to_s3 }}
./release/package/run.sh package debian-10 ${{ github.event.inputs.build_type }} s3_bucket: ${{ github.event.inputs.s3_bucket }}
- name: "Upload package" s3_region: ${{ github.event.inputs.s3_region }}
uses: actions/upload-artifact@v4 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
with: secrets: inherit
name: debian-10
path: build/output/debian-10/memgraph*.deb
debian-11: Debian11:
if: ${{ github.event.inputs.target_os == 'debian-11' || github.event.inputs.target_os == 'all' }} if: ${{ github.event.inputs.target_os == 'debian-11' || github.event.inputs.target_os == 'all' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-11"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | push_to_s3: ${{ github.event.inputs.push_to_s3 }}
./release/package/run.sh package debian-11 ${{ github.event.inputs.build_type }} s3_bucket: ${{ github.event.inputs.s3_bucket }}
- name: "Upload package" s3_region: ${{ github.event.inputs.s3_region }}
uses: actions/upload-artifact@v4 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
with: secrets: inherit
name: debian-11
path: build/output/debian-11/memgraph*.deb
debian-11-arm: Debian11-platform:
if: ${{ github.event.inputs.target_os == 'debian-11-arm' || github.event.inputs.target_os == 'all' }}
runs-on: [self-hosted, DockerMgBuild, ARM64, strange]
timeout-minutes: 120
steps:
- name: "Set up repository"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required because of release/get_version.py
- name: "Build package"
run: |
./release/package/run.sh package debian-11-arm ${{ github.event.inputs.build_type }}
- name: "Upload package"
uses: actions/upload-artifact@v4
with:
name: debian-11-aarch64
path: build/output/debian-11-arm/memgraph*.deb
debian-11-platform:
if: ${{ github.event.inputs.target_os == 'debian-11-platform' || github.event.inputs.target_os == 'all' }} if: ${{ github.event.inputs.target_os == 'debian-11-platform' || github.event.inputs.target_os == 'all' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-11"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | additional_build_args: "--for-platform"
./release/package/run.sh package debian-11 ${{ github.event.inputs.build_type }} --for-platform artifact_name: "debian-11-platform"
- name: "Upload package" push_to_s3: ${{ github.event.inputs.push_to_s3 }}
uses: actions/upload-artifact@v4 s3_bucket: ${{ github.event.inputs.s3_bucket }}
with: s3_region: ${{ github.event.inputs.s3_region }}
name: debian-11-platform s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
path: build/output/debian-11/memgraph*.deb secrets: inherit
docker: Debian11-arm:
if: ${{ github.event.inputs.target_os == 'docker' || github.event.inputs.target_os == 'all' }} if: ${{ (github.event.inputs.target_os == 'debian-11-arm' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v4' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-11-arm"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "arm"
with: runner_arch_label: "ARM64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 120
run: | artifact_name: "debian-11-aarch64"
cd release/package push_to_s3: ${{ github.event.inputs.push_to_s3 }}
./run.sh package debian-11 ${{ github.event.inputs.build_type }} --for-docker s3_bucket: ${{ github.event.inputs.s3_bucket }}
./run.sh docker s3_region: ${{ github.event.inputs.s3_region }}
- name: "Upload package" s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
uses: actions/upload-artifact@v4 secrets: inherit
with:
name: docker
path: build/output/docker/memgraph*.tar.gz
fedora-36: Debian12:
if: ${{ github.event.inputs.target_os == 'fedora-36' || github.event.inputs.target_os == 'all' }} if: ${{ (github.event.inputs.target_os == 'debian-12' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v5' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-12"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | push_to_s3: ${{ github.event.inputs.push_to_s3 }}
./release/package/run.sh package fedora-36 ${{ github.event.inputs.build_type }} s3_bucket: ${{ github.event.inputs.s3_bucket }}
- name: "Upload package" s3_region: ${{ github.event.inputs.s3_region }}
uses: actions/upload-artifact@v4 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
with: secrets: inherit
name: fedora-36
path: build/output/fedora-36/memgraph*.rpm
ubuntu-18_04: Debian12-arm:
if: ${{ github.event.inputs.target_os == 'ubuntu-18_04' || github.event.inputs.target_os == 'all' }} if: ${{ (github.event.inputs.target_os == 'debian-12-arm' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v5' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-12-arm"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "arm"
with: runner_arch_label: "ARM64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 120
run: | artifact_name: "debian-12-aarch64"
./release/package/run.sh package ubuntu-18.04 ${{ github.event.inputs.build_type }} push_to_s3: ${{ github.event.inputs.push_to_s3 }}
- name: "Upload package" s3_bucket: ${{ github.event.inputs.s3_bucket }}
uses: actions/upload-artifact@v4 s3_region: ${{ github.event.inputs.s3_region }}
with: s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
name: ubuntu-18.04 secrets: inherit
path: build/output/ubuntu-18.04/memgraph*.deb
ubuntu-20_04: Docker-v4:
if: ${{ github.event.inputs.target_os == 'ubuntu-20_04' || github.event.inputs.target_os == 'all' }} if: ${{ (github.event.inputs.target_os == 'docker' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v4' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_docker_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-11"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | additional_build_args: "--for-docker"
./release/package/run.sh package ubuntu-20.04 ${{ github.event.inputs.build_type }} artifact_name: "docker"
- name: "Upload package" push_to_s3: ${{ github.event.inputs.push_to_s3 }}
uses: actions/upload-artifact@v4 s3_bucket: ${{ github.event.inputs.s3_bucket }}
with: s3_region: ${{ github.event.inputs.s3_region }}
name: ubuntu-20.04 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
path: build/output/ubuntu-20.04/memgraph*.deb secrets: inherit
ubuntu-22_04: Docker-v5:
if: ${{ github.event.inputs.target_os == 'ubuntu-22_04' || github.event.inputs.target_os == 'all' }} if: ${{ (github.event.inputs.target_os == 'docker' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v5' }}
runs-on: [self-hosted, DockerMgBuild, X64] uses: ./.github/workflows/reusable_docker_package.yaml
timeout-minutes: 60 with:
steps: os: "debian-12"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "amd"
with: runner_arch_label: "X64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 60
run: | additional_build_args: "--for-docker"
./release/package/run.sh package ubuntu-22.04 ${{ github.event.inputs.build_type }} artifact_name: "docker"
- name: "Upload package" push_to_s3: ${{ github.event.inputs.push_to_s3 }}
uses: actions/upload-artifact@v4 s3_bucket: ${{ github.event.inputs.s3_bucket }}
with: s3_region: ${{ github.event.inputs.s3_region }}
name: ubuntu-22.04 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
path: build/output/ubuntu-22.04/memgraph*.deb secrets: inherit
ubuntu-22_04-arm: Docker-v4-arm:
if: ${{ github.event.inputs.target_os == 'ubuntu-22_04-arm' || github.event.inputs.target_os == 'all' }} if: ${{ (github.event.inputs.target_os == 'docker-arm' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v4' }}
runs-on: [self-hosted, DockerMgBuild, ARM64, strange] uses: ./.github/workflows/reusable_docker_package.yaml
timeout-minutes: 120 with:
steps: os: "debian-11-arm"
- name: "Set up repository" toolchain: ${{ github.event.inputs.toolchain }}
uses: actions/checkout@v4 arch: "arm"
with: runner_arch_label: "ARM64"
fetch-depth: 0 # Required because of release/get_version.py build_type: ${{ github.event.inputs.build_type }}
- name: "Build package" timeout_minutes: 120
run: | additional_build_args: "--for-docker"
./release/package/run.sh package ubuntu-22.04-arm ${{ github.event.inputs.build_type }} artifact_name: "docker-aarch64"
- name: "Upload package" push_to_s3: ${{ github.event.inputs.push_to_s3 }}
uses: actions/upload-artifact@v4 s3_bucket: ${{ github.event.inputs.s3_bucket }}
with: s3_region: ${{ github.event.inputs.s3_region }}
name: ubuntu-22.04-aarch64 s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
path: build/output/ubuntu-22.04-arm/memgraph*.deb secrets: inherit
upload-to-s3: Docker-v5-arm:
# only run upload if we specified version. Allows for runs without upload if: ${{ (github.event.inputs.target_os == 'docker-arm' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v5' }}
if: "${{ github.event.inputs.memgraph_version != '' }}" uses: ./.github/workflows/reusable_docker_package.yaml
needs: [amzn-2, centos-7, centos-9, debian-10, debian-11, debian-11-arm, debian-11-platform, docker, fedora-36, ubuntu-18_04, ubuntu-20_04, ubuntu-22_04, ubuntu-22_04-arm] with:
runs-on: ubuntu-latest os: "debian-12-arm"
steps: toolchain: ${{ github.event.inputs.toolchain }}
- name: Download artifacts arch: "arm"
uses: actions/download-artifact@v4 runner_arch_label: "ARM64"
with: build_type: ${{ github.event.inputs.build_type }}
# name: # if name input parameter is not provided, all artifacts are downloaded timeout_minutes: 120
# and put in directories named after each one. additional_build_args: "--for-docker"
path: build/output/release artifact_name: "docker-aarch64"
- name: Upload to S3 push_to_s3: ${{ github.event.inputs.push_to_s3 }}
uses: jakejarvis/s3-sync-action@v0.5.1 s3_bucket: ${{ github.event.inputs.s3_bucket }}
env: s3_region: ${{ github.event.inputs.s3_region }}
AWS_S3_BUCKET: "download.memgraph.com" s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_ACCESS_KEY_ID }} secrets: inherit
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "eu-west-1" Fedora36:
SOURCE_DIR: "build/output/release" if: ${{ (github.event.inputs.target_os == 'fedora-36' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v4' }}
DEST_DIR: "memgraph/v${{ github.event.inputs.memgraph_version }}/" uses: ./.github/workflows/reusable_package.yaml
with:
os: "fedora-36"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "amd"
runner_arch_label: "X64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 60
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit
Fedora38:
if: ${{ (github.event.inputs.target_os == 'fedora-38' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v5' }}
uses: ./.github/workflows/reusable_package.yaml
with:
os: "fedora-38"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "amd"
runner_arch_label: "X64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 60
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit
Fedora39:
if: ${{ (github.event.inputs.target_os == 'fedora-39' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v5' }}
uses: ./.github/workflows/reusable_package.yaml
with:
os: "fedora-39"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "amd"
runner_arch_label: "X64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 60
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit
RockyLinux9_3:
if: ${{ (github.event.inputs.target_os == 'rocky-9.3' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v5' }}
uses: ./.github/workflows/reusable_package.yaml
with:
os: "rocky-9.3"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "amd"
runner_arch_label: "X64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 60
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit
Ubuntu18_04:
if: ${{ (github.event.inputs.target_os == 'ubuntu-18.04' || github.event.inputs.target_os == 'all') && github.event.inputs.toolchain == 'v4' }}
uses: ./.github/workflows/reusable_package.yaml
with:
os: "ubuntu-18.04"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "amd"
runner_arch_label: "X64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 60
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit
Ubuntu20_04:
if: ${{ github.event.inputs.target_os == 'ubuntu-20.04' || github.event.inputs.target_os == 'all' }}
uses: ./.github/workflows/reusable_package.yaml
with:
os: "ubuntu-20.04"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "amd"
runner_arch_label: "X64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 60
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit
Ubuntu22_04:
if: ${{ github.event.inputs.target_os == 'ubuntu-22.04' || github.event.inputs.target_os == 'all' }}
uses: ./.github/workflows/reusable_package.yaml
with:
os: "ubuntu-22.04"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "amd"
runner_arch_label: "X64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 60
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit
Ubuntu22_04-arm:
if: ${{ github.event.inputs.target_os == 'ubuntu-22.04-arm' || github.event.inputs.target_os == 'all' }}
uses: ./.github/workflows/reusable_package.yaml
with:
os: "ubuntu-22.04-arm"
toolchain: ${{ github.event.inputs.toolchain }}
arch: "arm"
runner_arch_label: "ARM64"
build_type: ${{ github.event.inputs.build_type }}
timeout_minutes: 120
artifact_name: "ubuntu-22.04-aarch64"
push_to_s3: ${{ github.event.inputs.push_to_s3 }}
s3_bucket: ${{ github.event.inputs.s3_bucket }}
s3_region: ${{ github.event.inputs.s3_region }}
s3_dest_dir: ${{ github.event.inputs.s3_dest_dir }}
secrets: inherit

View File

@ -0,0 +1,161 @@
name: Reusable docker package make and upload
on:
workflow_call:
inputs:
os:
type: string
description: "Target os. Default value is debian-12."
default: 'debian-12'
arch:
type: string
description: "Target architecture. Default value is amd."
default: 'amd'
runner_arch_label:
type: string
description: "Runner architecture label. Amd is built on X64, arm on ARM64. Default value is X64."
default: 'X64'
toolchain:
type: string
description: "Toolchain version. Default value is v5."
default: 'v5'
build_type:
type: string
description: "Memgraph Build type. Default value is Release."
default: 'Release'
artifact_name:
type: string
description: "Unique artifact name, pass it in to override the default. Default value is docker."
default: ''
additional_build_args:
type: string
description: "Additional build flags (--for-platform, --for-docker ...). Default value is empty."
default: ''
timeout_minutes:
type: number
description: "Timeout in minutes for the job. Default value is 60."
default: 60
push_to_s3:
type: string
description: "Should the final package be pushed to an S3 bucket. Default value is false"
default: false
s3_bucket:
type: string
description: "Name of the target S3 bucket."
default: ''
s3_region:
type: string
description: "Region for the target S3 bucket."
default: 'eu-west-1'
s3_dest_dir:
type: string
description: "Target dir path in S3 bucket."
default: ''
jobs:
package:
runs-on: [self-hosted, DockerMgBuild, "${{ inputs.runner_arch_label }}"]
timeout-minutes: ${{ inputs.timeout_minutes }}
steps:
- name: "Set up repository"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required because of release/get_version.py
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Unlock keychain for current session" # Required beacuse ARM builds run on macos
if: ${{ inputs.arch == 'arm' }}
run: security -v unlock-keychain -p ${{ secrets.SELF_HOSTED_RUNNER_PASSWORD }} ~/Library/Keychains/login.keychain-db
- name: "Spin up mgbuild container"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
run
- name: "Build Memgraph binaries"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
--build-type ${{ inputs.build_type }} \
build-memgraph ${{ inputs.additional_build_args }}
- name: "Make package"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
--build-type ${{ inputs.build_type }} \
package-memgraph
- name: "Copy package"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
copy --package
- name: "Create docker package"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
package-docker
- name: "Upload docker package"
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: "build/output/docker/${{ inputs.arch }}/${{ inputs.toolchain }}/memgraph*"
- name: "Stop mgbuild container"
if: always()
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
stop --remove
upload-to-s3:
if: ${{ inputs.push_to_s3 == 'true' }}
needs: [package]
runs-on: ubuntu-latest
steps:
- name: Validate dest_dir
if: ${{ inputs.s3_bucket == 'download.memgraph.com' }}
run: |
if ! [[ "${{ inputs.s3_dest_dir }}" =~ memgraph/[0-9]\.[0-9]+\.[0-9]+$ ]]; then
echo -e "Error: ${{ inputs.s3_dest_dir }} is not a valid official format. When pushing to 'download.memgraph.com' the dest dir has to match format 'memgraph/X.Y.Z'!"
exit 1
else
echo -e "Passed: Dest dir ${{ inputs.s3_dest_dir }} has a valid official format."
fi
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: "build/output/release"
- name: Upload to S3
uses: jakejarvis/s3-sync-action@v0.5.1
env:
AWS_S3_BUCKET: ${{ inputs.s3_bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ inputs.s3_region }}
SOURCE_DIR: "build/output/release"
DEST_DIR: "${{ inputs.s3_dest_dir }}/${{ inputs.artifact_name }}/"

156
.github/workflows/reusable_package.yaml vendored Normal file
View File

@ -0,0 +1,156 @@
name: Reusable package make and upload
on:
workflow_call:
inputs:
os:
type: string
description: "Target os. Default value is debian-12."
default: 'debian-12'
arch:
type: string
description: "Target architecture. Default value is amd."
default: 'amd'
runner_arch_label:
type: string
description: "Runner architecture label. Amd is built on X64, arm on ARM64. Default value is X64."
default: 'X64'
toolchain:
type: string
description: "Toolchain version. Default value is v5."
default: 'v5'
build_type:
type: string
description: "Memgraph Build type. Default value is Release."
default: 'Release'
artifact_name:
type: string
description: "Unique artifact name, pass it in to override the default. Default value is os name."
default: ''
additional_build_args:
type: string
description: "Additional build flags (--for-platform, --for-docker ...). Default value is empty."
default: ''
timeout_minutes:
type: number
description: "Timeout in minutes for the job. Default value is 60."
default: 60
push_to_s3:
type: string
description: "Should the final package be pushed to an S3 bucket. Default value is false"
default: false
s3_bucket:
type: string
description: "Name of the target S3 bucket."
default: ''
s3_region:
type: string
description: "Region for the target S3 bucket."
default: 'eu-west-1'
s3_dest_dir:
type: string
description: "Target dir path in S3 bucket."
default: ''
env:
ARTIFACT_NAME: ${{ inputs.artifact_name || inputs.os }}
jobs:
package:
runs-on: [self-hosted, DockerMgBuild, "${{ inputs.runner_arch_label }}"]
timeout-minutes: ${{ inputs.timeout_minutes }}
steps:
- name: "Set up repository"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required because of release/get_version.py
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Unlock keychain for current session" # Required beacuse ARM builds run on macos
if: ${{ inputs.arch == 'arm' }}
run: security -v unlock-keychain -p ${{ secrets.SELF_HOSTED_RUNNER_PASSWORD }} ~/Library/Keychains/login.keychain-db
- name: "Spin up mgbuild container"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
run
- name: "Build Memgraph binaries"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
--build-type ${{ inputs.build_type }} \
build-memgraph ${{ inputs.additional_build_args }}
- name: "Make package"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
--build-type ${{ inputs.build_type }} \
package-memgraph
- name: "Copy package"
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
copy --package
- name: "Upload package"
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: "build/output/${{ inputs.os }}/memgraph*"
- name: "Stop mgbuild container"
if: always()
run: |
./release/package/mgbuild.sh \
--toolchain ${{ inputs.toolchain }} \
--os ${{ inputs.os }} \
--arch ${{ inputs.arch }} \
stop --remove
upload-to-s3:
if: ${{ inputs.push_to_s3 == 'true' }}
needs: [package]
runs-on: ubuntu-latest
steps:
- name: Validate dest_dir
if: ${{ inputs.s3_bucket == 'download.memgraph.com' }}
run: |
if ! [[ "${{ inputs.s3_dest_dir }}" =~ memgraph/[0-9]\.[0-9]+\.[0-9]+$ ]]; then
echo -e "Error: ${{ inputs.s3_dest_dir }} is not a valid official format. When pushing to 'download.memgraph.com' the dest dir has to match format 'memgraph/X.Y.Z'!"
exit 1
else
echo -e "Passed: Dest dir ${{ inputs.s3_dest_dir }} has a valid official format."
fi
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: "build/output/release"
- name: Upload to S3
uses: jakejarvis/s3-sync-action@v0.5.1
env:
AWS_S3_BUCKET: ${{ inputs.s3_bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ inputs.s3_region }}
SOURCE_DIR: "build/output/release"
DEST_DIR: "${{ inputs.s3_dest_dir }}/${{ env.ARTIFACT_NAME }}/"

View File

@ -46,14 +46,14 @@ MEMGRAPH_BUILD_DEPS=(
libpython3-dev python3-dev # for query modules libpython3-dev python3-dev # for query modules
libssl-dev libssl-dev
libseccomp-dev libseccomp-dev
netcat # tests are using nc to wait for memgraph netcat-traditional # tests are using nc to wait for memgraph
python3 virtualenv python3-virtualenv python3-pip # for qa, macro_benchmark and stress tests python3 virtualenv python3-virtualenv python3-pip # for qa, macro_benchmark and stress tests
python3-yaml # for the configuration generator python3-yaml # for the configuration generator
libcurl4-openssl-dev # mg-requests libcurl4-openssl-dev # mg-requests
sbcl # for custom Lisp C++ preprocessing sbcl # for custom Lisp C++ preprocessing
doxygen graphviz # source documentation generators doxygen graphviz # source documentation generators
mono-runtime mono-mcs zip unzip default-jdk-headless custom-maven3.9.3 # for driver tests mono-runtime mono-mcs zip unzip default-jdk-headless custom-maven3.9.3 # for driver tests
dotnet-sdk-7.0 golang custom-golang1.18.9 nodejs npm dotnet-sdk-8.0 golang custom-golang1.18.9 nodejs npm
autoconf # for jemalloc code generation autoconf # for jemalloc code generation
libtool # for protobuf code generation libtool # for protobuf code generation
libsasl2-dev libsasl2-dev
@ -86,6 +86,12 @@ check() {
fi fi
continue continue
fi fi
if [ "$pkg" == dotnet-sdk-8.0 ]; then
# if ! /root/.dotnet/dotnet --list-sdks | grep -q "8\.0."; then
# missing="$pkg $missing"
# fi
continue
fi
if ! dpkg -s "$pkg" >/dev/null 2>/dev/null; then if ! dpkg -s "$pkg" >/dev/null 2>/dev/null; then
missing="$pkg $missing" missing="$pkg $missing"
fi fi
@ -117,13 +123,11 @@ install() {
install_custom_golang "1.18.9" install_custom_golang "1.18.9"
continue continue
fi fi
if [ "$pkg" == dotnet-sdk-7.0 ]; then if [ "$pkg" == dotnet-sdk-8.0 ]; then
if ! dpkg -s "$pkg" 2>/dev/null >/dev/null; then wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
wget -nv https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb chmod +x ./dotnet-install.sh
dpkg -i packages-microsoft-prod.deb ./dotnet-install.sh --channel 8.0
apt-get update rm dotnet-install.sh
apt-get install -y apt-transport-https dotnet-sdk-7.0
fi
continue continue
fi fi
apt install -y "$pkg" apt install -y "$pkg"

View File

@ -53,7 +53,7 @@ MEMGRAPH_BUILD_DEPS=(
sbcl # for custom Lisp C++ preprocessing sbcl # for custom Lisp C++ preprocessing
doxygen graphviz # source documentation generators doxygen graphviz # source documentation generators
mono-runtime mono-mcs zip unzip default-jdk-headless custom-maven3.9.3 # for driver tests mono-runtime mono-mcs zip unzip default-jdk-headless custom-maven3.9.3 # for driver tests
dotnet-sdk-7.0 golang custom-golang1.18.9 nodejs npm dotnet-sdk-8.0 golang custom-golang1.18.9 nodejs npm
autoconf # for jemalloc code generation autoconf # for jemalloc code generation
libtool # for protobuf code generation libtool # for protobuf code generation
libsasl2-dev libsasl2-dev
@ -119,12 +119,12 @@ install() {
install_custom_golang "1.18.9" install_custom_golang "1.18.9"
continue continue
fi fi
if [ "$pkg" == dotnet-sdk-7.0 ]; then if [ "$pkg" == dotnet-sdk-8.0 ]; then
if ! dpkg -s "$pkg" 2>/dev/null >/dev/null; then if ! dpkg -s "$pkg" 2>/dev/null >/dev/null; then
wget -nv https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb wget -nv https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb dpkg -i packages-microsoft-prod.deb
apt-get update apt-get update
apt-get install -y apt-transport-https dotnet-sdk-7.0 apt-get install -y apt-transport-https dotnet-sdk-8.0
fi fi
continue continue
fi fi

View File

@ -45,7 +45,7 @@ MEMGRAPH_BUILD_DEPS=(
libuuid-devel java-11-openjdk # required by antlr libuuid-devel java-11-openjdk # required by antlr
readline-devel # for memgraph console readline-devel # for memgraph console
python3-devel # for query modules python3-devel # for query modules
openssl-devel openssl-devel openssl
libseccomp-devel libseccomp-devel
python3 python3-pip python3-virtualenv python3-virtualenvwrapper python3-pyyaml nmap-ncat # for tests python3 python3-pip python3-virtualenv python3-virtualenvwrapper python3-pyyaml nmap-ncat # for tests
libcurl-devel # mg-requests libcurl-devel # mg-requests

View File

@ -45,7 +45,7 @@ MEMGRAPH_BUILD_DEPS=(
libuuid-devel java-11-openjdk # required by antlr libuuid-devel java-11-openjdk # required by antlr
readline-devel # for memgraph console readline-devel # for memgraph console
python3-devel # for query modules python3-devel # for query modules
openssl-devel openssl-devel openssl
libseccomp-devel libseccomp-devel
python3 python3-pip python3-virtualenv python3-virtualenvwrapper python3-pyyaml nmap-ncat # for tests python3 python3-pip python3-virtualenv python3-virtualenvwrapper python3-pyyaml nmap-ncat # for tests
libcurl-devel # mg-requests libcurl-devel # mg-requests

View File

@ -15,6 +15,7 @@ OPERATING_SYSTEMS=(
# "mgrun debian-10 debian:10" # "mgrun debian-10 debian:10"
# "mgrun debian-11 debian:11" # "mgrun debian-11 debian:11"
# "mgrun fedora-36 fedora:36" # "mgrun fedora-36 fedora:36"
# "mgrun fedora-39 fedora:39"
# "mgrun ubuntu-18.04 ubuntu:18.04" # "mgrun ubuntu-18.04 ubuntu:18.04"
# "mgrun ubuntu-20.04 ubuntu:20.04" # "mgrun ubuntu-20.04 ubuntu:20.04"
# "mgrun ubuntu-22.04 ubuntu:22.04" # "mgrun ubuntu-22.04 ubuntu:22.04"

7
init
View File

@ -89,6 +89,13 @@ if [[ "$ci" == "false" ]]; then
fi fi
python3 -m pip install virtualenv python3 -m pip install virtualenv
fi fi
else
if [ "${DISTRO}" = "centos-7" ] || [ "${DISTRO}" = "amzn-2" ]; then
if python3 -m pip show virtualenv >/dev/null 2>/dev/null; then
python3 -m pip uninstall -y virtualenv
fi
python3 -m pip install --user virtualenv
fi
fi fi
# setup gql_behave dependencies # setup gql_behave dependencies

View File

@ -35,17 +35,18 @@ endfunction(import_header_library)
function(import_library name type location include_dir) function(import_library name type location include_dir)
add_library(${name} ${type} IMPORTED GLOBAL) add_library(${name} ${type} IMPORTED GLOBAL)
# https://cmake.org/cmake/help/latest/command/function.html#arguments
if(${ARGN}) if(ARGN)
# Optional argument is the name of the external project that we need to # Optional argument is the name of the external project that we need to
# depend on. # depend on.
add_dependencies(${name} ${ARGN0}) list(GET ARGN 0 dependency_name)
add_dependencies(${name} ${dependency_name})
message(STATUS "ADDED DEPENDENCY ${name} -> ${dependency_name}")
else() else()
add_dependencies(${name} ${name}-proj) add_dependencies(${name} ${name}-proj)
message(STATUS "ADDED DEPENDENCY ${name} -> ${name}-proj")
endif() endif()
set_property(TARGET ${name} PROPERTY IMPORTED_LOCATION ${location}) set_property(TARGET ${name} PROPERTY IMPORTED_LOCATION ${location})
# We need to create the include directory first in order to be able to add it # We need to create the include directory first in order to be able to add it
# as an include directory. The header files in the include directory will be # as an include directory. The header files in the include directory will be
# generated later during the build process. # generated later during the build process.
@ -60,12 +61,12 @@ endfunction(import_library)
# done in SOURCE_DIR, which defaults to ${CMAKE_CURRENT_SOURCE_DIR}/${name}. # done in SOURCE_DIR, which defaults to ${CMAKE_CURRENT_SOURCE_DIR}/${name}.
# You can pass additional arguments via CMAKE_ARGS. Dependencies and # You can pass additional arguments via CMAKE_ARGS. Dependencies and
# installation can be set as in regular ExternalProject_Add, via DEPENDS and # installation can be set as in regular ExternalProject_Add, via DEPENDS and
# INSTALL_COMMAND arguments. # INSTALL_COMMAND arguments. It's also possible to pass BUILD_BYPRODUCTS.
function(add_external_project name) function(add_external_project name)
set(options NO_C_COMPILER) set(options NO_C_COMPILER)
set(one_value_kwargs SOURCE_DIR BUILD_IN_SOURCE) set(one_value_kwargs SOURCE_DIR BUILD_IN_SOURCE)
set(multi_value_kwargs CMAKE_ARGS DEPENDS INSTALL_COMMAND BUILD_COMMAND set(multi_value_kwargs CMAKE_ARGS DEPENDS INSTALL_COMMAND BUILD_COMMAND
CONFIGURE_COMMAND) CONFIGURE_COMMAND BUILD_BYPRODUCTS)
cmake_parse_arguments(KW "${options}" "${one_value_kwargs}" "${multi_value_kwargs}" ${ARGN}) cmake_parse_arguments(KW "${options}" "${one_value_kwargs}" "${multi_value_kwargs}" ${ARGN})
set(source_dir ${CMAKE_CURRENT_SOURCE_DIR}/${name}) set(source_dir ${CMAKE_CURRENT_SOURCE_DIR}/${name})
@ -92,7 +93,8 @@ function(add_external_project name)
-DCMAKE_INSTALL_PREFIX=${source_dir} -DCMAKE_INSTALL_PREFIX=${source_dir}
${KW_CMAKE_ARGS} ${KW_CMAKE_ARGS}
INSTALL_COMMAND ${KW_INSTALL_COMMAND} INSTALL_COMMAND ${KW_INSTALL_COMMAND}
BUILD_COMMAND ${KW_BUILD_COMMAND}) BUILD_COMMAND ${KW_BUILD_COMMAND}
BUILD_BYPRODUCTS ${KW_BUILD_BYPRODUCTS})
endfunction(add_external_project) endfunction(add_external_project)
# Calls `add_external_project`, sets NAME_LIBRARY, NAME_INCLUDE_DIR variables # Calls `add_external_project`, sets NAME_LIBRARY, NAME_INCLUDE_DIR variables
@ -136,7 +138,6 @@ import_external_library(antlr4 STATIC
import_external_library(benchmark STATIC import_external_library(benchmark STATIC
${CMAKE_CURRENT_SOURCE_DIR}/benchmark/${CMAKE_INSTALL_LIBDIR}/libbenchmark.a ${CMAKE_CURRENT_SOURCE_DIR}/benchmark/${CMAKE_INSTALL_LIBDIR}/libbenchmark.a
${CMAKE_CURRENT_SOURCE_DIR}/benchmark/include ${CMAKE_CURRENT_SOURCE_DIR}/benchmark/include
# Skip testing. The tests don't compile with Clang 8. # Skip testing. The tests don't compile with Clang 8.
CMAKE_ARGS -DBENCHMARK_ENABLE_TESTING=OFF) CMAKE_ARGS -DBENCHMARK_ENABLE_TESTING=OFF)
@ -150,7 +151,8 @@ mark_as_advanced(RC_ENABLE_GTEST RC_ENABLE_GMOCK)
add_subdirectory(rapidcheck EXCLUDE_FROM_ALL) add_subdirectory(rapidcheck EXCLUDE_FROM_ALL)
# setup google test # setup google test
add_external_project(gtest SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest) add_external_project(gtest SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest
CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=lib)
set(GTEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/include set(GTEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/include
CACHE PATH "Path to gtest and gmock include directory" FORCE) CACHE PATH "Path to gtest and gmock include directory" FORCE)
set(GMOCK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/googletest/lib/libgmock.a set(GMOCK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/googletest/lib/libgmock.a
@ -295,37 +297,23 @@ set_path_external_library(jemalloc STATIC
import_header_library(rangev3 ${CMAKE_CURRENT_SOURCE_DIR}/rangev3/include) import_header_library(rangev3 ${CMAKE_CURRENT_SOURCE_DIR}/rangev3/include)
ExternalProject_Add(mgcxx-proj
PREFIX mgcxx-proj
GIT_REPOSITORY https://github.com/memgraph/mgcxx
GIT_TAG "v0.0.4"
CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
"-DENABLE_TESTS=OFF"
"-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
INSTALL_DIR "${PROJECT_BINARY_DIR}/mgcxx"
)
ExternalProject_Get_Property(mgcxx-proj install_dir)
set(MGCXX_ROOT ${install_dir})
add_library(tantivy_text_search STATIC IMPORTED GLOBAL)
add_dependencies(tantivy_text_search mgcxx-proj)
set_property(TARGET tantivy_text_search PROPERTY IMPORTED_LOCATION ${MGCXX_ROOT}/lib/libtantivy_text_search.a)
add_library(mgcxx_text_search STATIC IMPORTED GLOBAL)
add_dependencies(mgcxx_text_search mgcxx-proj)
set_property(TARGET mgcxx_text_search PROPERTY IMPORTED_LOCATION ${MGCXX_ROOT}/lib/libmgcxx_text_search.a)
# We need to create the include directory first in order to be able to add it
# as an include directory. The header files in the include directory will be
# generated later during the build process.
file(MAKE_DIRECTORY ${MGCXX_ROOT}/include)
set_property(TARGET mgcxx_text_search PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MGCXX_ROOT}/include)
# Setup NuRaft # Setup NuRaft
import_external_library(nuraft STATIC import_external_library(nuraft STATIC
${CMAKE_CURRENT_SOURCE_DIR}/nuraft/lib/libnuraft.a ${CMAKE_CURRENT_SOURCE_DIR}/nuraft/lib/libnuraft.a
${CMAKE_CURRENT_SOURCE_DIR}/nuraft/include/) ${CMAKE_CURRENT_SOURCE_DIR}/nuraft/include/)
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
target_link_libraries(nuraft INTERFACE ${OPENSSL_LIBRARIES}) target_link_libraries(nuraft INTERFACE ${OPENSSL_LIBRARIES})
# Setup mgcxx (provides: text search)
set(MGCXX_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mgcxx/include
CACHE PATH "Path to mgcxx include directory" FORCE)
set(TANTIVY_TEXT_SEARCH_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/mgcxx/lib/libtantivy_text_search.a
CACHE FILEPATH "Path to mgcxx tantivy library (internal one)" FORCE)
set(MGCXX_TEXT_SEARCH_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/mgcxx/lib/libmgcxx_text_search.a
CACHE FILEPATH "Path to mgcxx text search library" FORCE)
add_external_project(mgcxx
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mgcxx
CMAKE_ARGS -DENABLE_TESTS=OFF)
mark_as_advanced(MGCXX_INCLUDE_DIR TANTIVY_TEXT_SEARCH_LIBRARY MGCXX_TEXT_SEARCH_LIBRARY)
import_library(tantivy_text_search STATIC ${TANTIVY_TEXT_SEARCH_LIBRARY} ${MGCXX_INCLUDE_DIR} mgcxx-proj)
import_library(mgcxx_text_search STATIC ${MGCXX_TEXT_SEARCH_LIBRARY} ${MGCXX_INCLUDE_DIR} mgcxx-proj)

View File

@ -128,6 +128,7 @@ declare -A primary_urls=(
["range-v3"]="http://$local_cache_host/git/range-v3.git" ["range-v3"]="http://$local_cache_host/git/range-v3.git"
["nuraft"]="http://$local_cache_host/git/NuRaft.git" ["nuraft"]="http://$local_cache_host/git/NuRaft.git"
["asio"]="http://$local_cache_host/git/asio.git" ["asio"]="http://$local_cache_host/git/asio.git"
["mgcxx"]="http://$local_cache_host/git/mgcxx.git"
) )
# The goal of secondary urls is to have links to the "source of truth" of # The goal of secondary urls is to have links to the "source of truth" of
@ -159,6 +160,7 @@ declare -A secondary_urls=(
["range-v3"]="https://github.com/ericniebler/range-v3.git" ["range-v3"]="https://github.com/ericniebler/range-v3.git"
["nuraft"]="https://github.com/eBay/NuRaft.git" ["nuraft"]="https://github.com/eBay/NuRaft.git"
["asio"]="https://github.com/chriskohlhoff/asio.git" ["asio"]="https://github.com/chriskohlhoff/asio.git"
["mgcxx"]="http://github.com/memgraph/mgcxx.git"
) )
# antlr # antlr
@ -292,3 +294,7 @@ asio_tag="asio-1-29-0"
repo_clone_try_double "${primary_urls[asio]}" "${secondary_urls[asio]}" "asio" "$asio_tag" true repo_clone_try_double "${primary_urls[asio]}" "${secondary_urls[asio]}" "asio" "$asio_tag" true
./prepare.sh ./prepare.sh
popd popd
# mgcxx (text search)
mgcxx_tag="v0.0.4"
repo_clone_try_double "${primary_urls[mgcxx]}" "${secondary_urls[mgcxx]}" "mgcxx" "$mgcxx_tag" true

View File

@ -13,17 +13,40 @@ working_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
latest_image="" latest_image=""
tag_latest="" tag_latest=""
if [[ $# -eq 2 && "$1" == "--latest" ]]; then toolchain_version="v5"
latest_image="memgraph:latest" package_path=""
tag_latest="-t memgraph:latest" arch=""
shift while [[ $# -gt 0 ]]; do
elif [[ $# -ne 1 || "$1" == "-h" || "$1" == "--help" ]]; then case "$1" in
print_help --latest)
exit 1 latest_image="memgraph:latest"
fi tag_latest="-t memgraph:latest"
shift
;;
--package-path)
package_path=$2
shift 2
;;
--toolchain)
toolchain_version=$2
shift 2
;;
--arch)
arch=$2
shift 2
;;
-h|--help)
print_help
exit 0
;;
*)
echo -e "Error: Unknown option '$1'"
exit 1
;;
esac
done
package_path="$1" if [[ "$package_path" == "" || ! -f "$package_path" ]]; then
if [[ ! -f "$package_path" ]]; then
echo "File '$package_path' does not exist!" echo "File '$package_path' does not exist!"
exit 1 exit 1
fi fi
@ -38,13 +61,13 @@ if [[ "$extension" == "deb" ]]; then
# Extract version and offering from deb name. # Extract version and offering from deb name.
package_name=`echo $(basename "$package_path") | sed 's/.deb$//'` package_name=`echo $(basename "$package_path") | sed 's/.deb$//'`
version=`echo ${package_name} | cut -d '_' -f 2 | rev | cut -d '-' -f 2- | rev | tr '+~' '__'` version=`echo ${package_name} | cut -d '_' -f 2 | rev | cut -d '-' -f 2- | rev | tr '+~' '__'`
dockerfile_path="${working_dir}/memgraph_deb.dockerfile" dockerfile_path="${working_dir}/${toolchain_version}_deb.dockerfile"
elif [[ "$extension" == "rpm" ]]; then elif [[ "$extension" == "rpm" ]]; then
# Extract version and offering from deb name. # Extract version and offering from deb name.
package_name=`echo $(basename "$package_path") | sed 's/.rpm$//'` package_name=`echo $(basename "$package_path") | sed 's/.rpm$//'`
version=`echo ${package_name} | cut -d '-' -f 2 | rev | cut -d '-' -f 2- | rev` version=`echo ${package_name} | cut -d '-' -f 2 | rev | cut -d '-' -f 2- | rev`
version=${version%_1} version=${version%_1}
dockerfile_path="${working_dir}/memgraph_rpm.dockerfile" dockerfile_path="${working_dir}/${toolchain_version}_rpm.dockerfile"
else else
echo "Invalid file sent as the package" echo "Invalid file sent as the package"
print_help print_help
@ -62,4 +85,5 @@ docker build --pull -t ${image_name} ${tag_latest} -f ${dockerfile_path} \
--build-arg TARGETARCH="" . --build-arg TARGETARCH="" .
docker save ${image_name} ${latest_image} | gzip > ${image_package_name} docker save ${image_name} ${latest_image} | gzip > ${image_package_name}
rm "${package_name}.${extension}" rm "${package_name}.${extension}"
docker image rm $image_name
echo "Built Docker image at '${working_dir}/${image_package_name}'" echo "Built Docker image at '${working_dir}/${image_package_name}'"

View File

@ -1,4 +1,4 @@
FROM debian:bullseye FROM debian:11
# NOTE: If you change the base distro update release/package as well. # NOTE: If you change the base distro update release/package as well.
ARG BINARY_NAME ARG BINARY_NAME

View File

@ -0,0 +1,32 @@
FROM debian:12
# NOTE: If you change the base distro update release/package as well.
ARG BINARY_NAME
ARG EXTENSION
ARG TARGETARCH
RUN apt-get update && apt-get install -y \
openssl libcurl4 libssl3 libseccomp2 python3 libpython3.11 python3-pip \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip3 install --break-system-packages networkx==3.2.1 numpy==1.26.4 scipy==1.12.0
COPY "${BINARY_NAME}${TARGETARCH}.${EXTENSION}" /
# Install memgraph package
RUN dpkg -i "${BINARY_NAME}${TARGETARCH}.deb"
# Memgraph listens for Bolt Protocol on this port by default.
EXPOSE 7687
# Snapshots and logging volumes
VOLUME /var/log/memgraph
VOLUME /var/lib/memgraph
# Configuration volume
VOLUME /etc/memgraph
USER memgraph
WORKDIR /usr/lib/memgraph
ENTRYPOINT ["/usr/lib/memgraph/memgraph"]
CMD [""]

View File

@ -6,6 +6,9 @@ services:
context: amzn-2 context: amzn-2
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_amzn-2" container_name: "mgbuild_v4_amzn-2"
mgbuild_v4_centos-7: mgbuild_v4_centos-7:
@ -14,6 +17,9 @@ services:
context: centos-7 context: centos-7
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_centos-7" container_name: "mgbuild_v4_centos-7"
mgbuild_v4_centos-9: mgbuild_v4_centos-9:
@ -22,6 +28,9 @@ services:
context: centos-9 context: centos-9
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_centos-9" container_name: "mgbuild_v4_centos-9"
mgbuild_v4_debian-10: mgbuild_v4_debian-10:
@ -30,6 +39,9 @@ services:
context: debian-10 context: debian-10
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_debian-10" container_name: "mgbuild_v4_debian-10"
mgbuild_v4_debian-11: mgbuild_v4_debian-11:
@ -38,6 +50,9 @@ services:
context: debian-11 context: debian-11
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_debian-11" container_name: "mgbuild_v4_debian-11"
mgbuild_v4_fedora-36: mgbuild_v4_fedora-36:
@ -46,6 +61,9 @@ services:
context: fedora-36 context: fedora-36
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_fedora-36" container_name: "mgbuild_v4_fedora-36"
mgbuild_v4_ubuntu-18.04: mgbuild_v4_ubuntu-18.04:
@ -54,6 +72,9 @@ services:
context: ubuntu-18.04 context: ubuntu-18.04
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_ubuntu-18.04" container_name: "mgbuild_v4_ubuntu-18.04"
mgbuild_v4_ubuntu-20.04: mgbuild_v4_ubuntu-20.04:
@ -62,6 +83,9 @@ services:
context: ubuntu-20.04 context: ubuntu-20.04
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_ubuntu-20.04" container_name: "mgbuild_v4_ubuntu-20.04"
mgbuild_v4_ubuntu-22.04: mgbuild_v4_ubuntu-22.04:
@ -70,4 +94,7 @@ services:
context: ubuntu-22.04 context: ubuntu-22.04
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_ubuntu-22.04" container_name: "mgbuild_v4_ubuntu-22.04"

View File

@ -6,6 +6,9 @@ services:
context: amzn-2 context: amzn-2
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_amzn-2" container_name: "mgbuild_v5_amzn-2"
mgbuild_v5_centos-7: mgbuild_v5_centos-7:
@ -14,6 +17,9 @@ services:
context: centos-7 context: centos-7
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_centos-7" container_name: "mgbuild_v5_centos-7"
mgbuild_v5_centos-9: mgbuild_v5_centos-9:
@ -22,6 +28,9 @@ services:
context: centos-9 context: centos-9
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_centos-9" container_name: "mgbuild_v5_centos-9"
mgbuild_v5_debian-11: mgbuild_v5_debian-11:
@ -30,6 +39,9 @@ services:
context: debian-11 context: debian-11
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_debian-11" container_name: "mgbuild_v5_debian-11"
mgbuild_v5_debian-12: mgbuild_v5_debian-12:
@ -38,6 +50,9 @@ services:
context: debian-12 context: debian-12
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_debian-12" container_name: "mgbuild_v5_debian-12"
mgbuild_v5_fedora-38: mgbuild_v5_fedora-38:
@ -46,6 +61,9 @@ services:
context: fedora-38 context: fedora-38
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_fedora-38" container_name: "mgbuild_v5_fedora-38"
mgbuild_v5_fedora-39: mgbuild_v5_fedora-39:
@ -54,6 +72,9 @@ services:
context: fedora-39 context: fedora-39
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_fedora-39" container_name: "mgbuild_v5_fedora-39"
mgbuild_v5_rocky-9.3: mgbuild_v5_rocky-9.3:
@ -62,6 +83,9 @@ services:
context: rocky-9.3 context: rocky-9.3
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_rocky-9.3" container_name: "mgbuild_v5_rocky-9.3"
mgbuild_v5_ubuntu-20.04: mgbuild_v5_ubuntu-20.04:
@ -70,6 +94,9 @@ services:
context: ubuntu-20.04 context: ubuntu-20.04
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_ubuntu-20.04" container_name: "mgbuild_v5_ubuntu-20.04"
mgbuild_v5_ubuntu-22.04: mgbuild_v5_ubuntu-22.04:
@ -78,4 +105,7 @@ services:
context: ubuntu-22.04 context: ubuntu-22.04
args: args:
TOOLCHAIN_VERSION: "v5" TOOLCHAIN_VERSION: "v5"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_ubuntu-22.04" container_name: "mgbuild_v5_ubuntu-22.04"

View File

@ -14,16 +14,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-amzn-2-x86_64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-amzn-2-x86_64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/amzn-2.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/amzn-2.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/amzn-2.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/amzn-2.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -7,12 +7,18 @@ services:
context: debian-11-arm context: debian-11-arm
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_debian-11-arm" container_name: "mgbuild_v4_debian-11-arm"
mgbuild_v4_ubuntu_v4_22.04-arm: mgbuild_v4_ubuntu-22.04-arm:
image: "memgraph/mgbuild:v4_ubuntu-22.04-arm" image: "memgraph/mgbuild:v4_ubuntu-22.04-arm"
build: build:
context: ubuntu-22.04-arm context: ubuntu-22.04-arm
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v4"
extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v4_ubuntu-22.04-arm" container_name: "mgbuild_v4_ubuntu-22.04-arm"

View File

@ -1,18 +1,24 @@
version: "3" version: "3"
services: services:
debian-12-arm: mgbuild_v5_debian-12-arm:
image: "memgraph/mgbuild:v5_debian-12-arm" image: "memgraph/mgbuild:v5_debian-12-arm"
build: build:
context: debian-12-arm context: debian-12-arm
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v5"
container_name: "mgbuild_debian-12-arm" extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_debian-12-arm"
ubuntu-22.04-arm: mgbuild_v5_ubuntu-22.04-arm:
image: "memgraph/mgbuild:v5_ubuntu-22.04-arm" image: "memgraph/mgbuild:v5_ubuntu-22.04-arm"
build: build:
context: ubuntu-22.04-arm context: ubuntu-22.04-arm
args: args:
TOOLCHAIN_VERSION: "v4" TOOLCHAIN_VERSION: "v5"
container_name: "mgbuild_ubuntu-22.04-arm" extra_hosts:
- "mgdeps-cache:10.42.16.10"
- "bench-graph-api:10.42.16.10"
container_name: "mgbuild_v5_ubuntu-22.04-arm"

View File

@ -13,16 +13,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-centos-7-x86_64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-centos-7-x86_64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/centos-7.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/centos-7.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/centos-7.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/centos-7.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -13,16 +13,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-centos-9-x86_64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-centos-9-x86_64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/centos-9.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/centos-9.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/centos-9.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/centos-9.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-10-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-10-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/debian-10.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/debian-10.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/debian-10.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/debian-10.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-11-arm64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-11-arm64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/debian-11-arm.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/debian-11-arm.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/debian-11-arm.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/debian-11-arm.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-11-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-11-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/debian-11.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/debian-11.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/debian-11.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/debian-11.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-12-arm64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-12-arm64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/debian-12-arm.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/debian-12-arm.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/debian-12-arm.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/debian-12-arm.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-12-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-debian-12-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/debian-12.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/debian-12.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/debian-12.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/debian-12.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -14,16 +14,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-fedora-36-x86_64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-fedora-36-x86_64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/fedora-36.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/fedora-36.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/fedora-36.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/fedora-36.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -14,16 +14,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-fedora-38-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-fedora-38-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/fedora-38.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/fedora-38.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/fedora-38.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/fedora-38.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -14,16 +14,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-fedora-39-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-fedora-39-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/fedora-39.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/fedora-39.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/fedora-39.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/fedora-39.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -63,10 +63,11 @@ print_help () {
echo -e "\nInteract with mgbuild containers" echo -e "\nInteract with mgbuild containers"
echo -e "\nCommands:" echo -e "\nCommands:"
echo -e " build Build mgbuild image" echo -e " build [OPTIONS] Build mgbuild image"
echo -e " build-memgraph [OPTIONS] Build memgraph binary inside mgbuild container" echo -e " build-memgraph [OPTIONS] Build memgraph binary inside mgbuild container"
echo -e " copy OPTIONS Copy an artifact from mgbuild container to host" echo -e " copy OPTIONS Copy an artifact from mgbuild container to host"
echo -e " package-memgraph Create memgraph package from built binary inside mgbuild container" echo -e " package-memgraph Create memgraph package from built binary inside mgbuild container"
echo -e " package-docker Create memgraph docker image and pack it as .tar.gz"
echo -e " pull Pull mgbuild image from dockerhub" echo -e " pull Pull mgbuild image from dockerhub"
echo -e " push [OPTIONS] Push mgbuild image to dockerhub" echo -e " push [OPTIONS] Push mgbuild image to dockerhub"
echo -e " run [OPTIONS] Run mgbuild container" echo -e " run [OPTIONS] Run mgbuild container"
@ -85,6 +86,9 @@ print_help () {
echo -e " --threads int Specify the number of threads a command will use (default \"\$(nproc)\" for container)" echo -e " --threads int Specify the number of threads a command will use (default \"\$(nproc)\" for container)"
echo -e " --toolchain string Specify toolchain version (\"${SUPPORTED_TOOLCHAINS[*]}\") (default \"$DEFAULT_TOOLCHAIN\")" echo -e " --toolchain string Specify toolchain version (\"${SUPPORTED_TOOLCHAINS[*]}\") (default \"$DEFAULT_TOOLCHAIN\")"
echo -e "\nbuild options:"
echo -e " --git-ref string Specify git ref from which the environment deps will be installed (default \"master\")"
echo -e "\nbuild-memgraph options:" echo -e "\nbuild-memgraph options:"
echo -e " --asan Build with ASAN" echo -e " --asan Build with ASAN"
echo -e " --community Build community version" echo -e " --community Build community version"
@ -102,8 +106,8 @@ print_help () {
echo -e " --package Copy memgraph package from mgbuild container to host" echo -e " --package Copy memgraph package from mgbuild container to host"
echo -e "\npush options:" echo -e "\npush options:"
echo -e " -p, --password string Specify password for docker login" echo -e " -p, --password string Specify password for docker login (default empty)"
echo -e " -u, --username string Specify username for docker login" echo -e " -u, --username string Specify username for docker login (default empty)"
echo -e "\nrun options:" echo -e "\nrun options:"
echo -e " --pull Pull the mgbuild image before running" echo -e " --pull Pull the mgbuild image before running"
@ -118,6 +122,7 @@ print_help () {
echo -e " \"${SUPPORTED_OS_V5[*]}\"" echo -e " \"${SUPPORTED_OS_V5[*]}\""
echo -e "\nExample usage:" echo -e "\nExample usage:"
echo -e " $SCRIPT_NAME --os debian-12 --toolchain v5 --arch amd build --git-ref my-special-branch"
echo -e " $SCRIPT_NAME --os debian-12 --toolchain v5 --arch amd run" echo -e " $SCRIPT_NAME --os debian-12 --toolchain v5 --arch amd run"
echo -e " $SCRIPT_NAME --os debian-12 --toolchain v5 --arch amd --build-type RelWithDebInfo build-memgraph --community" echo -e " $SCRIPT_NAME --os debian-12 --toolchain v5 --arch amd --build-type RelWithDebInfo build-memgraph --community"
echo -e " $SCRIPT_NAME --os debian-12 --toolchain v5 --arch amd --build-type RelWithDebInfo test-memgraph unit" echo -e " $SCRIPT_NAME --os debian-12 --toolchain v5 --arch amd --build-type RelWithDebInfo test-memgraph unit"
@ -274,6 +279,7 @@ build_memgraph () {
;; ;;
*) *)
echo "Error: Unknown flag '$1'" echo "Error: Unknown flag '$1'"
print_help
exit 1 exit 1
;; ;;
esac esac
@ -294,13 +300,13 @@ build_memgraph () {
docker exec -u mg "$build_container" bash -c "rm -rf $MGBUILD_ROOT_DIR && mkdir -p $MGBUILD_ROOT_DIR" docker exec -u mg "$build_container" bash -c "rm -rf $MGBUILD_ROOT_DIR && mkdir -p $MGBUILD_ROOT_DIR"
echo "Copying project files..." echo "Copying project files..."
docker cp "$PROJECT_ROOT/." "$build_container:$MGBUILD_ROOT_DIR/" docker cp "$PROJECT_ROOT/." "$build_container:$MGBUILD_ROOT_DIR/"
# Change ownership of copied files so the mg user inside container can access them
docker exec -u root $build_container bash -c "chown -R mg:mg $MGBUILD_ROOT_DIR"
fi fi
# Change ownership of copied files so the mg user inside container can access them
docker exec -u root $build_container bash -c "chown -R mg:mg $MGBUILD_ROOT_DIR"
echo "Installing dependencies using '/memgraph/environment/os/$os.sh' script..." echo "Installing dependencies using '/memgraph/environment/os/$os.sh' script..."
docker exec -u root "$build_container" bash -c "$MGBUILD_ROOT_DIR/environment/os/$os.sh check TOOLCHAIN_RUN_DEPS || /environment/os/$os.sh install TOOLCHAIN_RUN_DEPS" docker exec -u root "$build_container" bash -c "$MGBUILD_ROOT_DIR/environment/os/$os.sh check TOOLCHAIN_RUN_DEPS || $MGBUILD_ROOT_DIR/environment/os/$os.sh install TOOLCHAIN_RUN_DEPS"
docker exec -u root "$build_container" bash -c "$MGBUILD_ROOT_DIR/environment/os/$os.sh check MEMGRAPH_BUILD_DEPS || /environment/os/$os.sh install MEMGRAPH_BUILD_DEPS" docker exec -u root "$build_container" bash -c "$MGBUILD_ROOT_DIR/environment/os/$os.sh check MEMGRAPH_BUILD_DEPS || $MGBUILD_ROOT_DIR/environment/os/$os.sh install MEMGRAPH_BUILD_DEPS"
echo "Building targeted package..." echo "Building targeted package..."
# Fix issue with git marking directory as not safe # Fix issue with git marking directory as not safe
@ -354,6 +360,33 @@ package_memgraph() {
docker exec -u mg "$build_container" bash -c "mkdir -p $container_output_dir && cd $container_output_dir && $ACTIVATE_TOOLCHAIN && $package_command" docker exec -u mg "$build_container" bash -c "mkdir -p $container_output_dir && cd $container_output_dir && $ACTIVATE_TOOLCHAIN && $package_command"
} }
package_docker() {
if [[ "$toolchain_version" == "v4" ]]; then
if [[ "$os" != "debian-11" && "$os" != "debian-11-arm" ]]; then
echo -e "Error: When passing '--toolchain v4' the 'docker' command accepts only '--os debian-11' and '--os debian-11-arm'"
exit 1
fi
else
if [[ "$os" != "debian-12" && "$os" != "debian-12-arm" ]]; then
echo -e "Error: When passing '--toolchain v5' the 'docker' command accepts only '--os debian-12' and '--os debian-12-arm'"
exit 1
fi
fi
local package_dir="$PROJECT_ROOT/build/output/$os"
# shellcheck disable=SC2012
local last_package_name=$(cd $package_dir && ls -t memgraph* | head -1)
local docker_build_folder="$PROJECT_ROOT/release/docker"
cd "$docker_build_folder"
./package_docker --latest --package-path "$package_dir/$last_package_name" --toolchain $toolchain_version --arch "${arch}64"
# shellcheck disable=SC2012
local docker_image_name=$(cd "$docker_build_folder" && ls -t memgraph* | head -1)
local docker_host_folder="$PROJECT_ROOT/build/output/docker/${arch}/${toolchain_version}"
local docker_host_image_path="$docker_host_folder/$docker_image_name"
mkdir -p "$docker_host_folder"
cp "$docker_build_folder/$docker_image_name" "$docker_host_folder"
echo "Docker images saved to $docker_host_image_path."
}
copy_memgraph() { copy_memgraph() {
local build_container="mgbuild_${toolchain_version}_${os}" local build_container="mgbuild_${toolchain_version}_${os}"
case "$1" in case "$1" in
@ -384,6 +417,7 @@ copy_memgraph() {
;; ;;
*) *)
echo "Error: Unknown flag '$1'" echo "Error: Unknown flag '$1'"
print_help
exit 1 exit 1
;; ;;
esac esac
@ -489,6 +523,7 @@ test_memgraph() {
;; ;;
*) *)
echo "Error: Unknown test '$1'" echo "Error: Unknown test '$1'"
print_help
exit 1 exit 1
;; ;;
esac esac
@ -547,6 +582,7 @@ while [[ $# -gt 0 ]]; do
*) *)
if [[ "$1" =~ ^--.* ]]; then if [[ "$1" =~ ^--.* ]]; then
echo -e "Error: Unknown option '$1'" echo -e "Error: Unknown option '$1'"
print_help
exit 1 exit 1
else else
command=$1 command=$1
@ -556,7 +592,9 @@ while [[ $# -gt 0 ]]; do
;; ;;
esac esac
done done
check_support os_toolchain_combo $os $toolchain_version if [[ "$os" != "all" ]]; then
check_support os_toolchain_combo $os $toolchain_version
fi
if [[ "$command" == "" ]]; then if [[ "$command" == "" ]]; then
echo -e "Error: Command not provided, please provide command" echo -e "Error: Command not provided, please provide command"
@ -580,23 +618,42 @@ echo "Using $docker_compose_cmd"
case $command in case $command in
build) build)
cd $SCRIPT_DIR cd $SCRIPT_DIR
git_ref_flag=""
while [[ "$#" -gt 0 ]]; do
case "$1" in
--git-ref)
git_ref_flag="--build-arg GIT_REF=$2"
shift 2
;;
*)
echo "Error: Unknown flag '$1'"
print_help
exit 1
;;
esac
done
if [[ "$os" == "all" ]]; then if [[ "$os" == "all" ]]; then
$docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml build $docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml build $git_ref_flag
else else
$docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml build mgbuild_${toolchain_version}_${os} $docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml build $git_ref_flag mgbuild_${toolchain_version}_${os}
fi fi
;; ;;
run) run)
cd $SCRIPT_DIR cd $SCRIPT_DIR
pull=false pull=false
if [[ "$#" -gt 0 ]]; then while [[ "$#" -gt 0 ]]; do
if [[ "$1" == "--pull" ]]; then case "$1" in
pull=true --pull)
else pull=true
echo "Error: Unknown flag '$1'" shift 1
exit 1 ;;
fi *)
fi echo "Error: Unknown flag '$1'"
print_help
exit 1
;;
esac
done
if [[ "$os" == "all" ]]; then if [[ "$os" == "all" ]]; then
if [[ "$pull" == "true" ]]; then if [[ "$pull" == "true" ]]; then
$docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml pull --ignore-pull-failures $docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml pull --ignore-pull-failures
@ -616,14 +673,19 @@ case $command in
stop) stop)
cd $SCRIPT_DIR cd $SCRIPT_DIR
remove=false remove=false
if [[ "$#" -gt 0 ]]; then while [[ "$#" -gt 0 ]]; do
if [[ "$1" == "--remove" ]]; then case "$1" in
remove=true --remove)
else remove=true
echo "Error: Unknown flag '$1'" shift 1
exit 1 ;;
fi *)
fi echo "Error: Unknown flag '$1'"
print_help
exit 1
;;
esac
done
if [[ "$os" == "all" ]]; then if [[ "$os" == "all" ]]; then
$docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml down $docker_compose_cmd -f ${arch}-builders-${toolchain_version}.yml down
else else
@ -662,8 +724,12 @@ case $command in
copy) copy)
copy_memgraph $@ copy_memgraph $@
;; ;;
package-docker)
package_docker
;;
*) *)
echo "Error: Unknown command '$command'" echo "Error: Unknown command '$command'"
print_help
exit 1 exit 1
;; ;;
esac esac

View File

@ -14,16 +14,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-rocky-9.3-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-rocky-9.3-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/rocky-9.3.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/rocky-9.3.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/rocky-9.3.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/rocky-9.3.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-18.04-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-18.04-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/ubuntu-18.04.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/ubuntu-18.04.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/ubuntu-18.04.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/ubuntu-18.04.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-20.04-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-20.04-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/ubuntu-20.04.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/ubuntu-20.04.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/ubuntu-20.04.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/ubuntu-20.04.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-22.04-arm64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-22.04-arm64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git --branch ${GIT_REF} clone https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/ubuntu-22.04-arm.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/ubuntu-22.04-arm.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/ubuntu-22.04-arm.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/ubuntu-22.04-arm.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -16,16 +16,14 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-${TOOL
&& rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-22.04-amd64.tar.gz && rm toolchain-${TOOLCHAIN_VERSION}-binaries-ubuntu-22.04-amd64.tar.gz
# Install toolchain run deps and memgraph build deps # Install toolchain run deps and memgraph build deps
ARG GIT_REF=master
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN git clone https://github.com/memgraph/memgraph.git \ RUN git clone --branch ${GIT_REF} https://github.com/memgraph/memgraph.git \
&& cd memgraph \ && cd memgraph \
&& ./environment/os/ubuntu-22.04.sh install TOOLCHAIN_RUN_DEPS \ && ./environment/os/ubuntu-22.04.sh install TOOLCHAIN_RUN_DEPS \
&& ./environment/os/ubuntu-22.04.sh install MEMGRAPH_BUILD_DEPS \ && ./environment/os/ubuntu-22.04.sh install MEMGRAPH_BUILD_DEPS \
&& cd .. && rm -rf memgraph && cd .. && rm -rf memgraph
# Add mgdeps-cache and bench-graph-api hostnames
RUN echo -e "10.42.16.10 mgdeps-cache\n10.42.16.10 bench-graph-api" >> /etc/hosts
# Create mg user and set as default # Create mg user and set as default
RUN useradd -m -s /bin/bash mg RUN useradd -m -s /bin/bash mg
USER mg USER mg

View File

@ -42,6 +42,10 @@ BuildRequires: systemd
%{nil} %{nil}
%endif %endif
%if 0%{?fedora} && 0%{?fedora} > 37
%global __brp_check_rpaths %{nil}
%endif
%if 0%{?fedora} && 0%{?fedora} < 35 %if 0%{?fedora} && 0%{?fedora} < 35
%global __os_install_post \ %global __os_install_post \
/usr/lib/rpm/brp-compress \ /usr/lib/rpm/brp-compress \

View File

@ -216,6 +216,18 @@ CLUSTER_DEALLOC() {
echo "Cluster dealloc DONE" echo "Cluster dealloc DONE"
} }
CLUSTER_NODES_CLEANUP() {
jepsen_control_exec="docker exec jepsen-control bash -c"
INFO "Deleting /jepsen/memgraph/store/* on jepsen-control"
$jepsen_control_exec "rm -rf /jepsen/memgraph/store/*"
for iter in $(seq 1 "$JEPSEN_ACTIVE_NODES_NO"); do
jepsen_node_name="jepsen-n$iter"
jepsen_node_exec="docker exec $jepsen_node_name bash -c"
INFO "Deleting /opt/memgraph/* on $jepsen_node_name"
$jepsen_node_exec "rm -rf /opt/memgraph/*"
done
}
# Initialize testing context by copying source/binary files. Inside CI, # Initialize testing context by copying source/binary files. Inside CI,
# Memgraph is tested on a single machine cluster based on Docker containers. # Memgraph is tested on a single machine cluster based on Docker containers.
# Once these tests will be part of the official Jepsen repo, the majority of # Once these tests will be part of the official Jepsen repo, the majority of
@ -241,15 +253,7 @@ case $1 in
;; ;;
cluster-nodes-cleanup) cluster-nodes-cleanup)
jepsen_control_exec="docker exec jepsen-control bash -c" CLUSTER_NODES_CLEANUP
INFO "Deleting /jepsen/memgraph/store/* on jepsen-control"
$jepsen_control_exec "rm -rf /jepsen/memgraph/store/*"
for iter in $(seq 1 "$JEPSEN_ACTIVE_NODES_NO"); do
jepsen_node_name="jepsen-n$iter"
jepsen_node_exec="docker exec $jepsen_node_name bash -c"
INFO "Deleting /opt/memgraph/* on $jepsen_node_name"
$jepsen_node_exec "rm -rf /opt/memgraph/*"
done
;; ;;
mgbuild) mgbuild)