-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed wget logging #335
Removed wget logging #335
Conversation
WalkthroughThe Dockerfile for a ROS-based environment with Carla simulation has undergone significant updates. The base image has been changed to Changes
Assessment against linked issues
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (7)
build/docker/agent/Dockerfile_Submission (5)
Line range hint
1-11
: LGTM: Base image update improves ROS integration.The change to
osrf/ros:noetic-desktop-full-focal
as the base image is a good choice for a ROS-based environment. It provides better integration with ROS tools and libraries.Consider adding a brief comment explaining the rationale behind choosing this specific base image over the Carla-specific ones, to help future maintainers understand the decision.
Line range hint
29-57
: Approved: Improved installation processes and reduced logging.The changes to wget commands and installation processes effectively address the PR objective of removing wget logging. The streamlined installation processes for libgit2 and CUDA are also improvements.
For consistency, consider applying the same
-q -o /dev/null
flags to the wget command in the CUDA installation section (line 49).
Line range hint
59-67
: LGTM: Improved environment configuration.The addition of new environment variables, especially CUDA_HOME and CARLA_ROS_BRIDGE_ROOT, enhances the configuration and portability of the environment. The PYTHONPATH modifications ensure the correct Python version is used.
Consider grouping related environment variables together and adding comments to explain their purpose, improving readability for future maintainers.
Line range hint
161-170
: Approved: Proper code setup in the workspace.The copying of agent code to the workspace and linking it into the catkin workspace ensures the correct code is available in the container.
Consider adding comments explaining why specific files (dataset_generator.py and dev_global_route.py) are removed. This will help future maintainers understand the rationale behind these actions.
Line range hint
172-187
: LGTM: Proper container startup configuration.The addition of an entrypoint script and the configuration of CMD to run the leaderboard evaluator provide a good setup for container startup.
Consider replacing the hard-coded sleep period with a more robust solution, such as a script that checks for the readiness of required services before starting the leaderboard evaluator.
build/docker/agent/Dockerfile (2)
Line range hint
131-133
: Resolve inconsistentCUDA_HOME
paths and environment variable settingThe
CUDA_HOME
environment variable is set earlier to/usr/local/cuda-11.8
, but here it's being set to/usr/local/cuda-11
in.bashrc
. This inconsistency might lead to confusion or errors. Additionally, adding environment variables to.bashrc
and sourcing it in aRUN
command does not persist these variables across layers.To ensure consistency and proper environment variable setting, remove the
RUN
command modifying.bashrc
and set thePATH
using theENV
instruction:-RUN echo "export CUDA_HOME=/usr/local/cuda-11" >> ~/.bashrc \ - && echo "export PATH=$PATH:$CUDA_HOME/bin" >> ~/.bashrc +ENV PATH=$PATH:$CUDA_HOME/bin
Line range hint
134-134
: Avoid sourcing.bashrc
inRUN
commands for environment variablesSourcing
.bashrc
in aRUN
command doesn't affect subsequent commands in the Docker build, as eachRUN
executes in a new shell. Environment variables set this way won't persist.Install the requirements without sourcing
.bashrc
, ensuring all necessary environment variables are set usingENV
instructions:-RUN source ~/.bashrc && pip install -r /workspace/requirements.txt +RUN pip install -r /workspace/requirements.txt
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- build/docker/agent/Dockerfile (2 hunks)
- build/docker/agent/Dockerfile_Submission (2 hunks)
🧰 Additional context used
🔇 Additional comments (5)
build/docker/agent/Dockerfile_Submission (5)
Line range hint
78-95
: LGTM: Improved user setup and workspace configuration.The refinements in user setup and workspace configuration enhance security by using a non-root user and ensure proper permissions for the workspace.
These changes align with best practices for Docker container security and usability.
Line range hint
97-108
: Approved: CARLA ROS bridge installation improvements.The installation of CARLA ROS bridge from a specific branch and the application of a patch to fix the build process improve compatibility and reliability.
To ensure the CARLA ROS bridge is correctly installed and functional, please run the following verification script:
#!/bin/bash # Description: Verify CARLA ROS bridge installation # Test: Check if CARLA ROS bridge package is installed rospack find carla_ros_bridge # Test: Verify if the patch was applied successfully grep -q "carla_msgs" /catkin_ws/src/ros-bridge/carla_ackermann_control/package.xml && echo "Patch applied successfully" || echo "Patch not found"
Line range hint
151-159
: LGTM: Comprehensive Python package setup.The installation of Python packages, including torch and custom requirements, ensures all necessary dependencies are available. The CUDA configuration for PyTorch suggests proper GPU support.
To verify the Python package installations and CUDA setup, please run the following script:
#!/bin/bash # Description: Verify Python package installations and CUDA setup # Test: Check installed Python packages pip list # Test: Verify PyTorch CUDA availability python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')"
Line range hint
1-187
: Overall: Significant improvements to the Dockerfile.The changes in this Dockerfile greatly enhance the setup of the ROS-based environment with Carla simulation. The removal of wget logging, streamlined installation processes, improved environment variable configurations, and better workspace setup all contribute to a more efficient and maintainable container.
To ensure the overall functionality of the built image, please run the following verification script after building the image:
#!/bin/bash # Description: Verify the overall functionality of the built image # Test: Build the Docker image docker build -t carla_ros_image . # Test: Run a container and check the environment docker run --rm carla_ros_image bash -c " echo 'Checking ROS setup...' && source /opt/ros/noetic/setup.bash && rosversion -d && echo 'Checking CARLA setup...' && python -c 'import carla; print(carla.__file__)' && echo 'Checking PyTorch setup...' && python -c 'import torch; print(f\"CUDA available: {torch.cuda.is_available()}\")' && echo 'Checking leaderboard setup...' && python -c 'import leaderboard; print(leaderboard.__file__)'"This script will build the image and run a container to verify the key components of the setup.
Line range hint
69-76
: Approved: Enhanced ROS dependencies.The expanded list of ROS dependencies, including rqt and rosbridge-suite, likely improves the development environment and supports new functionalities.
To ensure all necessary dependencies are included and there are no conflicts, please run the following verification script:
build/docker/agent/Dockerfile
Outdated
&& mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 \ | ||
&& wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb \ | ||
&& wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb -q -o /dev/null \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Simplify wget
command by removing redundant flags
Again, remove -o /dev/null
as -q
is sufficient to suppress the output.
Apply this diff:
- && wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb -q -o /dev/null \
+ && wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb -q \
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
&& wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb -q -o /dev/null \ | |
&& wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb -q \ |
build/docker/agent/Dockerfile
Outdated
@@ -43,9 +43,9 @@ | |||
&& dpkg --configure -a | |||
|
|||
# CUDA installation | |||
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin \ | |||
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin -q -o /dev/null \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Simplify wget
command by removing redundant flags
Similarly, the -q
flag already suppresses output. Removing -o /dev/null
simplifies the command without changing its behavior.
Apply this diff:
-RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin -q -o /dev/null \
+RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin -q \
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin -q -o /dev/null \ | |
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin -q \ |
build/docker/agent/Dockerfile
Outdated
@@ -29,7 +29,7 @@ | |||
|
|||
# Download Carla PythonAPI (alternative to getting it from the Carla-Image, which is commented out above) | |||
# If the PythonAPI/Carla version changes, either update the link, or refer to the comment at the top of this file. | |||
RUN wget https://github.com/una-auxme/paf/releases/download/v0.0.1/PythonAPI_Leaderboard-2.0.zip -O PythonAPI.zip \ | |||
RUN wget https://github.com/una-auxme/paf/releases/download/v0.0.1/PythonAPI_Leaderboard-2.0.zip -q -o /dev/null -O PythonAPI.zip \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Simplify wget
command by removing redundant flags
The -q
flag in wget
suppresses all output except errors, making the use of -o /dev/null
redundant. Consider removing -o /dev/null
for clarity.
Apply this diff to simplify the command:
-RUN wget https://github.com/una-auxme/paf/releases/download/v0.0.1/PythonAPI_Leaderboard-2.0.zip -q -o /dev/null -O PythonAPI.zip \
+RUN wget https://github.com/una-auxme/paf/releases/download/v0.0.1/PythonAPI_Leaderboard-2.0.zip -q -O PythonAPI.zip \
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
RUN wget https://github.com/una-auxme/paf/releases/download/v0.0.1/PythonAPI_Leaderboard-2.0.zip -q -o /dev/null -O PythonAPI.zip \ | |
RUN wget https://github.com/una-auxme/paf/releases/download/v0.0.1/PythonAPI_Leaderboard-2.0.zip -q -O PythonAPI.zip \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (5)
build/docker/agent/Dockerfile_Submission (5)
Line range hint
1-19
: LGTM: Base image update improves stability.The change to use the official ROS image
osrf/ros:noetic-desktop-full-focal
is a good choice, as it provides better stability and support.Consider adding a brief comment explaining when and why one might want to use the commented-out Carla image option. This will help future maintainers understand the purpose of this alternative setup.
Line range hint
64-70
: LGTM: Comprehensive environment variable setup.The addition of new environment variables for CUDA_HOME and various paths, along with the updated PYTHONPATH, provides necessary configuration for the environment. This ensures compatibility with the installed components.
Consider using line breaks to improve readability of the long PYTHONPATH definition:
ENV PYTHONPATH=$PYTHONPATH:/opt/carla/PythonAPI/carla/dist/carla-0.9.14-py3.7-linux-x86_64.egg:\ /opt/carla/PythonAPI/carla
Line range hint
95-107
: LGTM: Updated CARLA ROS bridge installation with build fix.The updated installation process for the CARLA ROS bridge, including the patch to fix the build of carla_ros_bridge, improves the reliability of the setup.
Consider adding a comment explaining the purpose of the patch applied to
carla_ackermann_control/package.xml
. This will help future maintainers understand why this modification is necessary.
Line range hint
124-134
: LGTM: Comprehensive environment setup for leaderboard evaluator.The addition of environment variables for the leaderboard evaluator provides necessary configuration for the setup. The paths and configurations seem appropriate for the intended use.
For consistency, consider using the
$HOME
variable instead of hardcoding/home/$USERNAME
in the Python path setup. This makes the configuration more portable across different environments.
Line range hint
159-180
: LGTM: Comprehensive final setup and clear container entry point.The additional environment variables for CUDA and torch, along with the updated CMD, provide a clear and well-configured entry point for the container. The inclusion of the leaderboard evaluator in the CMD ensures the container starts with the intended application.
Instead of using a hardcoded sleep duration, consider using a more robust solution like wait-for-it or dockerize to ensure all required services are up before starting the leaderboard evaluator. This can make the container startup more reliable across different environments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- .github/workflows/build.yml (1 hunks)
- build/docker/agent/Dockerfile (2 hunks)
- build/docker/agent/Dockerfile_Submission (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- build/docker/agent/Dockerfile
🧰 Additional context used
🔇 Additional comments (7)
build/docker/agent/Dockerfile_Submission (7)
29-33
: LGTM: Carla PythonAPI installation aligns with PR objectives.The updated installation process for Carla PythonAPI using
wget
with the--quiet
flag effectively addresses the PR objective of reducing wget logging. This change will help improve the readability of logs during GitHub build actions.
Line range hint
36-46
: LGTM: Improved libgit2 installation process.The updated installation process for libgit2 effectively reduces logging output by using the
--quiet
flag withwget
. Additionally, the cleanup steps help minimize the image size, which is a good Docker practice.
Line range hint
47-62
: LGTM: Streamlined CUDA installation process.The CUDA installation process has been improved by:
- Using the
--quiet
flag withwget
to reduce logging output.- Including thorough cleanup steps to remove unnecessary files and repositories.
These changes align with the PR objectives and help maintain a clean, efficient Docker image.
Line range hint
72-79
: LGTM: Comprehensive ROS dependencies installation.The expanded list of ROS dependencies ensures all necessary components are installed. Using a single RUN command to install these dependencies is a good Docker practice as it helps reduce the number of layers and overall image size.
Line range hint
83-93
: LGTM: Improved user creation and workspace setup.The refined user creation process and appropriate workspace permissions setup enhance the security and usability of the Docker environment. This is particularly important for running ROS applications safely.
Line range hint
109-122
: LGTM: Organized and version-specific Python package installations.The installation of Python packages has been well-organized with specific versions, ensuring compatibility and reproducibility of the environment. The addition of packages to support the scenario runner enhances the functionality of the setup.
Line range hint
1-180
: Overall LGTM: Significant improvements aligned with PR objectives.This Dockerfile has undergone substantial improvements that align well with the PR objectives and Docker best practices:
- The use of
--quiet
flag withwget
throughout the file effectively addresses the main PR objective of reducing wget logging during GitHub build actions.- Installation processes for various components (Carla PythonAPI, libgit2, CUDA) have been streamlined and include proper cleanup steps, helping to minimize the image size.
- Environment variables and dependencies have been comprehensively set up, ensuring proper configuration for the ROS-based Carla simulation environment.
- The user creation process and workspace setup have been refined, enhancing security and usability.
- The CMD provides a clear entry point for the container, running the leaderboard evaluator as intended.
These changes collectively contribute to a more efficient, readable, and maintainable Dockerfile that successfully addresses the logging issues mentioned in the linked issue #333.
build-args: | | ||
USERNAME=paf | ||
USER_UID=1000 | ||
USER_GID=1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Wget Logging Removal Not Addressed
The current changes improve the formatting of the build-args
section, enhancing readability and maintainability. However, the removal of wget logging as outlined in the PR objective has not been addressed.
- Wget Usage: Multiple instances of
wget
are still present in the codebase, and their associated logging has not been removed or modified.
Please ensure that wget logging is explicitly removed or handled as per the PR objectives.
🔗 Analysis chain
Approve formatting change and suggest addressing PR objective
The reformatting of the build-args
section improves readability and maintainability of the workflow file. This change aligns with YAML best practices and makes it easier to manage build arguments in the future.
However, this change doesn't directly address the PR objective of removing wget logging as mentioned in the linked issue #333.
To ensure we're not missing any wget-related changes, let's run a quick check:
Could you please clarify how this PR addresses the wget logging issue? If it's handled elsewhere, consider updating the PR description to explain the approach taken.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any wget-related changes in the repository
# Search for wget in all files
echo "Searching for wget usage:"
rg 'wget'
# Search for any logging-related changes
echo "Searching for logging-related changes:"
rg 'log|logging'
Length of output: 28150
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.github/workflows/build.yml (1)
Wget Logging Removal Not Fully Addressed
The PR does not remove
wget
logging as intended. Whilewget
is still present in several Dockerfiles and logging statements exist across the codebase, the.github/workflows/build.yml
file does not reflect any changes related to removingwget
logging.Please ensure that all instances of
wget
logging are properly removed or addressed in this PR.🔗 Analysis chain
Line range hint
1-60
: Clarification needed: Addressing wget logging removalThe changes in this file improve the workflow configuration but don't address the primary objective of the PR, which is to remove wget logging as mentioned in the linked issue #333.
Could you please clarify:
- How does this PR address the wget logging issue?
- Are there other files not included in this review that implement the logging removal?
- If the wget logging removal is not part of this PR, should the PR description or linked issues be updated?
To help verify the status of wget logging, you can run the following script:
This will help identify any wget or logging-related changes that might be relevant to the PR objective.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any wget-related changes in the repository # Search for wget in all files echo "Searching for wget usage:" rg 'wget' # Search for any logging-related changes echo "Searching for logging-related changes:" rg 'log|logging'Length of output: 28150
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/build.yml (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
.github/workflows/build.yml (2)
8-10
: LGTM: Workflow trigger additionThe addition of a trigger for pushes to the 'main' branch is a good improvement. This ensures that the workflow runs not only when the "Check code format" workflow completes but also on direct pushes to the main branch, providing better coverage for all changes.
57-60
: Skipping comment on build-args reformattingThis change has already been addressed in a past review comment.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #333
Type of change
Please delete options that are not relevant.
Does this PR introduce a breaking change?
e.g. is old functionality not usable anymore
Most important changes
Which files functionalities are most important in this PR. On which part should the reviewer be focussed on?
Checklist:
Summary by CodeRabbit
New Features
main
branch.Improvements
build-args
section in the workflow configuration for improved readability.Documentation