Skip to content

Commit 146c682

Browse files
authored
Merge pull request #22 from turlucode/develop
Version 3.0.1
2 parents 9eb6236 + 4baeb7d commit 146c682

File tree

6 files changed

+50
-23
lines changed

6 files changed

+50
-23
lines changed

.github/workflows/build_and_publish.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# More info https://github.com/orgs/python-poetry/discussions/4205
1+
# More info:
2+
# - https://github.com/orgs/python-poetry/discussions/4205
3+
# - https://github.com/orgs/python-poetry/discussions/4205#discussioncomment-911983
24

35
# Some info on variables:
46
# github.event.workflow_run.head_branch will give you the tag or branch name here
@@ -17,7 +19,7 @@ jobs:
1719
runs-on: ubuntu-latest
1820
strategy:
1921
matrix:
20-
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
22+
python-version: [ '3.9' ]
2123
steps:
2224
- name: Checkout code
2325
uses: actions/checkout@v4

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.0.1] - 2024-07-12
9+
10+
### Changed
11+
- Allow requests.get() to skip verification of the server's TLS certificate. Solves issues with self-signed certification in the chain.
12+
13+
### Fixed
14+
- Wrong functionality of the 'turludock --version'
15+
- Wrong helper messages in the argument parser
16+
817
## [3.0.0] - 2024-06-01
918

1019
### Added

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You can use _any_ version of ROS with _any_ Linux distribution, thanks to the am
88
power of Docker!
99

1010
# TL;DR
11-
## Install tool
11+
## Install tool - Python >= 3.9
1212
```
1313
pip install turludock
1414
```
@@ -25,10 +25,10 @@ turludock which ros
2525
turludock which cuda ROS_CODENAME
2626
```
2727
All commands have a `--help` support.
28-
> [Example YAML config](examples/noetic_nvidia_custom.yaml)
28+
> [Example YAML config](https://github.com/turlucode/ros-docker-gui/blob/master/examples/noetic_nvidia_custom.yaml)
2929
3030
## Run container
31-
[See here](#running-the-image-as-current-user) how to run a container.
31+
[See "Running the image (as current user)"](#running-the-image-as-current-user) on how to run a container.
3232

3333
# Getting Started
3434
The idea is to have HW accelerated GUIs with Docker. Generally it has proven that this is
@@ -71,7 +71,7 @@ Docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
7171

7272
ROS related GUI programs seem to working fine. Other programs like `meld` or `vscode` also seem to be working fine. There might be cases where some GUIs do not work as expected. Feel free to open a ticket so we can look into it.
7373

74-
For example, we know RViz is not ready for Wayland; hence we will need to use the `xcb` (X11) plugin instead of the one for Wayland and therefore we will use `QT_QPA_PLATFORM=xcb` for all QT applications. More info [here](#rviz-wayland-known-issues).
74+
For example, we know RViz is not ready for Wayland; hence we will need to use the `xcb` (X11) plugin instead of the one for Wayland and therefore we will use `QT_QPA_PLATFORM=xcb` for all QT applications. More info in section ["RViz Wayland known issues"](#rviz-wayland-known-issues).
7575

7676
## Supported ROS Images
7777

@@ -109,7 +109,7 @@ turludock generate --help
109109
## Tool is based on YAML configurations
110110
This tool uses a specific `.yaml` configuration to generate Dockerfiles or build Docker images.
111111

112-
You can find a [typical configuration](examples/noetic_nvidia_custom.yaml) in the examples folder.
112+
You can find a [typical configuration](https://github.com/turlucode/ros-docker-gui/blob/master/examples/noetic_nvidia_custom.yaml) in the examples folder.
113113

114114
### Build or generate from presets
115115
This tool already provides preconfigured `.yaml` files that can be used directly to generate
@@ -142,7 +142,7 @@ No problemo, use:
142142
```sh
143143
turludock build -c custom.yaml --tag CUSTOM_TAG
144144
```
145-
> How to create a custom yaml configuration? [Check the example.](examples/noetic_nvidia_custom.yaml)
145+
> How to create a custom yaml configuration? [Check the example.](https://github.com/turlucode/ros-docker-gui/blob/master/examples/noetic_nvidia_custom.yaml)
146146
147147
Or if you want to generate the Dockerfile and its required assets for manual build use:
148148
```sh
@@ -152,7 +152,7 @@ The `FOLDER_PATH` now contains all necessary files to run a custom `Docker build
152152

153153
# Running the image (as current user)
154154
## Mesa
155-
> :pineapple: **Important:** Make sure your YAML configuration uses: [`gpu_driver: mesa`](examples/noetic_nvidia_custom.yaml#L15)
155+
> :pineapple: **Important:** Make sure your YAML configuration uses: [`gpu_driver: mesa`](https://github.com/turlucode/ros-docker-gui/blob/master/examples/noetic_nvidia_custom.yaml#L15)
156156
157157
### X11
158158
To run the ROS Docker container with X11 support use:
@@ -174,14 +174,14 @@ _Important Remarks_:
174174
- The `DOCKER_USER_*` variables are used to run the container as the current user.
175175
- Please note that you need to pass the `Xauthority` to the correct user's home directory.
176176
- You may need to run `xhost si:localuser:$USER` or worst case `xhost local:root` if get errors like `Error: cannot open display`.
177-
- See also [this section](#other-options) for other options.
177+
- See also section ["Other options"](#other-options) for other options.
178178

179179
### Wayland
180-
> **NOTE:** Wayland support is still a bit experimental! See [known limitations](#known-wayland-limitations).
180+
> **NOTE:** Wayland support is still a bit experimental! See section ["Known Wayland limitations"](#known-wayland-limitations).
181181
182182
ROS GUI on Wayland is still problematic and that is why we are going to use [`xwayland`](https://wayland.freedesktop.org/xserver.html).
183183
Make sure you have installed `xhost`.
184-
Make also sure the user has the rights to draw to the display; [more info here](#x11-error-cannot-open-display).
184+
Make also sure the user has the rights to draw to the display; more info in section ["X11: Error: cannot open display"](#x11-error-cannot-open-display).
185185

186186
To run the ROS Docker container with Wayland support use:
187187

@@ -218,10 +218,10 @@ _Important Remarks_:
218218
- We need to start `terminator` with `dbus-launch` for Ubuntu versions less than 24.04, i.e. for versions < `jazzy`.
219219
- The `QT_QPA_PLATFORM=xcb` is for now intentionally as discussed.
220220
For this reason also the `qtwayland5` package is not installed in our Docker images.
221-
- See also [this section](#other-options) for other options.
221+
- See also section ["Other options"](#other-options) for other options.
222222

223223
## NVIDIA GPU
224-
> :pineapple: **Important:** Make sure your YAML configuration uses: [`gpu_driver: nvidia`](examples/noetic_nvidia_custom.yaml#L15)
224+
> :pineapple: **Important:** Make sure your YAML configuration uses: [`gpu_driver: nvidia`](https://github.com/turlucode/ros-docker-gui/blob/master/examples/noetic_nvidia_custom.yaml#L15)
225225
226226
For machines that are using NVIDIA graphics cards we need to have the [nvidia-container-toolkit] installed.
227227

@@ -246,14 +246,14 @@ _Important Remarks_:
246246
- Please note that you need to pass the `Xauthority` to the correct user's home directory.
247247
- You may need to run `xhost si:localuser:$USER` or worst case `xhost local:root` if get errors like `Error: cannot open display`
248248
- Adapt `--gpus all` to your needs
249-
- See also [this section](#other-options) for other options.
249+
- See also section ["Other options"](#other-options) for other options.
250250

251251
### Wayland
252-
> **NOTE:** Wayland support is still a bit experimental! See [known limitations](#known-wayland-limitations).
252+
> **NOTE:** Wayland support is still a bit experimental! See section ["Known Wayland limitations"](#known-wayland-limitations).
253253
254254
ROS GUI on Wayland is still problematic and that is why we are going to use [`xwayland`](https://wayland.freedesktop.org/xserver.html).
255255
Make sure you have installed `xhost`.
256-
Make also sure the user has the rights to draw to the display; [more info here](#x11-error-cannot-open-display).
256+
Make also sure the user has the rights to draw to the display; more info in section ["X11: Error: cannot open display"](#x11-error-cannot-open-display).
257257

258258
To run the ROS Docker container with X11 support use:
259259
````sh
@@ -288,7 +288,7 @@ For this reason also the `qtwayland5` package is not installed in our Docker ima
288288
- Please note that you need to pass the `Xauthority` to the correct user's home directory.
289289
- You may need to run `xhost si:localuser:$USER` or worst case `xhost local:root` if get errors like `Error: cannot open display`
290290
- Adapt `--gpus all` to your needs
291-
- See also [this section](#other-options) for other options.
291+
- See also section ["Other options"](#other-options) for other options.
292292

293293
## Other options
294294
### Mount your ssh-keys
@@ -396,6 +396,7 @@ After [installing poetry](https://python-poetry.org/docs/#installation) you can
396396
poetry install
397397
```
398398
After that, you are good to go!
399+
> Hint: You can [install pynev](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation) if you want to check multiple python versions.
399400
### Coding style enforcement
400401
Check and enforce the coding style with static analysis:
401402
```sh

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "turludock"
3-
version = "3.0.0"
3+
version = "3.0.1"
44
description = "Builds ROS docker images that support GUI with either X11 or Wayland."
55
authors = [
66
"Athanasios <[email protected]>",

turludock/command_line_arguments_parser.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
from turludock.helper_functions import get_program_version
88

99

10+
class PrintVersionAction(argparse.Action):
11+
"""Action class to print the version of the program."""
12+
13+
def __call__(self, parser, namespace, values, option_string=None):
14+
"""The actual call to the action."""
15+
logger.info(f"turludock v{get_program_version()}")
16+
parser.exit()
17+
18+
1019
def print_command_help(args: argparse.Namespace, parser: dict) -> None:
1120
"""Print help message for the command specified by the user.
1221
@@ -83,7 +92,9 @@ def parse_command_line_args() -> Tuple[argparse.Namespace, bool]:
8392
parser["main"] = argparse.ArgumentParser(
8493
description="ROS docker container generator " + f"| turludock v{get_program_version()} | TurluCode"
8594
)
86-
parser["main"].add_argument("--version", action="store_true", default=False, help="Enable debug mode")
95+
parser["main"].add_argument(
96+
"--version", action=PrintVersionAction, nargs=0, help="Show the program version and exit"
97+
)
8798

8899
subparsers = parser["main"].add_subparsers(title="Commands", description="", help="additional help", dest="command")
89100
subparsers.required = True # Ensure that a sub-command is required
@@ -97,7 +108,7 @@ def parse_command_line_args() -> Tuple[argparse.Namespace, bool]:
97108
"-e",
98109
type=str,
99110
metavar="CONFIG_NAME",
100-
help='Choose an existing pre-configuration. Check with "list-pre-configs"',
111+
help='Choose an existing pre-configuration. Check with "turludock which presets"',
101112
)
102113
parser["build"].add_argument(
103114
"--tag", type=str, metavar="TAG", help='Name and optionally a tag (format: "name:tag")'
@@ -122,7 +133,7 @@ def parse_command_line_args() -> Tuple[argparse.Namespace, bool]:
122133
"-e",
123134
type=str,
124135
metavar="CONFIG_NAME",
125-
help='Choose an existing pre-configuration. Check with "list-pre-configs"',
136+
help='Choose an existing pre-configuration. Check with "turludock which presets"',
126137
)
127138
parser["gen"].add_argument(
128139
"path",

turludock/helper_functions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ def get_llvm_supported_versions() -> List[int]:
122122
"""
123123
# Get LLVM install script which contains info about the supported versions
124124
url = "https://apt.llvm.org/llvm.sh"
125-
response = requests.get(url, timeout=10)
125+
try:
126+
response = requests.get(url, timeout=10, verify=False)
127+
except Exception as e:
128+
logger.error(f"Could not get supported LLVM versions. Requests.get() error: {e}")
129+
raise
126130

127131
# Check if the request was successful
128132
if response.status_code != 200:

0 commit comments

Comments
 (0)