Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
## Contributing to Picodata
This document describes contributing to Picodata
### Building Picodata from source
#### Required build tools
- Rust and Cargo 1.59 or newer
- Cmake 3.16 or newer
- gcc, g++
- libstc++-static
#### Prerequisites for CentOS 8
Use the following commands to install the required build prerequisites. Note that you'll need recent Rust and Cargo versions installed using the recommended way from [rustup.rs](rustup.rs):
```
sudo dnf config-manager --set-enabled powertools
sudo dnf in -y gcc gcc-c++ make cmake git patch libstdc++-static
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
```
#### Prerequisites for Ubuntu 22.04
Use the following command to install the required build prerequisites. Note that Ubuntu 22.04 provides recent Rust and Cargo versions, so it's preferable to install it via `apt-get`:
```
sudo apt-get install build-essential cargo git cmake -y
```
#### Prerequisites for Alt Workstation p10
Use the following commands to install the required build prerequisites. Note that you'll need recent Rust and Cargo versions installed using the recommended way from [rustup.rs](rustup.rs):
```
su -
apt-get install gcc gcc-c++ cmake git patch libstdc++10-devel-static libgomp10-devel-static -y && exit
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
```
#### Getting and building the source code
```
git clone https://git.picodata.io/picodata/picodata/picodata.git
cd picodata
git submodule update --init
```
Compile the project:
```
cargo build
```
This will build the debug version. If you want the release version, try this instead:
```
cargo build --release
```
The resulting binaries should appear under the `target` subdirectory.
### Integration testing with pytest
The following refers to Ubuntu 20.04 LTS. The mileage with other distributions may vary.
#### Installation
1. Install Python 3.10
```
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10 python3.10-distutils
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.10 get-pip.py
```
3. Install pipenv:
```
python3.10 -m pip install pipenv==2022.4.8
```
4. Install dependencies
```
python3.10 -m pipenv install --deploy
```
#### Adding dependencies
```bash
python3.10 -m pipenv install <dependency-package-name>
```
#### Running
```bash
python3.10 -m pipenv run pytest
python3.10 -m pipenv run lint
```
or
```bash
python3.10 -m pipenv shell
# A new shell will be opened inside the pipenv environment
pytest
pipenv run lint
```
#### Running tests in parallel with pytest-xdist
```bash
python3.10 -m pipenv run pytest -n 20
```