Technical manual
...
iR Engine deployment
iR Engine on Docker Desktop
15 min
note udp networking does not work properly on docker desktop as of this writing, as docker desktop does not expose the ip addresses/ports of the node publicly, so mediasoup cannot connect over udp if you want to test audio/video calling or networked movements, please use minikube install kubectl, helm, and docker desktop if kubectl https //kubernetes io/docs/tasks/tools/ , helm https //helm sh/docs/intro/install/ , and/or docker desktop https //docs docker com/desktop/install/linux install/ aren't already installed on your machine, install them windows and mac docker desktop installation instructions can be found here https //docs docker com/desktop/install/windows install/ and here https //docs docker com/desktop/install/mac install/ you may also need to install docker compose https //docs docker com/compose/install/ clone ir engine repo to your local machine to build the ir engine docker image locally, and to have a pre tested way to run various local services, you'll need to get the ir engine repo on your machine this is most easily done by running git clone https //github com/ir engine/ir engine git start minio & mariadb server locally via docker for simplicity, we recommend running minio & mariadb server on your local machine outside of microk8s if you run docker compose up from the top level /scripts directory in the ir engine repo, it will start up minio & multiple mariadb docker containers (as well as a redis server, which is not needed) for mariadb containers, one is intended for local development, runs on port 3306; another, intended for automated testing purposes, runs on port 3305; and the last one, intended for minikube/microk8s testing, runs on port 3304 once the docker container is stopped, you can start it again by running npm run dev docker alternatively, if you want to just run minio & mariadb on its own without docker, that's fine too you'll just have to configure the helm config file to have the appropriate s3 & sql server configuration, and possibly change the script /scripts/build minikube sh enable kubernetes in docker desktop inside docker desktop, go to settings there should be a section for kubernetes (as of this writing, located between docker engine and software updates settings) click on that, then check the checkbox for enable kuberentes, and then click the button apply and restart when docker desktop restarts, it should now run a minikube like kubernetes cluster on startup the kubernetes context for this should be named docker desktop edit system hostfile to point etherealengine addresses to 127 0 0 1 you'll need to edit your hostfile to point certain domains to 127 0 0 1, which is how docker desktop routes traffic to its kubernetes cluster on linux, this is done by running sudo gedit /etc/hosts add the following line 127 0 0 1 local etherealengine org api local theinfinitereality io instanceserver local theinfinitereality io 00000 instanceserver local theinfinitereality io 00001 instanceserver local theinfinitereality io 00002 instanceserver local theinfinitereality io 00003 instanceserver local theinfinitereality io you should also see a section that looks like this # added by docker desktop \# to allow the same kube context to work on the host and the container 127 0 0 1 kubernetes docker internal \# end of section the first line says to point several local etherealengine org domains internally to the kubernetes cluster, where the nginx ingress server will redirect the traffic to the appropriate pod the section it automatically added is used for giving docker containers, including the kubernetes cluster, access to the host machine make sure to save this file after you've edited it on linux, at least, you need root permissions to edit it add helm repos you'll need to add a few helm repos run the following helm repo add agones https //agones dev/chart/stable helm repo add redis https //charts bitnami com/bitnami helm repo add etherealengine https //helm etherealengine org this will add the helm charts for agones, redis, and ir engine, respectively install agones and redis deployments after adding those helm repos, you'll start installing deployments using helm repos make sure that kubectl is pointed at docker desktop by running kubectl config current context , which should say 'docker desktop' you can also run kubectl config get contexts to get all contexts that kubectl has been configured to run; the current one will have a ' ' under the left most 'current' column once kubectl is pointed to docker desktop, from the top of the ir engine repo, run helm install f \</path/to/agones default values yaml> agones agones/agones to install agones and helm install local redis redis/redis to install redis agones default values yaml https //github com/ir engine/ir engine ops/blob/master/configs/agones default values yaml can be found in ir engine ops https //github com/ir engine/ir engine ops/ repo you can run kubectl get pods a to list all of the pods running in docker desktop after a minute or so, all of these pods should be in the running state run build docker desktop sh when docker desktop's kubernetes cluster is running, run the following command from the root of the ir engine repo /scripts/build docker desktop sh if you face issue related to "packages/projects/projects/" does not exist then run following commands in your terminal export mysql host=localhost npm run dev docker npm run dev reinit npx ts node swc scripts/install projects js the script builds the full repo docker image using several build arguments vite, which builds the client files, uses some information from the mariadb database created for local k8s deployments to fill in some variables, and needs database credentials the script will supply default values for all of the mysql variables if they are not provided to the script, as well as vite client host, vite server host, and vite instanceserver host the latter three will make your docker desktop k8s deployment accessible on (local/api local/instanceserver local) etherealengine org ; if you want to run it on a different domain, then you'll have to set those three environment variables to what you want them to be (and also change the hostfile records you made pointing those subdomains to 127 0 0 1) this will build an image of the entire ir engine repo into a single docker file when deployed for different services, it will only run the parts needed for that service this may take up to 15 minutes, though later builds should take less time as things are cached update helm values file this will use a helm config file titled 'local values yaml' to configure the deployment there is a template https //github com/ir engine/ir engine ops/blob/master/configs/local dockerdesktop template values yaml for this file in ir engine ops https //github com/ir engine/ir engine ops/ repo if you are using local file server as explained a couple of steps earlier then, update 'local values yaml' variable api fileserver hostuploadfolder with value e g '/hosthome/\<os user name>/\<engine folder>/packages/server/upload' the folder must be in home folder and make sure to use /hosthome/ instead of home in path it's mandatory to point to /packages/server/upload folder of your engine folder deploy ir engine helm chart run the following command helm install f \</path/to/local values yaml> f \</path/to/db refresh true values yaml> local ir engine/ir engine db refresh true values yaml https //github com/ir engine/ir engine ops/blob/master/configs/db refresh true values yaml can be found in ir engine ops https //github com/ir engine/ir engine ops/ repo after a minute or so, running kubectl get pods should show one or more instanceservers, one or more api servers, and one client server in the running state setting force db refresh=true made the api servers (re)initialize the database since you don't want that to happen every time a new api pod starts, run helm upgrade reuse values f \</path/to/db refresh false values yaml> local ir engine/ir engine the api pods will restart and will now not attempt to reinit the database on boot db refresh false values yaml https //github com/ir engine/ir engine ops/blob/master/configs/db refresh false values yaml can be found in ir engine ops https //github com/ir engine/ir engine ops/ repo accept invalid certs since there are no valid certificates for this domain, you'll have to tell your browser to ignore the insecure connections when you try to load the application go to < https //local etherealengine org/> https //local etherealengine org/> , you should see a warning about an invalid certificate; accept this invalid cert to get to the home page next if it keeps displaying 'loading routes' progress for a long time, it is due to the fact that you have to allow certificates you'll have to open the dev tools for your browser and go to the 'console' tab you will see some errors in url address starting with 'wss' replace 'wss' with 'https' and open it in new tab accept the certificate and reload your ir engine tab you need to do this for following domains wss\ //api local theinfinitereality io > https //api local theinfinitereality io https //api local theinfinitereality io wss\ //instanceserver local theinfinitereality io > https //instanceserver local theinfinitereality io https //instanceserver local theinfinitereality iohttps //localhost 9000 https //localhost 9000 you can open developer tools in chrome by clicking the side menu with three dots, then more tools > developer tools (or use ctrl+shift+i)