adamrehn / ue4-runtime

Container images for running packaged Unreal Engine projects via the NVIDIA Container Toolkit
https://hub.docker.com/r/adamrehn/ue4-runtime
MIT License
82 stars 26 forks source link

Running UE4 project packaged for linux as container fails to start - requesting example(s) #5

Closed Kingcitaldo125 closed 4 years ago

Kingcitaldo125 commented 4 years ago

Hello, I'm currently trying to use the ue4-runtime image to create my own container that runs a UE4 project that was packaged for Linux, but I'm having some trouble. I'm not sure if this issue is out of scope for the ue4-runtime container, but I wanted to make sure just in case it was related to the runtime image. I'm currently trying to build an Unreal Engine project, package it for Linux, then run that packaged Linux project in a container using the ue4-runtime image as a base image.

Is there a preferred method for running/building containers that contain packaged projects using this paradigm? Are there examples that show how to create a custom Dockerfile using ue4-runtime as a base image? If there aren't examples of how to do this, I think it would be helpful to add an examples/ folder to the repo for different cases.

I'll attach my dockerfile to help explain my thought process.

Thanks and please advise, Paul A

CaptureDockerfile

adamrehn commented 4 years ago

Looking through my documentation and various repos, I'm realising that there are actually very few example Dockerfiles available:

I think you're absolutely right that I should add a directory full of examples for various scenarios, although I might create a separate repository for that and link to it from the ue4-runtime README rather than embed it inside this repository, since the examples could also include Dockerfiles that don't use the ue4-runtime base image (e.g. directly using NVIDIA base images.)

adamrehn commented 4 years ago

As for your own Dockerfile, it can be simplified to this:

FROM adamrehn/ue4-runtime:latest

# Copy the packaged files into the image and assign ownership to the non-root ue4 user
WORKDIR /home/ue4
COPY --chown=ue4:ue4 LinuxNoEditor/ .

# Set the project's startup script as the container entrypoint
ENTRYPOINT [ "/home/ue4/MyProject.sh" ]

Notes:

Kingcitaldo125 commented 4 years ago

Thanks for this information. This is very helpful. It looks like my original issue appeared to be, more or less, related to getting my Linux VM to accept being able to run the startup scripts without permission errors. Sorry if parts of that Dockerfile, and my particular issue case, were somewhat out of scope.

Thanks also for the examples that you've mentioned. I think the biggest issue here was related to my docker naivety. I'm used to working within the Unreal Engine itself instead of trying to package and run projects in unfamiliar contexts. The goal was to package a UE4 project, that was made in a Windows 10 environment, to run within a Linux container environment using the ue4-runtime image.

Thanks again,

Paul A

adamrehn commented 4 years ago

@Kingcitaldo125 the repository with example Dockerfiles is now live: https://github.com/adamrehn/ue4-example-dockerfiles. The initial set of examples are quite basic but I'll continue to expand it with various use cases as time goes on.

Kingcitaldo125 commented 4 years ago

Thanks for uploading those examples. They provide some helpful contextual information. I also think that those examples would be helpful when it comes to testing the integrity of UE4 projects from a docker context like you've mentioned from within a Dockerfile in that examples repo.

Would you happen to know how much time it would be before a cloud rendering example Dockerfile/configuration would be available in the example repository? Our current use case reflects something very similar to Pixel Streaming, but rather exporting images(PNG) of a video feed to a local data store instead of the strict Pixel Streaming paradigm.

Thanks, Paul A

adamrehn commented 4 years ago

I've got a few ideas around different cloud rendering and microservice examples to put together and add to the repository, but I'm still thinking about the best way to generalise them.

In your particular case, you could likely use the Dockerfile for the Pixel Streaming application and remove the Pixel Streaming-specific lines (the environment variable and the symbolic link) to create a container image for your packaged project. You'd just need to add an EXPOSE directive for whatever TCP or UDP ports that your application listens on for incoming network communication.