gazebosim / gz-tools

Command line tools for the Gazebo libraries.
https://gazebosim.org
Apache License 2.0
15 stars 18 forks source link

[Garden] CLI `gz <command>` does not support `topic`/`service`/`launch` commands #111

Closed AndrejOrsula closed 2 years ago

AndrejOrsula commented 2 years ago

CLI gz <command> of Gazebo garden no longer supports topic, service and launch commands. These commands are still available in Ignition fortress via ign <command>.

Environment

Description

Steps to reproduce

  1. Here is a small Dockerfile based on instructions under https://gazebosim.org/docs/garden/install_ubuntu.
ARG UBUNTU_RELEASE=jammy
FROM ubuntu:${UBUNTU_RELEASE}

### Install necessary tools
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -yq --no-install-recommends \
        ca-certificates \
        gnupg \ 
        lsb-release \
        wget && \
    rm -rf /var/lib/apt/lists/*

### Add packages.osrfoundation.org to the apt sources list
RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null && \
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-prerelease $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-prerelease.list > /dev/null

### Install Gazebo
ARG GAZEBO_VERSION=garden
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -yq --no-install-recommends \
    gz-${GAZEBO_VERSION} && \
    rm -rf /var/lib/apt/lists/*

Build with the following variants (at least 1x garden and 1x fortress):

# Garden
$ docker build . -t "${USER}/gz:focal_garden" --build-arg UBUNTU_RELEASE=focal --build-arg GAZEBO_VERSION=garden
$ docker build . -t "${USER}/gz:jammy_garden" --build-arg UBUNTU_RELEASE=jammy --build-arg GAZEBO_VERSION=garden
# Fortress
$ docker build . -t "${USER}/gz:focal_fortress" --build-arg UBUNTU_RELEASE=focal --build-arg GAZEBO_VERSION=fortress
$ docker build . -t "${USER}/gz:jammy_fortress" --build-arg UBUNTU_RELEASE=jammy --build-arg GAZEBO_VERSION=fortress
  1. Observe that gz <command> for garden does not have topic, service and launch commands

    # Focal Garden
    $ docker run -it --rm "${USER}/gz:focal_garden" gz --commands
    log
    sdf
    gui
    plugin
    model
    msg
    fuel
    sim
    gazebo
    # Jammy Garden
    $ docker run -it --rm "${USER}/gz:jammy_garden" gz --commands
    fuel
    gui
    model
    msg
    plugin
    sdf
    sim
    gazebo
    log
  2. Observe that ign <commands> for fortress has these commands

# Focal Fortress
$ docker run -it --rm "${USER}/gz:focal_fortress" ign --commands
sdf
topic
service
fuel
launch
gui
model
log
plugin
msg
gazebo
# Jammy Fortress
$ docker run -it --rm "${USER}/gz:jammy_fortress" ign --commands
fuel
gazebo
gui
launch
model
msg
plugin
sdf
topic
service
log

Please, let me know if I misinterpreted something and if this behaviour is expected.

azeey commented 2 years ago

The cli is not part of gz-transport12-cli and it is a suggested package when installing libgz-tranpsport12. In your Dockerfile, you have --no-install-recommends, which might be preventing gz-transport12-cli from being installed.

@j-rivero would it be a good idea to make gz-transport12-cli and other -cli packages listed in the garden metapackage?

AndrejOrsula commented 2 years ago

Thank you very much @azeey!

You are correct that I am missing gz-transport12-cli (and gz-launch6-cli), both of which are listed as suggested packages. As they are suggested and not recommended, --no-install-recommends does not have an effect on installing them. In order to enable their installation, --install-suggests flag must be used because suggests are disabled by default in Ubuntu.

[SOLUTION] Therefore, either of these approaches will enable topic, service and launch commands.

apt install gz-garden gz-transport12-cli gz-launch6-cli
apt install --install-suggests gz-garden
apt install --no-install-recommends --install-suggests gz-garden

However, I would argue that these packages should be recommended or even required, mainly because apt install --install-suggests gz-garden brings along several other packages such as the entire TeX Live stack with all fonts and even a bunch of Ubuntu wallpapers.

Thank you again for your help.

j-rivero commented 2 years ago

Thanks @AndrejOrsula so much for the information. We are tracking changes and decisions that affects all the packaging in https://github.com/gazebosim/gz-tools/issues/111.

j-rivero commented 2 years ago

This has been fixed in 1.0.0~pre1-3 gz-garden release. The CI is now happy to test all the expected submodules: https://build.osrfoundation.org/job/gz_garden-install-pkg-focal-amd64/13/console#console-section-1