-
-
Notifications
You must be signed in to change notification settings - Fork 4k
[Feature] CARLA DevContainer & Docker Improvements – Ubuntu 22.04 #8620
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
base: ue4-dev
Are you sure you want to change the base?
Conversation
This reverts commit 3958e35.
This reverts commit 6ee572e.
Updated the script to use curl instead of wget for downloading the FBX SDK, as the Autodesk server rejects wget requests with HTTP 403 errors. Added a Mozilla/5.0 user-agent to mimic browser behavior and ensure compatibility. This change resolves download issues and maintains the existing unpacking and build process.
If you must use Unreal's Clang, explicitly pass the library paths (/usr/lib/x86_64-linux-gnu) to the linker. This ensures the linker can find libpthread.so.0, libicuuc.so.70, and liblzma.so.5.
…ntainer feat: carla-0.9.15.2 jammy devcontainer
fix: refence to default branch not custom branch
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes. |
.devcontainer/devcontainer.json
Outdated
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.
This file could be removed and leave the reference on the documentation: Docs/build_docker_ubuntu22.md
@@ -144,10 +144,10 @@ if ${BUILD_CARLAUE4} ; then | |||
|
|||
OPTIONAL_MODULES_TEXT="" | |||
if ${USE_CARSIM} ; then | |||
python ${PWD}/../../Util/BuildTools/enable_carsim_to_uproject.py -f="CarlaUE4.uproject" -e | |||
python3 ${PWD}/../../Util/BuildTools/enable_carsim_to_uproject.py -f="CarlaUE4.uproject" -e |
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.
Remark: This removes backward compatibility with Python 2.7
(deprecated). There is no need for newer releases and images.
If not specified as and argument:
$ python
bash: python: command not found
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.
I think it makes sense to remove Python 2 as a dependency. @Blyron @MarcelPiNacy-CVC What do you think?
@@ -110,10 +110,10 @@ if ${DO_CARLA_RELEASE} ; then | |||
pushd "${CARLAUE4_ROOT_FOLDER}" >/dev/null | |||
|
|||
if ${USE_CARSIM} ; then | |||
python ${PWD}/../../Util/BuildTools/enable_carsim_to_uproject.py -f="CarlaUE4.uproject" -e | |||
python3 ${PWD}/../../Util/BuildTools/enable_carsim_to_uproject.py -f="CarlaUE4.uproject" -e |
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.
Remark: This removes backward compatibility with Python 2.7
(deprecated). There is no need for newer releases and images.
If not specified as and argument:
$ python
bash: python: command not found
@@ -18,11 +18,11 @@ fi | |||
# check if the XODR file exist | |||
if [ -f "$1.xodr" ]; then | |||
# parse openDRIVE crosswalks (generate crosswalks.obj) | |||
python get_xodr_crosswalks.py -f "$1.xodr" | |||
python3 get_xodr_crosswalks.py -f "$1.xodr" |
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.
Remark: This removes backward compatibility with Python 2.7
(deprecated). There is no need for newer releases and images.
If not specified as and argument:
$ python
bash: python: command not found
Update CHANGELOG.md
.devcontainer/devcontainer.json
Outdated
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.
Remark: This file could be removed and just leave the reference in Docs/build_docker_ubuntu22.md
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.
Ideally, we would leave this file here, but I’m considering the experience for Windows users. When they open the project in vscode
, they’ll see a message suggesting that it can be opened in a container. But this doesn’t actually work on Windows. I’m not sure if there’s a good workaround for this. If we can’t find one, I’d suggest moving this to the documentation as a reference for now instead of keeping the file here.
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.
@joel-mb I agree, this kind of file it's normally not committed. I can add it as a reference in the documentation. The scripts already take care of this, therefore this is just the translation in case a developer wants to use VS Code Devcontainers. I'll do the update, thanks for the feedback.
The ability to build UE / CARLA from source mounted from the host is an improvement for developers! |
Hi @wambitz ! Thanks for this contribution and sorry for the late reply. I think this is a valuable addition to the community, as it facilitates working with CARLA from source on Linux. I’ll leave some minor comments, but overall the PR looks good. |
.devcontainer/devcontainer.json
Outdated
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.
Ideally, we would leave this file here, but I’m considering the experience for Windows users. When they open the project in vscode
, they’ll see a message suggesting that it can be opened in a container. But this doesn’t actually work on Windows. I’m not sure if there’s a good workaround for this. If we can’t find one, I’d suggest moving this to the documentation as a reference for now instead of keeping the file here.
@@ -144,10 +144,10 @@ if ${BUILD_CARLAUE4} ; then | |||
|
|||
OPTIONAL_MODULES_TEXT="" | |||
if ${USE_CARSIM} ; then | |||
python ${PWD}/../../Util/BuildTools/enable_carsim_to_uproject.py -f="CarlaUE4.uproject" -e | |||
python3 ${PWD}/../../Util/BuildTools/enable_carsim_to_uproject.py -f="CarlaUE4.uproject" -e |
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.
I think it makes sense to remove Python 2 as a dependency. @Blyron @MarcelPiNacy-CVC What do you think?
# ------------------------------------------------------------------------------ | ||
# Cleanup | ||
# ------------------------------------------------------------------------------ | ||
RUN rm -rf /var/lib/apt/lists/* |
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.
I believe this cleanup isn't taking effect due to how Docker layers work. Deleting files in a later layer doesn't reduce the final image size. The cleanup should be included in the same RUN
instruction as the apt update
. Resolving this for now to avoid blocking the PR.
…ate documentation (#4) Fixes an issue where containers would start in the right directory instead of the expected /workspaces/<REPO_NAME>. This would case trouble when launching from devcontainer.json
@joel-mb I made the appropriate changes, I went through the instructions and I made a few modifications to improve the reading flow, also I catch a small mounting "bug", the scripts were not mounting in the same directory as when using the I tested these 3 options:
|
@@ -50,3 +51,6 @@ _out* | |||
_site | |||
core | |||
profiler.csv | |||
.env | |||
.venv | |||
devcontainer.json |
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.
Remak: I added this so if someone decides to use devcontainer.json
configuration it doesn't get committed by accident
|
||
You can use a **Visual Studio Code devcontainer** with the lightweight approach. This setup mounts your host’s directories (including UE4) into a Docker environment. Note that the monolithic image is less suited to devcontainers since it stores everything inside the image. | ||
|
||
Create `.devcontainer/devcontainer.json` in your CARLA repository: |
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.
Remark: His is the configuration I used to test the devcontainer
from VS Code
Description
Detailed documentation at:
Docs/build_docker_ubuntu22.md
Fixes
Where has this been tested?
Possible Drawbacks
Backward compatibility with Python 2.7
This change is
Summary
This PR introduces two Docker-based approaches for building and running CARLA (version 0.9.15.2) on Ubuntu 22.04 (Jammy):
This setup improves developer experience by enabling a VS Code DevContainer workflow and optimizing build processes for both Docker modes.
Key Features
New Docker Approaches
Scripts for Easy Setup
run_container.sh
→ Detects monolithic (--monolith
flag) vs. lightweight mode.build_image.sh
→ Handles image creation, including Epic Games credential management for UE4 builds.Updated Dockerfiles
carla.dockerfile
→ Lightweight mode (requires externally mounted UE4).carla-ue4.dockerfile
→ Monolithic mode (builds UE4 and CARLA in one image).DevContainer Support (VS Code)
.devcontainer/devcontainer.json
for easy development inside VS Code.How to Use
Lightweight Mode (Faster)
Monolithic Mode (Self-contained)
Known Issues