Skip to content

Commit 68c61fd

Browse files
Fix documentation after review
1 parent ef13ea4 commit 68c61fd

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

presto-native-execution/.devcontainer/README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,33 @@
22

33
> **_NOTE:_** For this to work you need CLion 2025.2.2 or greater.
44
5-
If you can't or want't to build the development environment on your machine, but still using a modern IDE "natively", you can use dev-containers. With them you can have your IDE frontend working against CLion backend running on a docker container. In order to set it up, execute
5+
If you can't build, or want to build the development environment on your machine, you can use dev-containers. With them, you can have your IDE frontend working against a CLion backend running on a docker container. To set it up, run the following command:
66

77
```sh
88
docker compose build centos-native-dependency
99
```
10-
Once the image is built, open the `presto-native-execution` module on CLion. Then, right click on `.devcontainer\devcontainer.json` and in the contextual menu select `Dev Containers->Create Dev Container and mount sources...->CLion`. Wait for the container to be up and running.
10+
Once the image is built, open the `presto-native-execution` module on CLion.
11+
12+
Right-click on `.devcontainer\devcontainer.json`, and in the contextual menu select `Dev Containers->Create Dev Container and mount sources...->CLion`. Wait for the container to be up and running before you continue.
1113

1214
The source code is mounted from your machine so any change made into it from the dev-container will also be on your machine.
1315

1416
## Debug or execute `presto_server`
1517

16-
Reload CMake project and configure the `presto_server` executable as defined [here](https://github.com/mblanco-denodo/presto/tree/master/presto-native-execution). Compile the project as you need. Then, execute the script ./devcontainer/install-shared-libs.sh inside the container. This will create a directory /runtime-libraries and copy all the shared libraries needed for your compilation runtime in there. Edit the `presto_server` configuration to add the environment variable `LD_LIBRARY_PATH=/runtime-libraries`. This way, you'll have the same environment as distributed prestissimo images.
18+
Reload CMake project and configure the `presto_server` executable. See [Setup Presto with IntelliJ IDEA and Prestissimo with CLion](https://github.com/prestodb/presto/tree/master/presto-native-execution#setup-presto-with-intellij-idea-and-prestissimo-with-clion). Compile the project as needed.
19+
20+
Then, execute the script `./devcontainer/install-shared-libs.sh` inside the container. This will create a directory `/runtime-libraries` and copy all the shared libraries needed for your compilation runtime in there.
21+
22+
Edit the `presto_server` configuration to add the environment variable `LD_LIBRARY_PATH=/runtime-libraries`. This way, you'll have the same environment as distributed prestissimo images.
1723

1824
## Known errors
19-
- In some cases an error such as `Computing backend... error. Collection contains no element matching the predicate` can appear. The feature is still in beta. In this case, the container will be created and running, but might have been an issue starting the CLion backend inside the container. To resolve this issue, close CLion, reopen it and in the `Welcome to CLion` window go to `Remote Development (beta)->Dev Containers`. You should see that the container `Presto C++ Dev Container` is up and running, so connect to it. In this case, the backend should start properly and the project should be opened.
25+
- In some cases an error such as `Computing backend... error. Collection contains no element matching the predicate` can appear. The feature is still in beta. In this case, the container will be created and running, but there might have been an issue starting the CLion backend inside the container.
26+
27+
To resolve this issue, close CLion and reopen it.
28+
29+
In the `Welcome to CLion` window go to `Remote Development (beta)->Dev Containers`. You should see that the container `Presto C++ Dev Container` is up and running, so connect to it. In this case, the backend should start properly and the project should be opened.
2030

21-
- In some cases you might to manually add the mounted repo to the trusted directories for the dev-container
31+
- In you can't use git inside the container, you need to manually add the mounted repo to the trusted directories for the dev-container
2232
```sh
2333
git config --global --add safe.directory /workspace/presto
2434
```
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/bin/bash
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
213
# Before executing this script, you should compile presto_server
314
# Copy shared libs to the directory /runtime-libraries
4-
mkdir /runtime-libraries && \
5-
bash -c '!(LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd ../cmake-build-debug/presto_cpp/main/presto_server | grep "not found")' && \
6-
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd ../cmake-build-debug/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }'
15+
mkdir /runtime-libraries &&
16+
bash -c '!(LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd ../cmake-build-debug/presto_cpp/main/presto_server | grep "not found")' &&
17+
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd ../cmake-build-debug/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }'

presto-native-execution/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ Run CLion:
243243

244244
![ScreenShot](docs/images/cl_clangformat_switcherenable.png)
245245

246-
### Setup Presto C ++ with dev containers usign [CLion](https://www.jetbrains.com/clion/)
246+
### Setup Presto C ++ with dev containers using [CLion](https://www.jetbrains.com/clion/)
247247

248-
You can find the setup configuration for prestissimo and CLion [here](.devcontainer/README.md).
248+
See [How to develop Presto C++ with dev-containers in CLion](.devcontainer/README.md).
249249

250250
### Run Presto Coordinator + Worker
251251
* Note that everything below can be done without using IDEs by running command line commands (not in this readme).

0 commit comments

Comments
 (0)