Skip to content

Commit e86e1f8

Browse files
authored
Memgraph 3.1.1 (#1199)
1 parent 34c0290 commit e86e1f8

File tree

10 files changed

+331
-185
lines changed

10 files changed

+331
-185
lines changed

pages/advanced-algorithms.mdx

+32-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Advance your graph analysis capabilities with Memgraph's tailored a
55

66
import { Steps } from 'nextra/components'
77
import {CommunityLinks} from '/components/social-card/CommunityLinks'
8-
8+
import { Callout } from 'nextra/components'
99

1010
# Advanced algorithms
1111

@@ -47,14 +47,15 @@ programming languages and they are all runnable inside Memgraph.
4747

4848
### Install MAGE
4949

50-
If you started Memgraph with the `memgraph-platform` or `memgraph-mage` Docker
50+
If you started Memgraph with the `memgraph-mage` Docker
5151
image, MAGE is already included and you can skip to step 3.
5252

5353
If you are using Linux, you can [install MAGE from
5454
source](/advanced-algorithms/install-mage#linux).
5555

56-
The execution of graph algorithms can be accelerated with the GPU by using the
57-
[Memgraph X NVIDIA cuGraph](/advanced-algorithms/install-mage#mage--nvidia-cugraph) version of the library.
56+
<Callout type="info">
57+
We currently do not produce MAGE images with cuGraph (since version 1.3). If this is something you require, please raise an [issue](https://github.com/memgraph/mage/issues)
58+
</Callout>
5859

5960
### Load query modules
6061

@@ -82,6 +83,33 @@ MAGE compatibility with Memgraph versions.
8283

8384
| MAGE version | Memgraph version |
8485
|--------------|-------------------|
86+
| 3.1 | 3.1 |
87+
| 3.0 | 3.0 |
88+
| 1.22 | 2.22 |
89+
| 1.22.1 | 2.22.1 |
90+
| 1.21 | 2.21 |
91+
| 1.20.1 | 2.20.1 |
92+
| 1.20 | 2.20 |
93+
| 1.19 | 2.19 |
94+
| 1.18.1 | 2.18.1 |
95+
| 1.18 | 2.18 |
96+
| 1.17 | 2.17 |
97+
| 1.16.1 | 2.16.1 |
98+
| 1.16 | 2.16 |
99+
| 1.15.2 | 2.15.2 |
100+
| 1.15.1 | 2.15.1 |
101+
| 1.15 | 2.15 |
102+
| 1.14.1 | 2.14.1 |
103+
| 1.14 | 2.14 |
104+
| 1.13 | 2.13 |
105+
| 1.12.1 | 2.12.1 |
106+
| 1.12 | 2.12 |
107+
| 1.11.1 | 2.11 |
108+
| 1.11.0 | 2.11 |
109+
| 1.10 | 2.10.1 |
110+
| 1.9 | 2.10.0 |
111+
| 1.8 | 2.9 |
112+
| 1.7 | 2.8 |
85113
| >= 1.6 | >= 2.5.2 |
86114
| >= 1.4 | >= 2.4.0 |
87115
| >= 1.0 | >= 2.0.0 |

pages/advanced-algorithms/available-algorithms/migrate.mdx

+55
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,61 @@ CREATE (u1)-[:FRIENDS_WITH]->(u2);
9898

9999
---
100100

101+
### `neo4j()`
102+
103+
With the `migrate.neo4j()` procedure, you can access Neo4j and migrate your data to Memgraph.
104+
The resulting nodes and edges are converted into a stream of rows which can include labels, properties, and primitives.
105+
**Streaming of raw node and relationship objects is not supported**, and users are advised to migrate all the necessary identifiers
106+
in order to recreate the same graph in Memgraph.
107+
108+
{<h4 className="custom-header"> Input: </h4>}
109+
110+
- `label_or_rel_or_query: str` ➡ Label name (written in format `(:Label)`), relationship name (written in format `[:rel_type]`) or a plain cypher query.
111+
- `config: mgp.Map` ➡ Connection parameters (as in `gqlalchemy.Neo4j`). Notable parameters are `host[String]` and `port[Integer]`.
112+
- `config_path` ➡ Path to a JSON file containing configuration parameters.
113+
- `params: mgp.Nullable[mgp.Any] (default=None)` ➡ Query parameters (if applicable).
114+
115+
{<h4 className="custom-header"> Output: </h4>}
116+
117+
- `row: mgp.Map` ➡ The result table as a stream of rows.
118+
- When retrieving nodes using the `(:Label)` syntax, row will have the following keys: `labels` and `properties`.
119+
- When retrieving relationships using the `[:REL_TYPE]` syntax, row will have the following keys: `from_labels`, `to_labels`, `from_properties`, `to_properties` and `edge_properties`.
120+
- When retrieving results using a plain Cypher query, row will have keys identical to the returned column names from the Cypher query.
121+
122+
{<h4 className="custom-header"> Usage: </h4>}
123+
124+
#### Retrieve nodes of certain label and create them in Memgraph
125+
```cypher
126+
CALL migrate.neo4j('(:Person)', {host: 'localhost', port: 7687})
127+
YIELD row
128+
WITH row.labels AS labels, row.properties as props
129+
CREATE (n:labels) SET n += row.props
130+
```
131+
132+
#### Retrieve relationships of certain type and create them in Memgraph
133+
```cypher
134+
CALL migrate.neo4j('[:KNOWS]', {host: 'localhost', port: 7687})
135+
YIELD row
136+
WITH row.from_labels AS from_labels,
137+
row.to_labels AS to_labels,
138+
row.from_properties AS from_properties,
139+
row.to_properties AS to_properties,
140+
row.edge_properties AS edge_properties
141+
MATCH (p1:Person {id: row.from_properties.id})
142+
MATCH (p2:Person {id: row.to_properties.id})
143+
CREATE (p1)-[r:KNOWS]->(p2)
144+
SET r += edge_properties;
145+
```
146+
147+
#### Retrieve information from Neo4j using an arbitrary Cypher query
148+
```cypher
149+
CALL migrate.neo4j('MATCH (n) RETURN count(n) as cnt', {host: 'localhost', port: 7687})
150+
YIELD row
151+
RETURN row.cnt as cnt;
152+
```
153+
154+
---
155+
101156
### `oracle_db()`
102157

103158
With the `migrate.oracle_db()` procedure, you can access Oracle DB and migrate your data to Memgraph.

pages/advanced-algorithms/install-mage.mdx

+32-153
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ import { Callout } from 'nextra/components'
1111
Use MAGE with an instance installed within a [Docker container](#docker) or on
1212
[Linux](#linux).
1313

14-
The execution of graph algorithms can be accelerated with the GPU, by using the
15-
[Memgraph X NVIDIA
16-
cuGraph](#mage--nvidia-cugraph) version of the
17-
library.
18-
1914
## Docker
2015

2116
[Install Memgraph with Docker](/getting-started/install-memgraph/docker) using
@@ -27,11 +22,11 @@ data.
2722

2823
You can download a specific version of MAGE
2924

30-
For example, if you want to download version `1.1`, you should run the following
25+
For example, if you want to download version `3.1.1`, you should run the following
3126
command:
3227

3328
```shell
34-
docker run -p 7687:7687 --name memgraph memgraph/memgraph-mage:1.1
29+
docker run -p 7687:7687 --name memgraph memgraph/memgraph-mage:3.1.1-memgraph-3.1.1
3530
```
3631

3732
</Callout>
@@ -65,7 +60,7 @@ Run the following commands:
6560
```bash
6661
sudo apt-get update && sudo apt-get install -y \
6762
libcurl4 \
68-
libpython3.9 \
63+
libpython3.12 \
6964
libssl-dev \
7065
openssl \
7166
build-essential \
@@ -78,8 +73,10 @@ sudo apt-get update && sudo apt-get install -y \
7873
python3-dev \
7974
clang \
8075
git \
81-
--no-install-recommends \
82-
&& sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
76+
pkg-config \
77+
uuid-dev \
78+
libxmlsec1-dev xmlsec1 \
79+
--no-install-recommends
8380
```
8481

8582
{<h3 className="custom-header">Download the MAGE source code</h3>}
@@ -90,23 +87,41 @@ Clone the [MAGE source code](https://github.com/memgraph/mage) from GitHub:
9087
git clone --recurse-submodules https://github.com/memgraph/mage.git && cd mage
9188
```
9289

90+
{<h3 className="custom-header">Set up the toolchain</h3>}
91+
92+
Download and install the [Memgraph Toolchain](https://memgraph.com/docs/getting-started/build-memgraph-from-source#toolchain-installation-procedure):
93+
```bash
94+
curl -L https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-ubuntu-24.04-amd64.tar.gz -o toolchain.tar.gz
95+
sudo tar xzvfm toolchain.tar.gz -C /opt
96+
```
97+
98+
Install runtime dependencies for the toolchain:
99+
```bash
100+
cd mage
101+
sudo .cpp/memgraph/environment/os/install_deps.sh install TOOLCHAIN_RUN_DEPS
102+
```
103+
93104
{<h3 className="custom-header">Install Rust and Python dependencies</h3>}
94105

95106
Run the following command to install Rust and Python dependencies:
96107

97108
```shell
98-
curl https://sh.rustup.rs -sSf | sh -s -- -y \
99-
&& export PATH="/root/.cargo/bin:${PATH}" \
100-
&& python3 -m pip install -r /mage/python/requirements.txt \
101-
&& python3 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cu102.html \
109+
curl https://sh.rustup.rs -sSf | sh -s -- -y
110+
export PATH="/root/.cargo/bin:${PATH}"
111+
python3 -m pip install -r python/requirements.txt
112+
python3 -m pip install -r cpp/memgraph/src/auth/reference_modules/requirements.txt
113+
python3 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-2.3.0+cpu.html
114+
python3 -m pip install dgl -f https://data.dgl.ai/wheels/torch-2.3/repo.html
102115
```
103116

104117
{<h3 className="custom-header">Run the `setup` script</h3>}
105118

106119
Run the following command:
107120

108121
```shell
109-
sudo python3 setup build -p /usr/lib/memgraph/query_modules
122+
source /opt/toolchain-v6/activate
123+
python3 setup build
124+
sudo cp -r dist/* /usr/lib/memgraph/query_modules
110125
```
111126

112127
<Callout type="info">
@@ -116,13 +131,13 @@ If you don't need all of the algorithms you can build only some of them based on
116131
To build C++ based algorithms run:
117132

118133
```shell
119-
sudo python3 setup build -p /usr/lib/memgraph/query_modules --lang cpp
134+
python3 setup build --lang cpp
120135
```
121136

122137
To build Python based algorithms run:
123138

124139
```shell
125-
sudo python3 setup build -p /usr/lib/memgraph/query_modules --lang python
140+
python3 setup build --lang python
126141
```
127142

128143
</Callout>
@@ -152,139 +167,3 @@ If your changes are not loaded, make sure to restart the instance by running
152167
`systemctl stop memgraph` and `systemctl start memgraph`.
153168

154169
</Steps>
155-
156-
## MAGE × NVIDIA cuGraph on Docker
157-
158-
<Callout type="info">
159-
160-
At the moment, no new images are built. If you would benefit from new images,
161-
please let us know by creating a GitHub issue on the [MAGE
162-
repository](https://github.com/memgraph/mage).
163-
164-
</Callout>
165-
166-
Follow this guide to install Memgraph with [**NVIDIA
167-
cuGraph**](https://github.com/rapidsai/cugraph) GPU-powered graph algorithms.
168-
169-
<Steps>
170-
171-
{<h3 className="custom-header">Prerequisites</h3>}
172-
173-
To be able to run cuGraph analytics, make sure you have compatible
174-
infrastructure. The exact system requirements are available at the [**NVIDIA
175-
RAPIDS site**](https://rapids.ai/start.html#requirements), and include an NVIDIA
176-
Pascal (or better) GPU and up-to-date CUDA & NVIDIA drivers.
177-
178-
If you want to run MAGE × NVIDIA cuGraph in Docker, install:
179-
180-
- Docker
181-
- Official [**NVIDIA driver**](https://www.nvidia.com/download/index.aspx) for
182-
your operating system.
183-
- To run on NVIDIA-powered GPUs, RAPIDS requires Docker CE v19.03+ and
184-
[**nvidia-container-toolkit**](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker)
185-
installed.
186-
- Legacy Docker CE v17-18 users require the installation of the
187-
[**nvidia-docker2**](<https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)>)
188-
package.
189-
190-
{<h3 className="custom-header">Download the image from Docker Hub</h3>}
191-
192-
Pull the image and run it:
193-
194-
```shell
195-
docker run --rm --gpus all -p 7687:7687 -p 7444:7444 memgraph/memgraph-mage:1.3-cugraph-22.02-cuda-11.5
196-
```
197-
198-
Depending on your environment, different versions of MAGE-cuGraph-CUDA can be
199-
installed:
200-
201-
```shell
202-
docker run --gpus all -p 7687:7687 -p 7444:7444 memgraph/memgraph-mage:${MAGE_VERSION}-cugraph-${CUGRAPH_VERSION}-cuda-${CUDA_VERSION}
203-
```
204-
205-
To see the available versions, explore Memgraph's Docker Hub and search for the
206-
images tagged [**memgraph-mage**](https://hub.docker.com/r/memgraph/memgraph-mage/tags).
207-
208-
</Steps>
209-
210-
## MAGE × NVIDIA cuGraph on Linux
211-
212-
<Callout type="info">
213-
214-
At the moment, no new images are built. If you would benefit from new images,
215-
please let us know by creating a GitHub issue on the [MAGE
216-
repository](https://github.com/memgraph/mage).
217-
218-
</Callout>
219-
220-
To use the MAGE × [**NVIDIA cuGraph**](https://github.com/rapidsai/cugraph) with
221-
[installed Linux based Memgraph package](https://memgraph.com/download) you need
222-
to install it natively from the source
223-
224-
<Steps>
225-
226-
{<h3 className="custom-header">Prerequisites</h3>}
227-
228-
To be able to run cuGraph analytics, make sure you have compatible
229-
infrastructure. The exact system requirements are available at the [**NVIDIA
230-
RAPIDS site**](https://rapids.ai/start.html#requirements), and include an NVIDIA
231-
Pascal (or better) GPU and up-to-date CUDA & NVIDIA drivers.
232-
233-
If building MAGE × NVIDIA cuGraph locally, these requirements apply (tested on
234-
Ubuntu):
235-
236-
If you want to build MAGE × NVIDIA cuGraph locally, install:
237-
238-
- Official [**NVIDIA driver**](https://www.nvidia.com/download/index.aspx) for
239-
your operating system.
240-
- [**CMake**](https://cmake.org/) version above 3.20
241-
- [**NVIDIA CUDA developer toolkit**](https://developer.nvidia.com/cuda-toolkit)
242-
– CUDA version 11.6
243-
- System dependencies: `libblas-dev`, `liblapack-dev`, `libboost-all-dev`
244-
- [**NVIDIA NCCL communications library**](https://developer.nvidia.com/nccl)
245-
246-
{<h3 className="custom-header">Make sure the instance is not running</h3>}
247-
248-
Algorithms and query modules will be loaded into a Memgraph instance on startup
249-
once you install MAGE, so make sure your instances are not running.
250-
251-
{<h3 className="custom-header">Download the source code</h3>}
252-
253-
Download the MAGE source code from [**GitHub**](https://github.com/memgraph/mage):
254-
255-
```
256-
git clone https://github.com/memgraph/mage.git
257-
```
258-
259-
{<h3 className="custom-header">Run the `setup` script</h3>}
260-
261-
Run the script to generate a `dist` directory with all the needed files:
262-
```shell
263-
python3 setup build -p /usr/lib/memgraph/query_modules --gpu
264-
```
265-
266-
It will also copy the contents of the newly created `dist` directory to
267-
`/usr/lib/memgraph/query_modules`.
268-
269-
The `--gpu` flag enables building the cuGraph dependencies and creating the
270-
shared library with cuGraph algorithms that are loaded into Memgraph.
271-
272-
If something isn't installed properly, the `setup` script will stop the
273-
installation process. If you have any questions, contact us on
274-
**[Discord](https://discord.gg/memgraph).**
275-
276-
{<h3 className="custom-header">Start a Memgraph instance</h3>}
277-
278-
Algorithms and query modules will be loaded into a Memgraph instance on startup
279-
280-
If your instance was already running you will need to execute the following
281-
query to load them:
282-
283-
```
284-
CALL mg.load_all();
285-
```
286-
287-
If your changes are not loaded, make sure to restart the instance by running
288-
`systemctl stop memgraph` and `systemctl start memgraph`.
289-
290-
</Steps>

0 commit comments

Comments
 (0)