From eb28f77269d062287610f78397b181e9f560570c Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Tue, 12 Aug 2025 14:44:24 -0500 Subject: [PATCH 01/15] update Installing the protobuffer compiler before building the Rust server. --- Tools/CI/run_cmb_service.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 84c211c1ed..7540c9dc33 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -67,6 +67,10 @@ cd ./mps-common-multiplayer-backend/runtime # Install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + +# Install ProtoBuffer Compiler +apt install -y protobuf-compiler + # Add the cargo bin directory to the PATH export PATH="$HOME/.cargo/bin:$PATH" From 27bdb2138d6bee30529faacd4da02439bf12607f Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Tue, 12 Aug 2025 16:42:06 -0500 Subject: [PATCH 02/15] update Using apt-get as opposed to apt. --- Tools/CI/run_cmb_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 7540c9dc33..03368ae770 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -69,7 +69,7 @@ cd ./mps-common-multiplayer-backend/runtime curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # Install ProtoBuffer Compiler -apt install -y protobuf-compiler +apt-get install -y protobuf-compiler # Add the cargo bin directory to the PATH export PATH="$HOME/.cargo/bin:$PATH" From d9bfc3ca9b842cafad569c6bfbb2b50d41c980c3 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Tue, 12 Aug 2025 18:46:13 -0500 Subject: [PATCH 03/15] update Adding the environment variable to what I "think" is the correct location of the install. --- Tools/CI/run_cmb_service.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 03368ae770..b287e3709b 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -68,9 +68,12 @@ cd ./mps-common-multiplayer-backend/runtime # Install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# Install ProtoBuffer Compiler +# Install Protocol Buffer Compiler apt-get install -y protobuf-compiler +# Add the Protocol Buffer Compiler install location to the path +export PATH="$HOME/.local/bin:$PATH" + # Add the cargo bin directory to the PATH export PATH="$HOME/.cargo/bin:$PATH" From 63569bc453eae91e408b50f4d674f863d8ef8780 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Tue, 12 Aug 2025 20:59:15 -0500 Subject: [PATCH 04/15] update Adding PROTOC environment variable. --- Tools/CI/run_cmb_service.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index b287e3709b..1a76b666f1 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -71,6 +71,9 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # Install Protocol Buffer Compiler apt-get install -y protobuf-compiler +# Add the Protocol Buffer Compiler install PROTOC +export PROTOC="$HOME/.local/bin/protoc" + # Add the Protocol Buffer Compiler install location to the path export PATH="$HOME/.local/bin:$PATH" From 58c92a9244cd44d45dcb138220b7bc8db95a53b3 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Tue, 12 Aug 2025 22:31:46 -0500 Subject: [PATCH 05/15] update Seeing if I can download the binary to a known location and then set environment variables to point to that. Adding some additional log information. --- Tools/CI/run_cmb_service.sh | 41 +++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 1a76b666f1..6ddda3462c 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -60,6 +60,36 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port: # Setup ------------------------------------------------------------------------- +# Protocol Buffer Compiler ------------------------------------------------------ + +# Install Protocol Buffer Compiler (1st attempt) +# apt-get install -y protobuf-compiler + +# Download the protocol buffer release for linux +echo "Downloading protocol bufffer compiler..." +PB_REL="https://github.com/protocolbuffers/protobuf/releases" +curl -LO $PB_REL/download/v31.1/protoc-31.1-linux-x86_64.zip + +# Create target folder to unzip protoc binaries. +echo "Creating protocol bufffer folder..." +mkdir -p protoc +protoc_path="./protoc" +folder_path=$(realpath "$protoc_path") + +echo "Folder path of protoc: $folder_path" +echo "Unzipping to $folder_path" + +# extract binaries to protoc folder +unzip protoc-31.1-linux-x86_64.zip -d ./protoc + +# Add the Protocol Buffer Compiler install PROTOC +export PROTOC="$folder_path" +echo "Set PROTOC = $folder_path" + +# Add the Protocol Buffer Compiler install location to the path +export PATH="$folder_path:$PATH" +echo "Set PATH = $PATH" + # clone the cmb service repo git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git # navigate to the cmb service directory @@ -68,19 +98,9 @@ cd ./mps-common-multiplayer-backend/runtime # Install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# Install Protocol Buffer Compiler -apt-get install -y protobuf-compiler - -# Add the Protocol Buffer Compiler install PROTOC -export PROTOC="$HOME/.local/bin/protoc" - -# Add the Protocol Buffer Compiler install location to the path -export PATH="$HOME/.local/bin:$PATH" - # Add the cargo bin directory to the PATH export PATH="$HOME/.cargo/bin:$PATH" - # Echo server ------------------------------------------------------------------- # Build the echo server @@ -88,7 +108,6 @@ cargo build --example ngo_echo_server # Run the echo server in the background cargo run --example ngo_echo_server -- --port $echo_port & - # CMB Service ------------------------------------------------------------------- # Build a release version of the standalone cmb service From 8cb1f2610ca17d65b16cbb2d8e43737095641d72 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 00:30:39 -0500 Subject: [PATCH 06/15] update - chmod Updating the subfolders to have execute permissions. --- Tools/CI/run_cmb_service.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 6ddda3462c..2e100aec28 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -76,19 +76,22 @@ mkdir -p protoc protoc_path="./protoc" folder_path=$(realpath "$protoc_path") -echo "Folder path of protoc: $folder_path" -echo "Unzipping to $folder_path" +echo "Unzipping to folder path of protoc: $folder_path" # extract binaries to protoc folder -unzip protoc-31.1-linux-x86_64.zip -d ./protoc +unzip protoc-31.1-linux-x86_64.zip -d $folder_path + +# changing the execute permissions of the protoc folder +chmod +x ./protoc +chmod +x ./protoc/bin # Add the Protocol Buffer Compiler install PROTOC -export PROTOC="$folder_path" -echo "Set PROTOC = $folder_path" +export PROTOC="$folder_path/bin" +echo "Set PROTOC = $PROTOC" # Add the Protocol Buffer Compiler install location to the path -export PATH="$folder_path:$PATH" -echo "Set PATH = $PATH" +export PATH="$folder_path/bin:$PATH" +echo "\n Set PATH = $PATH" # clone the cmb service repo git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git From b3bb9dae722e8db645ac8b1a142ec06b00b97b90 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 00:37:22 -0500 Subject: [PATCH 07/15] update - style Adjusting comments and --- Tools/CI/run_cmb_service.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 2e100aec28..b4ab65b103 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -85,16 +85,17 @@ unzip protoc-31.1-linux-x86_64.zip -d $folder_path chmod +x ./protoc chmod +x ./protoc/bin -# Add the Protocol Buffer Compiler install PROTOC +# Add the PROTOC environment variable for Protocol Buffer Compiler export PROTOC="$folder_path/bin" echo "Set PROTOC = $PROTOC" -# Add the Protocol Buffer Compiler install location to the path +# Add the Protocol Buffer Compiler install location to the PATH export PATH="$folder_path/bin:$PATH" echo "\n Set PATH = $PATH" # clone the cmb service repo git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git + # navigate to the cmb service directory cd ./mps-common-multiplayer-backend/runtime @@ -105,7 +106,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y export PATH="$HOME/.cargo/bin:$PATH" # Echo server ------------------------------------------------------------------- - +echo "Beginning build..." # Build the echo server cargo build --example ngo_echo_server # Run the echo server in the background From 4a310843b166df06952cd67841577af21cfd4257 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 09:19:41 -0500 Subject: [PATCH 08/15] update recursively change read/write an execution permissions. --- Tools/CI/run_cmb_service.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index b4ab65b103..065babaa99 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -82,8 +82,7 @@ echo "Unzipping to folder path of protoc: $folder_path" unzip protoc-31.1-linux-x86_64.zip -d $folder_path # changing the execute permissions of the protoc folder -chmod +x ./protoc -chmod +x ./protoc/bin +chmod -R 755 ./protoc # Add the PROTOC environment variable for Protocol Buffer Compiler export PROTOC="$folder_path/bin" From bf7f665bb8a85a5d64eb65b505dab683420c0955 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 10:41:36 -0500 Subject: [PATCH 09/15] update Trying the apt-get again using the `/usr/bin/protoc` as the install folder. --- Tools/CI/run_cmb_service.sh | 44 +++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 065babaa99..6e2fbe70ce 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -62,35 +62,47 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port: # Protocol Buffer Compiler ------------------------------------------------------ -# Install Protocol Buffer Compiler (1st attempt) -# apt-get install -y protobuf-compiler +echo "Updating modules..." +apt-get update + +# Install Protocol Buffer Compiler (using apt-get) +echo "Installing protocol bufffer compiler..." +apt-get install -y protobuf-compiler + +# Add the PROTOC environment variable for Protocol Buffer Compiler +export PROTOC="/usr/bin/protoc" +echo "Set PROTOC = $PROTOC" + +# Add the Protocol Buffer Compiler install location to the PATH +export PATH="$PROTOC:$PATH" +echo "\n Set PATH = $PATH" # Download the protocol buffer release for linux -echo "Downloading protocol bufffer compiler..." -PB_REL="https://github.com/protocolbuffers/protobuf/releases" -curl -LO $PB_REL/download/v31.1/protoc-31.1-linux-x86_64.zip +# echo "Downloading protocol bufffer compiler..." +# PB_REL="https://github.com/protocolbuffers/protobuf/releases" +# curl -LO $PB_REL/download/v31.1/protoc-31.1-linux-x86_64.zip # Create target folder to unzip protoc binaries. -echo "Creating protocol bufffer folder..." -mkdir -p protoc -protoc_path="./protoc" -folder_path=$(realpath "$protoc_path") +# echo "Creating protocol bufffer folder..." +# mkdir -p protoc +# protoc_path="./protoc" +# folder_path=$(realpath "$protoc_path") -echo "Unzipping to folder path of protoc: $folder_path" +# echo "Unzipping to folder path of protoc: $folder_path" # extract binaries to protoc folder -unzip protoc-31.1-linux-x86_64.zip -d $folder_path +# unzip protoc-31.1-linux-x86_64.zip -d $folder_path # changing the execute permissions of the protoc folder -chmod -R 755 ./protoc +# chmod -R 755 ./protoc # Add the PROTOC environment variable for Protocol Buffer Compiler -export PROTOC="$folder_path/bin" -echo "Set PROTOC = $PROTOC" +# export PROTOC="$folder_path/bin" +# echo "Set PROTOC = $PROTOC" # Add the Protocol Buffer Compiler install location to the PATH -export PATH="$folder_path/bin:$PATH" -echo "\n Set PATH = $PATH" +# export PATH="$folder_path/bin:$PATH" +# echo "\n Set PATH = $PATH" # clone the cmb service repo git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git From 1636c28648253ca187f3b86c8e3219d62e1ba699 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 12:08:34 -0500 Subject: [PATCH 10/15] update Trying a few things including using sudo. --- Tools/CI/run_cmb_service.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 6e2fbe70ce..205f809790 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -60,19 +60,50 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port: # Setup ------------------------------------------------------------------------- +try() { + export ThrewError = false + "$@" || throw +} + +throw() { + echo "An error occurred in: $BASH_COMMAND" + export ThrewError = true +} + # Protocol Buffer Compiler ------------------------------------------------------ echo "Updating modules..." -apt-get update +sudo apt-get update # Install Protocol Buffer Compiler (using apt-get) +echo "(sudo) Installing protocol bufffer compiler..." +try sudo apt-get install -y protobuf-compiler + +if $ThrewError; then echo "Installing protocol bufffer compiler..." apt-get install -y protobuf-compiler +fi # Add the PROTOC environment variable for Protocol Buffer Compiler +try sudo export PROTOC="/usr/bin/protoc" +if $ThrewError; then export PROTOC="/usr/bin/protoc" +fi echo "Set PROTOC = $PROTOC" +try $PROTOC/protoc --version + +if $ThrewError; then +export PROTOC=which protoc +try $PROTOC/protoc --version +if $ThrewError; then +echo "Failed to properly run protoc!" +exit -1 +fi +echo "PROTOC path is: $PROTOC" + + + # Add the Protocol Buffer Compiler install location to the PATH export PATH="$PROTOC:$PATH" echo "\n Set PATH = $PATH" From 14713cf8df4ac7bc5442ae6f75436493e41d8651 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 13:37:22 -0500 Subject: [PATCH 11/15] fix Fixing some issues with my bad bash scripting. Adjusting script to better reflect the status as well to verify the PROTOC path is correct. --- Tools/CI/run_cmb_service.sh | 40 ++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 205f809790..639dfb2f80 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -61,17 +61,19 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port: # Setup ------------------------------------------------------------------------- try() { - export ThrewError = false + BASH_COMMAND = "$@" + ThrewError = false "$@" || throw } throw() { - echo "An error occurred in: $BASH_COMMAND" - export ThrewError = true + echo "An error occurred executing this command: $BASH_COMMAND \n" + ThrewError = true } # Protocol Buffer Compiler ------------------------------------------------------ +# Apply any updates echo "Updating modules..." sudo apt-get update @@ -79,34 +81,40 @@ sudo apt-get update echo "(sudo) Installing protocol bufffer compiler..." try sudo apt-get install -y protobuf-compiler +# If the previous command failed, try without sudo if $ThrewError; then -echo "Installing protocol bufffer compiler..." +echo "(retry no sudo) Installing protocol bufffer compiler..." apt-get install -y protobuf-compiler +else +echo "Installed using sudo!" fi # Add the PROTOC environment variable for Protocol Buffer Compiler -try sudo export PROTOC="/usr/bin/protoc" +export PROTOC=which protoc + +# Use the PROTOC env var to see if it is correct by getting the protoc version +try $PROTOC/protoc --version + +# If that failed, then the path is incorrect. Try using the next possible path if $ThrewError; then export PROTOC="/usr/bin/protoc" -fi -echo "Set PROTOC = $PROTOC" - +# Use the PROTOC env var to see if it is correct by getting the protoc version try $PROTOC/protoc --version +fi +# If that failed, then the path is incorrect. Try using the next possible path if $ThrewError; then -export PROTOC=which protoc +export PROTOC="/usr/bin" +# Use the PROTOC env var to see if it is correct by getting the protoc version try $PROTOC/protoc --version +fi + if $ThrewError; then echo "Failed to properly run protoc!" exit -1 +else +echo "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" fi -echo "PROTOC path is: $PROTOC" - - - -# Add the Protocol Buffer Compiler install location to the PATH -export PATH="$PROTOC:$PATH" -echo "\n Set PATH = $PATH" # Download the protocol buffer release for linux # echo "Downloading protocol bufffer compiler..." From 5f470ec3b760b54efda6e8c5ed4469f801bb3850 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 14:56:04 -0500 Subject: [PATCH 12/15] fix Fixing issue with spaces inbetween assignment of ThrewError. Removing the which attempt. --- Tools/CI/run_cmb_service.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 639dfb2f80..7bc88417a3 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -60,15 +60,15 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port: # Setup ------------------------------------------------------------------------- +ThrewError=false try() { - BASH_COMMAND = "$@" - ThrewError = false - "$@" || throw + ThrewError=false + "$@" || throw "$@" } throw() { - echo "An error occurred executing this command: $BASH_COMMAND \n" - ThrewError = true + echo "An error occurred executing this command:$@ \n" + ThrewError=true } # Protocol Buffer Compiler ------------------------------------------------------ @@ -90,17 +90,10 @@ echo "Installed using sudo!" fi # Add the PROTOC environment variable for Protocol Buffer Compiler -export PROTOC=which protoc - -# Use the PROTOC env var to see if it is correct by getting the protoc version -try $PROTOC/protoc --version - -# If that failed, then the path is incorrect. Try using the next possible path -if $ThrewError; then export PROTOC="/usr/bin/protoc" + # Use the PROTOC env var to see if it is correct by getting the protoc version try $PROTOC/protoc --version -fi # If that failed, then the path is incorrect. Try using the next possible path if $ThrewError; then From 2a18d32f735f63a336475d2b7578da5d86e1be26 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 16:34:36 -0500 Subject: [PATCH 13/15] fix Making PROTOC the full path to the binary. --- Tools/CI/run_cmb_service.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index 7bc88417a3..dcc9f5cef9 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -93,14 +93,7 @@ fi export PROTOC="/usr/bin/protoc" # Use the PROTOC env var to see if it is correct by getting the protoc version -try $PROTOC/protoc --version - -# If that failed, then the path is incorrect. Try using the next possible path -if $ThrewError; then -export PROTOC="/usr/bin" -# Use the PROTOC env var to see if it is correct by getting the protoc version -try $PROTOC/protoc --version -fi +try $PROTOC --version if $ThrewError; then echo "Failed to properly run protoc!" From ae5ebab5146a17f4ff076317946f0ed72578de44 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 17:50:44 -0500 Subject: [PATCH 14/15] update Cleaning up the shell script additions. Adding logMessage and logError in order to make messages easier to distinguish from the rest of the logs. Removed the commented out script since this version seems to do the trick. --- Tools/CI/run_cmb_service.sh | 65 ++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 37 deletions(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index dcc9f5cef9..d3b2373d99 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -60,75 +60,66 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port: # Setup ------------------------------------------------------------------------- + ThrewError=false + +# Mimics "Try-Catch" where you have to check if an error occurred after invoking try() { ThrewError=false "$@" || throw "$@" } +# Invoked by try throw() { - echo "An error occurred executing this command:$@ \n" - ThrewError=true + logError "An error occurred executing this command:$@" + ThrewError=true +} + +# A way to log messages that are easy to distinguish from the rest of the logs +logMessage(){ + printf "\n############################################\n" + printf "$@\n" + printf "############################################\n" +} + +# A way to log error messages that are easy to distinguish from the rest of the logs +logError(){ + printf "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" + printf "$@\n" + printf "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" } # Protocol Buffer Compiler ------------------------------------------------------ # Apply any updates -echo "Updating modules..." +logMessage "Updating modules..." sudo apt-get update # Install Protocol Buffer Compiler (using apt-get) -echo "(sudo) Installing protocol bufffer compiler..." +logMessage "Installing protocol bufffer compiler as SUDO..." try sudo apt-get install -y protobuf-compiler # If the previous command failed, try without sudo if $ThrewError; then -echo "(retry no sudo) Installing protocol bufffer compiler..." +logMessage "Installing protocol bufffer compiler as shell assigned account..." apt-get install -y protobuf-compiler else -echo "Installed using sudo!" +logMessage "Protocol bufffer compiler was installed as sudo!" fi -# Add the PROTOC environment variable for Protocol Buffer Compiler +# Add the PROTOC environment variable that points to the Protocol Buffer Compiler binary export PROTOC="/usr/bin/protoc" -# Use the PROTOC env var to see if it is correct by getting the protoc version +# Validate the PROTOC env var by getting the protoc version try $PROTOC --version if $ThrewError; then -echo "Failed to properly run protoc!" +logError "Failed to properly run protoc!" exit -1 else -echo "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" +logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" fi -# Download the protocol buffer release for linux -# echo "Downloading protocol bufffer compiler..." -# PB_REL="https://github.com/protocolbuffers/protobuf/releases" -# curl -LO $PB_REL/download/v31.1/protoc-31.1-linux-x86_64.zip - -# Create target folder to unzip protoc binaries. -# echo "Creating protocol bufffer folder..." -# mkdir -p protoc -# protoc_path="./protoc" -# folder_path=$(realpath "$protoc_path") - -# echo "Unzipping to folder path of protoc: $folder_path" - -# extract binaries to protoc folder -# unzip protoc-31.1-linux-x86_64.zip -d $folder_path - -# changing the execute permissions of the protoc folder -# chmod -R 755 ./protoc - -# Add the PROTOC environment variable for Protocol Buffer Compiler -# export PROTOC="$folder_path/bin" -# echo "Set PROTOC = $PROTOC" - -# Add the Protocol Buffer Compiler install location to the PATH -# export PATH="$folder_path/bin:$PATH" -# echo "\n Set PATH = $PATH" - # clone the cmb service repo git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git From 5d04f805e308a85bfd49315cf47c0e58eb6ae467 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Wed, 13 Aug 2025 18:02:40 -0500 Subject: [PATCH 15/15] update Replacing echo with logMessage and adding a few more progression logs. --- Tools/CI/run_cmb_service.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tools/CI/run_cmb_service.sh b/Tools/CI/run_cmb_service.sh index d3b2373d99..c88d982b50 100755 --- a/Tools/CI/run_cmb_service.sh +++ b/Tools/CI/run_cmb_service.sh @@ -133,20 +133,25 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y export PATH="$HOME/.cargo/bin:$PATH" # Echo server ------------------------------------------------------------------- -echo "Beginning build..." + # Build the echo server +logMessage "Beginning echo server build..." cargo build --example ngo_echo_server + # Run the echo server in the background +logMessage "Running echo server tests..." cargo run --example ngo_echo_server -- --port $echo_port & # CMB Service ------------------------------------------------------------------- # Build a release version of the standalone cmb service +logMessage "Beginning service release build..." cargo build --release --locked # Run the standalone service on an infinite loop in the background. # The infinite loop is required as the service will exit each time all connected clients disconnect. # This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. +logMessage "Running service integration tests..." while :; do ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m; done & # <- use & to run the entire loop in the background