Skip to content

[cli] rtw workspace create#169

Merged
destogl merged 50 commits intomasterfrom
rtw_ws_create
Jun 28, 2024
Merged

[cli] rtw workspace create#169
destogl merged 50 commits intomasterfrom
rtw_ws_create

Conversation

@muritane
Copy link
Copy Markdown
Contributor

@muritane muritane commented Feb 5, 2024

This PR adds the create verb to the workspace command of rtwcli, enhancing it with the capability to efficiently create ROS workspaces. This new functionality supports not just local and Docker-based environment setups but also integrates directly with version control systems for repository management. It specifically addresses the need to automate the fetching and configuration of ROS packages through .repos files, streamlining the setup process for complex projects.

Enhancements:

  • Integration with Docker for isolated workspace environments.
  • Direct support for .repos files, enabling the automatic import of ROS packages from specified repository URLs and branches.

Usage:
rtw workspace create --ws-folder <path_to_workspace> --ros-distro <distribution> [options]

Currently targeted options:

  • --docker: Create workspace(s) in a docker environment
  • --repos-containing-repository-url: URL to the repository containing the repos files
    • Main ws .repos format: {repo_name}.{ros_distro}.repos
    • Upstream ws .repos format: {repo_name}.{ros_distro}.upstream.repos
  • --repos-branch: Branch of the repository containing the .repos files

Example usage:

rtw workspace create \
  --ws-folder dummy_ws \
  --ros-distro humble \
  --docker \
  --repos-containing-repository-url git@github.com:StoglRobotics/sr_dummy_packages.git \
  --repos-branch dummy_demo_pkg
  • This example demonstrates creating a humble ROS distribution workspace named dummy_ws within a Docker environment, utilizing .repos files from the sr_dummy_packages repository on the dummy_demo_pkg branch.

Example usage with standalone and robot user:

rtw workspace create \
  --ws-folder dummy_ws \
  --ros-distro humble \
  --docker \
  --repos-containing-repository-url git@github.com:StoglRobotics/sr_dummy_packages.git \
  --repos-branch dummy_demo_pkg \
  --standalone \
  --user-override-name robot

Committing the container from the command above for exporting:

docker commit rtw_dummy_ws_final-instance rtw_dummy_ws_export

Importing the image from the command above:

rtw workspace import \
  --ws-name dummy_import_ws \
  --ros-distro humble \
  --standalone-docker-image rtw_dummy_ws_export \
  --user-override-name robot

Extra todo's:

  • Add the cookie for xauth under /tmp to reenter docker container after restart
  • Add docs for rtw cli

Important

After PC restart, the .xauth cookie file will be removed. Therefore, before attaching VSCode, execute rtw ws <ws-name> and rtw docker enter to create the necessary .xauth cookie file.

@destogl
Copy link
Copy Markdown
Member

destogl commented Feb 19, 2024

@muritane, this PR is missing documentation and also a rocker as a requirement for cli. Can you please extend this?

also when I execute command, then I get error that the <workspace>/src is empty. Shouldn't this command automatically clone repository?

@muritane muritane force-pushed the rtw_ws_create branch 2 times, most recently from 716a59e to 6004042 Compare March 4, 2024 16:38
Copy link
Copy Markdown
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small rename, please.

* ``rtw ws``: Alias for ``rtw workspace use``

.. note::
For more detailed usage of each command or sub-command, run ``rtw <command> -h`` or ``rtw <command> <sub-command> -h``.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add docs from the descritpion of the PR here. Just to have a small overview.

@destogl
Copy link
Copy Markdown
Member

destogl commented May 23, 2024

We have a major bug here. when I restart my computer, I can not open again the same docker container I have create for the workspace.

The error is following:

Starting container instance: rtw_qa_scenario_final-instance
non-network local connections being added to access control list
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/tmp/.docker157hdqlh.xauth" to rootfs at "/tmp/.docker157hdqlh.xauth": mount /tmp/.docker157hdqlh.xauth:/tmp/.docker157hdqlh.xauth (via /proc/self/fd/7), flags: 0x5000: not a directory:unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Error: failed to start containers: rtw_qa_scenario_final-instance
Connecting to container instance as user: rtw_qa_scenario_final-instance
Error response from daemon: container 23110e8bad6b2581b144efb44c6f027cb6c81bd16642c412ca74eb534b6533cf is not running

I think the issue is that temp files that are using on container start get stored somehow and they don't existing the next time.

@destogl destogl merged commit 009bfa5 into master Jun 28, 2024
@destogl destogl deleted the rtw_ws_create branch June 28, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants