Quellcode durchsuchen

Docker support for Multiplayer Sample (#479)

Signed-off-by: Steve Pham <[email protected]>
Co-authored-by: Gene Walters <[email protected]>
Steve Pham vor 1 Jahr
Ursprung
Commit
b11c79cea6
5 geänderte Dateien mit 559 neuen und 1 gelöschten Zeilen
  1. 3 1
      .gitignore
  2. 125 0
      Docker/Dockerfile
  3. 119 0
      Docker/README.md
  4. 277 0
      Docker/build.sh
  5. 35 0
      Docker/launch.sh

+ 3 - 1
.gitignore

@@ -1,6 +1,7 @@
 .idea/
 .idea/
 .vs/
 .vs/
 .vscode/
 .vscode/
+.command_settings
 _savebackup/
 _savebackup/
 .mayaSwatches/
 .mayaSwatches/
 *.swatches
 *.swatches
@@ -10,5 +11,6 @@ _savebackup/
 Sounds/wwise_project/*.wsettings
 Sounds/wwise_project/*.wsettings
 CMakeUserPresets.json
 CMakeUserPresets.json
 *.code-workspace
 *.code-workspace
+project.json.bak*
 AssetBundling/AssetLists/
 AssetBundling/AssetLists/
-AssetBundling/Bundles/
+AssetBundling/Bundles/

+ 125 - 0
Docker/Dockerfile

@@ -0,0 +1,125 @@
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+ARG INPUT_ARCHITECTURE=amd64
+
+ARG INPUT_IMAGE=ubuntu
+
+ARG INPUT_TAG=jammy
+
+FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE}:${INPUT_TAG}
+
+# Argument for determining the package type ('server', 'headless-server', 'game', or 'unified-launcher')
+ARG PACKAGE_TYPE=game  # Default to 'game'
+
+# o3de repo arguments
+ARG O3DE_REPO=https://github.com/o3de/o3de
+ARG O3DE_BRANCH=development
+ARG O3DE_COMMIT=HEAD
+
+# o3de-extras repo arguments
+ARG O3DE_EXTRAS_REPO=https://github.com/o3de/o3de-extras
+ARG O3DE_EXTRAS_BRANCH=development
+ARG O3DE_EXTRAS_COMMIT=HEAD
+
+# o3de-multiplayersample repo arguments
+ARG O3DE_MPS_REPO=https://github.com/o3de/o3de-multiplayersample
+ARG O3DE_MPS_BRANCH=development
+ARG O3DE_MPS_COMMIT=HEAD
+
+# o3de-multiplayersample-assets repo arguments
+ARG O3DE_MPS_ASSETS_REPO=https://github.com/o3de/o3de-multiplayersample-assets
+ARG O3DE_MPS_ASSETS_BRANCH=development
+ARG O3DE_MPS_ASSETS_COMMIT=HEAD
+
+
+# Argument to run fullscreen (for game, unified, and server package types)
+ARG RUN_FULLSCREEN=0
+
+# Set the workspace to work from
+ENV WORKSPACE=/data/workspace
+WORKDIR $WORKSPACE
+
+# o3de Environment
+ENV O3DE_REPO=$O3DE_REPO
+ENV O3DE_BRANCH=$O3DE_BRANCH
+ENV O3DE_COMMIT=$O3DE_COMMIT
+ENV O3DE_ROOT=$WORKSPACE/o3de
+
+# o3de-extras Environment
+ENV O3DE_EXTRAS_REPO=$O3DE_EXTRAS_REPO
+ENV O3DE_EXTRAS_BRANCH=$O3DE_EXTRAS_BRANCH
+ENV O3DE_EXTRAS_COMMIT=$O3DE_EXTRAS_COMMIT
+ENV O3DE_EXTRAS_ROOT=$WORKSPACE/o3de-extras
+
+# o3de-multiplayersample Environment
+ENV O3DE_MPS_ASSETS_REPO=$O3DE_MPS_ASSETS_REPO
+ENV O3DE_MPS_ASSETS_BRANCH=$O3DE_MPS_ASSETS_BRANCH
+ENV O3DE_MPS_ASSETS_COMMIT=$O3DE_MPS_ASSETS_COMMIT
+ENV O3DE_MPS_ASSETS_ROOT=$WORKSPACE/o3de-multiplayersample-assets
+
+# o3de-multiplayersample-assets Environment
+ENV O3DE_MPS_REPO=$O3DE_MPS_REPO
+ENV O3DE_MPS_BRANCH=$O3DE_MPS_BRANCH
+ENV O3DE_MPS_COMMIT=$O3DE_MPS_COMMIT
+ENV O3DE_MPS_ROOT=$WORKSPACE/o3de-multiplayersample
+
+# Validate and set the package type
+RUN if [ $PACKAGE_TYPE = "game" ];then echo "Building Game Launcher Image"; \
+    elif [ $PACKAGE_TYPE = "unified" ];then echo "Building Unified Launcher Image"; \
+    elif [ $PACKAGE_TYPE = "server" ];then echo "Building Server Launcher Image"; \
+    elif [ $PACKAGE_TYPE = "headless" ];then echo "Building Headless Server Launcher Image"; \
+    else echo "Invalid PACKAGE_TYPE argument '$PACKAGE_TYPE'. Must be one of ('server', 'headless', 'game', or 'unified')" && exit 1; \
+    fi
+ENV PACKAGE_TYPE=$PACKAGE_TYPE
+ENV RUN_FULLSCREEN=$RUN_FULLSCREEN
+
+# Add additional package repositories needed for packages
+RUN apt-get update && \
+    apt-get upgrade -y && \
+    apt-get install -y --no-install-recommends \
+        ca-certificates \
+        git \
+        git-lfs \
+        libstdc++-12-dev \
+        clang\
+        ninja-build \
+        cmake \
+        libglu1-mesa-dev \
+        libxcb-xinerama0 \
+        libxcb-xinput0 \
+        libxcb-xinput-dev \
+        libxcb-xfixes0-dev \
+        libxcb-xkb-dev \
+        libxkbcommon-dev \
+        libxkbcommon-x11-dev \
+        libfontconfig1-dev \
+        libcurl4-openssl-dev \
+        libsdl2-dev \
+        zlib1g-dev \
+        mesa-common-dev \
+        libssl-dev \
+        libxcb-icccm4 \
+        libxcb-image0 \
+        libxcb-keysyms1 \
+        libxcb-render-util0 \
+        libxcb-randr0 \
+        libnvidia-gl-470 \
+        libunwind-dev \
+        libzstd-dev \
+        binutils-dev \
+        libvulkan1 
+
+COPY build.sh $WORKSPACE/build.sh
+COPY launch.sh $WORKSPACE/launch.sh
+
+RUN $WORKSPACE/build.sh \
+    && rm $WORKSPACE/build.sh
+
+ENV NVIDIA_VISIBLE_DEVICES all
+ENV NVIDIA_DRIVER_CAPABILITIES all
+ 
+ENTRYPOINT ["/bin/bash", "-c", "/data/workspace/launch.sh"]

+ 119 - 0
Docker/README.md

@@ -0,0 +1,119 @@
+# Docker support for Multiplayer Sample
+
+The O3DE Multiplayer Sample supports construction of Docker images on the Linux environment. 
+
+## Prerequisites
+
+* [Hardware requirements of o3de](https://www.o3de.org/docs/welcome-guide/requirements/)
+* Any Linux distribution that supports Docker and the NVIDIA container toolkit (see below)
+ * **Note** For the headless server flavor, the NVIDIA container toolkit is not required.
+* At least 60 GB of free disk space
+* Docker installed and configured
+  * **Note** It is recommended to have Docker installed correctly and in a secure manner so that the Docker commands in this guide do not require elevated priviledges (sudo) in order to run them. See [Docker Engine post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) for more details.
+* [NVidia container toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker)
+
+# Building the Docker image
+The Docker scripts accepts arguments to control how to build the Docker image for the Multiplayer Sample. The main argument, `PACKAGE_TYPE` controls the type of launcher that will be built from the Docker build process. There are four different types of launchers supported:
+
+1. **game** : The game client that will connect to a game server.
+2. **server** : The game server that will accept remote game clients and will also provide a display of running game sessions. 
+3. **unified** : The combined game client that also can run as the game server.
+4. **headless** : The game server that will accept remote game clients but will not display and GUI or window. This is launcher is designed to run on headless servers.
+
+In addition to `PACKAGE_TYPE`, there are additional arguments that can control how the Docker image is built:
+
+| Argument                | Description                                                                | Default     
+|-------------------------|----------------------------------------------------------------------------|-------------
+| INPUT_ARCHITECTURE      | The CPU architecture (amd64/aarch64). Will require QEMU if cross compiling | amd64
+| INPUT_IMAGE             | The base linux distro docker image to base the build on                    | ubuntu
+| INPUT_TAG               | The base linux distro docker image tag to base the build on                | jammy
+| O3DE_REPO               | The git repo for O3DE                                                      | https://github.com/o3de/o3de
+| O3DE_BRANCH             | The branch for O3DE                                                        | development
+| O3DE_COMMIT             | The commit on the branch for O3DE (or HEAD)                                | HEAD
+| O3DE_EXTRAS_REPO        | The git repo for O3DE Extras                                               | https://github.com/o3de/o3de-extras
+| O3DE_EXTRAS_BRANCH      | The branch for O3DE Extras                                                 | development
+| O3DE_EXTRAS_COMMIT      | The commit on the branch for O3DE Extras (or HEAD)                         | HEAD
+| O3DE_MPS_REPO           | The git repo for main Multiplayer Sample project                           | https://github.com/o3de/o3de-multiplayersample
+| O3DE_MPS_BRANCH         | The branch for main Multiplayer Sample project                             | development
+| O3DE_MPS_COMMIT         | The commit on the branch for Multiplayer Sample project (or HEAD)          | HEAD
+| O3DE_MPS_ASSETS_REPO    | The git repo for Multiplayer Sample Assets                                 | https://github.com/o3de/o3de-multiplayersample-assets
+| O3DE_MPS_ASSETS_BRANCH  | The branch for Multiplayer Sample Assets                                   | development
+| O3DE_MPS_ASSETS_COMMIT  | The commit on the branch for Multiplayer Sample Assets (or HEAD)           | HEAD
+| RUN_FULLSCREEN          | Option to launch the game, unified, or server in fullscreen mode (0=no, 1=yes) | 0
+
+
+## Examples
+
+### Locally (From the o3de-multiplayersample/Docker folder)
+The following examples will be the different supported types of launchers using the local Docker context folder in the `o3de-multiplayersample` local repo.
+
+#### Game Launcher
+```
+docker build --build-arg PACKAGE_TYPE=game -f Dockerfile -t amd64/o3de-mps-game:jammy .
+```
+#### Unified Game Launcher
+```
+docker build --build-arg PACKAGE_TYPE=unified -f Dockerfile -t amd64/o3de-mps-unified:jammy .
+```
+#### Server Launcher
+```
+docker build --build-arg PACKAGE_TYPE=server -f Dockerfile -t amd64/o3de-mps-server:jammy .
+```
+#### Headless Server Launcher
+```
+docker build --build-arg PACKAGE_TYPE=headless -f Dockerfile -t amd64/o3de-mps-headless:jammy .
+```
+
+### From github
+The following examples will be the different supported types of launchers using the Docker context found in the github repo for `o3de-multiplayersample` and the `development` branch.
+
+#### Game Launcher
+```
+docker build --build-arg PACKAGE_TYPE=game -t amd64/o3de-mps-game:jammy https://github.com/o3de/o3de-multiplayersample.git#development:Docker
+```
+#### Unified Game Launcher
+```
+docker build --build-arg PACKAGE_TYPE=unified -t amd64/o3de-mps-unified:jammy https://github.com/o3de/o3de-multiplayersample.git#development:Docker
+```
+#### Server Launcher
+```
+docker build --build-arg PACKAGE_TYPE=server -t amd64/o3de-mps-server:jammy https://github.com/o3de/o3de-multiplayersample.git#development:Docker
+```
+#### Headless Server Launcher
+```
+docker build --build-arg PACKAGE_TYPE=headless -t amd64/o3de-mps-headless:jammy https://github.com/o3de/o3de-multiplayersample.git#development:Docker
+```
+
+
+# Running the Docker image locally
+Running the non-headless Docker images requires Vulkan and GPU acceleration provided by the NVIDIA drivers and container toolkit. The following directions will describe how to launch the Docker containers, utilizing the host Linux machine's X11 display and NVIDIA drivers, and connecting to the default 'bridge' network. (For advanced network isolation, refer to Docker's command-line reference for [network](https://docs.docker.com/reference/cli/docker/container/run/#network))
+
+
+
+#### Game Launcher
+```
+xhost +local:root
+docker run --rm --gpus all -e DISPLAY=:1 --network="bridge" -v /tmp/.X11-unix:/tmp/.X11-unix -it amd64/o3de-mps-game:jammy
+```
+#### Unified Game Launcher
+```
+xhost +local:root
+docker run --rm --gpus all -e DISPLAY=:1 --network="bridge" -v /tmp/.X11-unix:/tmp/.X11-unix -it amd64/o3de-mps-unified:jammy
+```
+#### Server Launcher
+```
+xhost +local:root
+docker run --rm --gpus all -e DISPLAY=:1 --network="bridge" -v /tmp/.X11-unix:/tmp/.X11-unix -it amd64/o3de-mps-server:jammy
+```
+#### Headless Server Launcher
+```
+docker run --network="bridge" -it amd64/o3de-mps-headless:jammy
+```
+>**Note** Headless server does not require access to the host display or NVIDIA drivers
+
+
+
+# Deploying the Docker image
+The Docker image can be published to any docker container registry and deployed on any Linux operating system that supports Docker.
+
+

+ 277 - 0
Docker/build.sh

@@ -0,0 +1,277 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+
+PROJECT_NAME=MultiplayerSample
+
+BUILD_ROOT=$WORKSPACE/build
+
+###############################################################################
+# Clone and bootstrap O3DE
+###############################################################################
+echo "Cloning o3de from $O3DE_REPO/$O3DE_BRANCH into $O3DE_ROOT"
+git clone --single-branch -b $O3DE_BRANCH $O3DE_REPO $O3DE_ROOT && \
+    git -C $O3DE_ROOT lfs install && \
+    git -C $O3DE_ROOT lfs pull && \
+    git -C $O3DE_ROOT reset --hard $O3DE_COMMIT 
+if [ $? -ne 0 ]
+then
+    echo "Error cloning o3de from $O3DE_REPO"
+    exit 1
+fi
+
+$O3DE_ROOT/python/get_python.sh && \
+    $O3DE_ROOT/scripts/o3de.sh register -ep $O3DE_ROOT
+if [ $? -ne 0 ]
+then
+    echo "Error bootstrapping O3DE from $O3DE_REPO"
+    exit 1
+fi
+
+
+###############################################################################
+# Clone and register o3de-extras
+###############################################################################
+echo "Cloning o3de-extras from $O3DE_EXTRAS_REPO/$O3DE_EXTRAS_BRANCH into $O3DE_EXTRAS_ROOT"
+git clone --single-branch -b $O3DE_EXTRAS_BRANCH $O3DE_EXTRAS_REPO $O3DE_EXTRAS_ROOT && \
+    git -C $O3DE_EXTRAS_ROOT lfs install && \
+    git -C $O3DE_EXTRAS_ROOT lfs pull && \
+    git -C $O3DE_EXTRAS_ROOT reset --hard $O3DE_EXTRAS_COMMIT
+if [ $? -ne 0 ]
+then
+    echo "Error cloning o3de-extras from $O3DE_EXTRAS_REPO"
+    exit 1
+fi
+
+$O3DE_ROOT/scripts/o3de.sh register --all-gems-path $O3DE_EXTRAS_ROOT/Gems
+if [ $? -ne 0 ]
+then
+    echo "Unable to register o3de-extras Gems"
+    exit 1
+fi
+
+
+###############################################################################
+# Clone and register o3de-multiplayersample-assets
+###############################################################################
+echo "Cloning o3de-multiplayersample-assets from $O3DE_MPS_ASSETS_REPO/$O3DE_MPS_ASSETS_BRANCH into $O3DE_MPS_ASSETS_ROOT"
+git clone --single-branch -b $O3DE_MPS_ASSETS_BRANCH $O3DE_MPS_ASSETS_REPO $O3DE_MPS_ASSETS_ROOT && \
+    git -C $O3DE_MPS_ASSETS_ROOT lfs install && \
+    git -C $O3DE_MPS_ASSETS_ROOT lfs pull && \
+    git -C $O3DE_MPS_ASSETS_ROOT reset --hard $O3DE_MPS_ASSETS_COMMIT && \
+    git -C $O3DE_MPS_ASSETS_ROOT submodule update --init --recursive 
+if [ $? -ne 0 ]
+then
+    echo "Unable to clone o3de-multiplayersample-assets from $O3DE_MPS_ASSETS_REPO"
+    exit 1
+fi
+
+$O3DE_ROOT/scripts/o3de.sh register --all-gems-path $O3DE_MPS_ASSETS_ROOT/Gems
+if [ $? -ne 0 ]
+then
+    echo "Unable to register o3de-multiplayersample-assets Gems"
+    exit 1
+fi
+
+
+###############################################################################
+# Clone and register o3de-multiplayersample
+###############################################################################
+echo "Cloning o3de-multiplayersample from $O3DE_MPS_REPO/$O3DE_MPS_BRANCH into $O3DE_MPS_ROOT"
+git clone --single-branch -b $O3DE_MPS_BRANCH $O3DE_MPS_REPO $O3DE_MPS_ROOT && \
+git -C $O3DE_MPS_ROOT lfs install && \
+git -C $O3DE_MPS_ROOT lfs pull && \
+git -C $O3DE_MPS_ROOT reset --hard $O3DE_MPS_COMMIT
+if [ $? -ne 0 ]
+then
+    echo "Unable to clone o3de-multiplayersample from $O3DE_MPS_REPO"
+    exit 1
+fi
+
+$O3DE_ROOT/scripts/o3de.sh register -pp $O3DE_MPS_ROOT
+if [ $? -ne 0 ]
+then
+    echo "Unable to register the o3de-multiplayersample project"
+    exit 1
+fi
+
+
+###############################################################################
+# Track the git commits from all the repos
+###############################################################################
+echo -e "\n\
+Repository                    | Commit \n\
+------------------------------+-----------------------------------------\n\
+o3de                          | $O3DE_REPO/tree/$(git -C $WORKSPACE/o3de rev-parse HEAD)\n\
+o3de-extras                   | $O3DE_EXTRAS_REPO/tree/$(git -C $WORKSPACE/o3de-extras rev-parse HEAD) ) \n\
+o3de-multiplayersample-assets | $O3DE_MPS_ASSETS_REPO/tree/$(git -C $WORKSPACE/o3de-multiplayersample-assets rev-parse HEAD) ) \n\
+o3de-multiplayersample        | $O3DE_MPS_REPO/tree/$(git -C $WORKSPACE/o3de-multiplayersample rev-parse HEAD) ) \n\
+\n\
+" >> $WORKSPACE/git_commit.txt
+
+###############################################################################
+# Build O3DE tools for asset processing and asset bundling
+###############################################################################
+
+cmake -B $O3DE_MPS_ROOT/build/tools \
+      -S $O3DE_MPS_ROOT \
+      -G "Ninja Multi-Config" \
+      -DLY_DISABLE_TEST_MODULES=ON \
+      -DLY_STRIP_DEBUG_SYMBOLS=ON
+if [ $? -ne 0 ]
+then
+    echo "Error generating O3DE tools projects"
+    exit 1
+fi
+
+cmake --build $O3DE_MPS_ROOT/build/tools \
+      --config profile \
+      --target AssetProcessorBatch AssetBundlerBatch
+if [ $? -ne 0 ]
+then
+    echo "Error building the O3DE tools projects"
+    exit 1
+fi
+
+###############################################################################
+# Build the assets for the Multiplayer Sample
+###############################################################################
+pushd $O3DE_MPS_ROOT/build/tools/bin/profile
+
+# Initial run to process the assets
+./AssetProcessorBatch
+
+# Secondary run to re-process ones that missed dependencies
+./AssetProcessorBatch
+
+popd
+
+###############################################################################
+# Bundle the assets for ROSCon2023Demo
+###############################################################################
+
+WORKSPACE_BUNDLE_FOLDER=$WORKSPACE/bundles
+
+if [ "$PACKAGE_TYPE" = "server" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_SERVER
+    LAUNCHER_TARGET=ServerLauncher
+elif [ "$PACKAGE_TYPE" = "headless" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_HEADLESS_SERVER
+    LAUNCHER_TARGET=HeadlessServerLauncher
+elif [ "$PACKAGE_TYPE" = "game" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_LAUNCHER
+    LAUNCHER_TARGET=GameLauncher
+elif [ "$PACKAGE_TYPE" = "unified" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_UNIFIED_LAUNCHER
+    LAUNCHER_TARGET=UnifiedLauncher
+else
+    echo "Invalid package type: $PACKAGE_TYPE"
+    exit 1
+fi
+
+mkdir -p $WORKSPACE_BUNDLE_FOLDER
+mkdir -p $PACKAGE_FOLDER/Cache/linux
+
+
+###############################################################################
+# Generate the bundles
+###############################################################################
+pushd $O3DE_MPS_ROOT/build/tools/bin/profile
+echo "Creating the game assetList ..."
+./AssetBundlerBatch assetLists \
+        --assetListFile $WORKSPACE_BUNDLE_FOLDER/game_linux.assetList \
+        --platform linux \
+        --project-path $O3DE_MPS_ROOT \
+        --seedlistFile $O3DE_MPS_ROOT/AssetBundling/SeedLists/BasePopcornFxSeedList.seed \
+        --seedlistFile $O3DE_MPS_ROOT/AssetBundling/SeedLists/GameSeedList.seed \
+        --seedlistFile $O3DE_MPS_ROOT/AssetBundling/SeedLists/VFXSeedList.seed \
+        --allowOverwrites
+if [ $? -ne 0 ]
+then
+    echo "Error generating asset list from $WORKSPACE/RosConDemoSeedList.seed"
+    exit 1
+fi
+
+echo "Creating the engine assetList ..."
+./AssetBundlerBatch assetLists \
+        --assetListFile $WORKSPACE_BUNDLE_FOLDER/engine_linux.assetList \
+        --platform linux \
+        --project-path $O3DE_MPS_ROOT \
+        --addDefaultSeedListFiles \
+        --allowOverwrites
+if [ $? -ne 0 ]
+then
+    echo "Error generating default engine asset list"
+    exit 1
+fi
+
+echo "Creating the game asset bundle (pak) ..."
+./AssetBundlerBatch bundles \
+        --platform linux \
+        --project-path $O3DE_MPS_ROOT \
+        --allowOverwrites \
+        --assetListFile $WORKSPACE_BUNDLE_FOLDER/game_linux.assetList \
+        --outputBundlePath $PACKAGE_FOLDER/Cache/linux/game_linux.pak
+if [ $? -ne 0 ]
+then
+    echo "Error bundling generating game pak"
+    exit 1
+fi
+             
+echo "Creating the engine asset bundle (pak) ..."
+./AssetBundlerBatch bundles \
+        --platform linux \
+        --project-path $O3DE_MPS_ROOT \
+        --allowOverwrites \
+        --assetListFile $WORKSPACE_BUNDLE_FOLDER/engine_linux.assetList \
+        --outputBundlePath $PACKAGE_FOLDER/Cache/linux/engine_linux.pak
+if [ $? -ne 0 ]
+then
+    echo "Error bundling generating engine pak"
+    exit 1
+fi
+
+# Build the game launcher monolithically
+echo "Building the ${PROJECT_NAME}.${LAUNCHER_TARGET}."
+cmake -B $O3DE_MPS_ROOT/build/game \
+      -S $O3DE_MPS_ROOT \
+      -G "Ninja Multi-Config" \
+      -DLY_DISABLE_TEST_MODULES=ON \
+      -DLY_STRIP_DEBUG_SYMBOLS=ON \
+      -DLY_MONOLITHIC_GAME=ON \
+      -DALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES=0 \
+&& cmake --build $O3DE_MPS_ROOT/build/game \
+         --config profile \
+         --target ${PROJECT_NAME}.${LAUNCHER_TARGET}
+if [ $? -ne 0 ]
+then
+    echo "Error bundling ${PROJECT_NAME}.${LAUNCHER_TARGET}"
+    exit 1
+fi
+
+cp $O3DE_MPS_ROOT/build/game/bin/profile/${PROJECT_NAME}.${LAUNCHER_TARGET} $PACKAGE_FOLDER/ 
+cp $O3DE_MPS_ROOT/build/game/bin/profile/*.json $PACKAGE_FOLDER/ 
+cp $O3DE_MPS_ROOT/build/game/bin/profile/*.so $PACKAGE_FOLDER
+
+echo Cleaning up data
+rm -rf $WORKSPACE/o3de
+rm -rf $WORKSPACE/o3de-extras
+rm -rf $WORKSPACE/o3de-multiplayersample
+rm -rf $WORKSPACE/o3de-multiplayersample-assets
+rm -rf $HOME/.o3de
+rm -rf $HOME/O3DE
+rm -rf $WORKSPACE_BUNDLE_FOLDER
+
+echo -e "Docker image built from the following repo information\n\n"
+cat $WORKSPACE/git_commit.txt
+
+exit 0

+ 35 - 0
Docker/launch.sh

@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+PROJECT_NAME=MultiplayerSample
+
+if [ "$PACKAGE_TYPE" = "server" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_SERVER
+    LAUNCHER_TARGET=ServerLauncher
+elif [ "$PACKAGE_TYPE" = "headless-server" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_HEADLESS_SERVER
+    LAUNCHER_TARGET=HeadlessServerLauncher
+elif [ "$PACKAGE_TYPE" = "launcher" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_LAUNCHER
+    LAUNCHER_TARGET=GameLauncher
+elif [ "$PACKAGE_TYPE" = "unified" ]
+then
+    PACKAGE_FOLDER=$WORKSPACE/MPS_UNIFIED_LAUNCHER
+    LAUNCHER_TARGET=UnifiedLauncher
+else
+    echo "Invalid package type: $PACKAGE_TYPE"
+    exit 1
+fi
+
+cd $PACKAGE_FOLDER
+./${PROJECT_NAME}.${LAUNCHER_TARGET} --bg_ConnectToAssetProcessor=0 -r_fullscreen=$RUN_FULLSCREEN ${@:1}
+
+exit $?