Skip to content

Conversation

@Athen-Player1
Copy link

Proposed changes

Adding a script to automate the setting up of a DX System

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. This is a reminder of what we should look for before merging this code. I have:

  • Read and follow the contributing guidelines.
  • Checked that all tests pass with my changes
  • Added tests (automatic or manual) that prove the fix is effective or that the feature works
  • Added necessary documentation (if appropriate)
  • Added the corresponding license to each file and add the current year of any one that you modified.
  • Tested on real hardware (if appropriate)

Copy link
Contributor

@niko-holmes niko-holmes left a comment

Choose a reason for hiding this comment

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

Happy to approve, but would be nice to get the functionality in shadow-robot/sr-build-tools#711 (review) added before merging this PR.

@toliver
Copy link
Contributor

toliver commented Apr 9, 2025

Nice.
I see that the creation of a directory in the local PC that contains a checkout of dx_system and the mounting of that directory in docker is not part of this script. I assume that this is part of another subsequent script already?

@niko-holmes
Copy link
Contributor

Nice. I see that the creation of a directory in the local PC that contains a checkout of dx_system and the mounting of that directory in docker is not part of this script. I assume that this is part of another subsequent script already?

The checkout of dx_system in this script is purely to grab the host_scripts directory (hence the sparse checkout and deletion of dx_system at the end). The actual dx_system is part of the docker image.

At the moment we don't add dx_system to the user workspace, as I understood that would be something we would have the users do manually if they want to edit dx_system

@toliver
Copy link
Contributor

toliver commented Apr 9, 2025

Nice. I see that the creation of a directory in the local PC that contains a checkout of dx_system and the mounting of that directory in docker is not part of this script. I assume that this is part of another subsequent script already?

The checkout of dx_system in this script is purely to grab the host_scripts directory (hence the sparse checkout and deletion of dx_system at the end). The actual dx_system is part of the docker image.

At the moment we don't add dx_system to the user workspace, as I understood that would be something we would have the users do manually if they want to edit dx_system

Understood. Does that mean that the mounting of a host PC directory into the container is also a manual process for the moment?

@niko-holmes
Copy link
Contributor

niko-holmes commented Apr 9, 2025

Nice. I see that the creation of a directory in the local PC that contains a checkout of dx_system and the mounting of that directory in docker is not part of this script. I assume that this is part of another subsequent script already?

The checkout of dx_system in this script is purely to grab the host_scripts directory (hence the sparse checkout and deletion of dx_system at the end). The actual dx_system is part of the docker image.
At the moment we don't add dx_system to the user workspace, as I understood that would be something we would have the users do manually if they want to edit dx_system

Understood. Does that mean that the mounting of a host PC directory into the container is also a manual process for the moment?

Depends on the directory. We automatically mount the ~/.ros, /dev, and user_ws directories when creating a container. All that is part of the scripts in "host_scripts"

We expect users to develop into the container via the user_ws directory (e.g. they would put their version of dx_system in there)

@niko-holmes
Copy link
Contributor

Malformed license check can be fixed by using the following license

# Software License Agreement (BSD License)
# Copyright © <YEAR> belongs to Shadow Robot Company Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#   1. Redistributions of source code must retain the above copyright notice,
#      this list of conditions and the following disclaimer.
#   2. Redistributions in binary form must reproduce the above copyright notice,
#      this list of conditions and the following disclaimer in the documentation
#      and/or other materials provided with the distribution.
#   3. Neither the name of Shadow Robot Company Ltd nor the names of its contributors
#      may be used to endorse or promote products derived from this software without
#      specific prior written permission.
#
# This software is provided by Shadow Robot Company Ltd "as is" and any express
# or implied warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose are disclaimed. In no event
# shall the copyright holder be liable for any direct, indirect, incidental, special,
# exemplary, or consequential damages (including, but not limited to, procurement of
# substitute goods or services; loss of use, data, or profits; or business interruption)
# however caused and on any theory of liability, whether in contract, strict liability,
# or tort (including negligence or otherwise) arising in any way out of the use of this
# software, even if advised of the possibility of such damage.

cd "$temp_dir" || { print_red "Failed to change to temporary directory"; exit 1; }
git clone -n --depth=1 --filter=tree:0 https://github.com/shadow-robot/dx_system.git . || { print_red "Failed to clone repository"; exit 1; }

# Configure sparse checkout
Copy link
Contributor

@niko-holmes niko-holmes Apr 11, 2025

Choose a reason for hiding this comment

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

You have to cd into the dir you just cloned for the next git commands to work

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.

4 participants