Skip to content

okyspace/AirSim-Docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AirSim-Docker

Set up Unreal Project

(https://microsoft.github.io/AirSim/unreal_custenv/)

  1. In Windows Machine

    • Create new project with custom environment of choice. Copy Unreal project folder to Linux machine
  2. In Linux Machine

    • From AirSim/Unreal/, copy Plugins/ into the Unreal project folder.

Docker Pre-Reqs

  1. docker installed on host (https://docs.docker.com/engine/install/ubuntu/)
  2. nvidia-docker installed on host (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-on-ubuntu-and-debian).
  3. > 120GB in directory where docker images are built. This is typically in '/', recommend to shift to '/home' or other directory with larger storage (https://www.guguweb.com/2019/02/07/how-to-move-docker-data-directory-to-another-location-on-ubuntu/)
  4. *After Steps 2 & 3, /etc/docker/daemon.json should look similar to below. Key parameters are "data-root", "runtimes", and "default-runtime".
    {
        "data-root": "/home/jonyktan/docker",
        "runtimes": {
            "nvidia": {
                "path": "nvidia-container-runtime",
                "runtimeArgs": []
            }
        },
        "default-runtime": "nvidia"
    }
    
  5. git clone https://github.com/Amigoshan/tartanair into same directory as dockerfile. Rename as /tartanair/
  6. Ensure docker image directory has "defaults" options or NO "nosuid" option. Check this using nano /etc/fstab.
    • Edit using "Disks". Recommended to set "Mount Options" to "defaults". See image below, above "Mount Point".

Build Docker Image

  1. cd /directory/containing/dockerfile/
  2. docker build -t <IMAGE_NAME>:<IMAGE_TAG> .
    • E.g. IMAGE_NAME = ue4, IMAGE_TAG = Tartan will build a docker image ue4:Tartan
    • Use docker container ls -a to view the built/incomplete image.

Run Docker Container from built Image

  1. xhost +local:docker && docker run --rm -it -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "/path/to/your/UE_env:/workspace/UnrealProj" -e "DISPLAY=${DISPLAY}" --ipc="host" <IMAGE_NAME>:<IMAGE_TAG>

Commit Container Changes to Container as new Image

  1. Find the CONTAINER_NAME using docker container ls
  2. docker commit <CONTAINER_NAME> <IMAGE_NAME>:<IMAGE_TAG>

Launch Additional Terminal for Running Container

  1. Without GUI support
    • docker exec -it <CONTAINER_NAME> bash
  2. With GUI support
    • xhost +local:docker && docker exec -it -e "DISPLAY=${DISPLAY}" <CONTAINER_NAME> bash

Launch Unreal Engine inside Docker Container

  1. Copy AirSim plugins to Unreal Project.
    • cp /workspace/AirSim/Unreal/Plugins/ /path/to/Unreal/Project/ (e.g. '/workspace/UnrealProj/')
  2. /workspace/UnrealEngine/Engine/Binaries/Linux/UE4Editor /path/to/Unreal/Project/<PROJECT_NAME>.uproject
  3. Unreal Engine will prompt to rebuild AirSim. Click "Yes". First compile will take awhile.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%