This setup process will allow you to run AI:MMO locally via docker or a kubernetes cluster, and to be able to contribute towards the project.
This can be done either manually or using the setup script.
- Run
python aimmo_setup.pyin the AI:MMO root directory. Then: - Open Docker to finalise the install process. (This will install the latest release)
- Get the latest Unity bundle release from the aimmo-unity repo.
- See Useful information for additional details about the script.
- First you get the brew package manager. Then:
- Follow the instructions at game frontend documentation in order to set up the frontend requirements, (you should be in the game_frontend folder for this step).
- Run
brew install pipenv, followed bypipenv install, thenpipenv shell. This will get and activate the virtualenv we recommend for the project. (more information on pipenv)
The game should now be set up to run locally (If you ran the setup script, it will have done these next steps for you). If you wish to be able to run the project with Kubernetes and containers, follow these next steps:
- Install both Docker and Virtualbox, using:
brew update && brew cask install docker virtualbox
- Install a fixed version of Minikube, (current version is 0.25.2, this can be confirmed here). To get this, run:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- To install kubectl (Kubernetes), use:
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.4/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- Alter your
/etc/hostsfile by adding the following line to the end of the file:192.168.99.100 local.aimmo.codeforlife.education. You may need to use sudo for this step as the file is protected. - Get the latest Unity bundle release from the aimmo-unity repo.
- Follow the instructions for deploying Portainer, to create a dashboard for your local docker containers.
- Ensure you are inside the python virtualenv,
pipenv shell. - To run locally, use:
python run.py. - If you want to run the project with Kubernetes, first run:
minikube start. - Now use
python run.py -kto run the project using the Kubernetes cluster.
This can be done either manually or using the setup script.
- Run
python aimmo_setup.pyin the AI:MMO root directory. Then: - Get the latest Unity bundle release from the aimmo-unity repo.
- See Useful information for additional details about the script.
- First run
sudo apt-get updateto save having to do it later in the process. - Follow the instructions at game frontend documentation in order to set up the frontend requirements, (you should be in the
game_frontendfolder for this step). - Next run
sudo apt-get install python-pip, followed bypip install pipenvto get the pipenv) virtual environment. - Now use
pipenv installandpipenv shellto get the requirements for the project and enter the virtualenv.
The game should now be set up to run locally (If you ran the setup script, it will have done these next steps for you). If you wish to be able to run the project with Kubernetes and containers, follow these next steps:
- If not already installed follow the Virtualbox installation instructions.
- Install Snap) using
sudo apt install snapd. - Now run
sudo snap install kubectl --classicto install kubectl (Kubernetes). - To install Docker, either use
sudo apt-get install docker-ceto install a fixed version of the latest release, or follow the Ubuntu install instructions on the Docker website. - Alter your
/etc/hostsfile by adding the following line to the end of the file:192.168.99.100 local.aimmo.codeforlife.education. You may need to use sudo for this step as the file is protected. - Get the latest Unity bundle release from the aimmo-unity repo.
- Follow the instructions for deploying Portainer, to create a dashboard for your local docker containers.
- Ensure you are inside the python virtualenv,
pipenv shell. - To run locally, use:
python run.py. - If you want to run the project with Kubernetes, first run:
minikube start. - Now use
python run.py -kto run the project using the Kubernetes cluster.
- Contact a member of the Code for Life team via the Code for Life contact form.
The game should now be set up to run locally. If you wish to be able to run the project with Kubernetes and containers, follow these next steps:
- If not already installed follow the Virtualbox installation instructions.
- Next, download chocolatey and run
choco install kubernetes-cli. - Then follow the docker installation instructions for Windows.
- Alter your
/etc/hostsfile by adding the following line to the end of the file:192.168.99.100 local.aimmo.codeforlife.education. You may need admin privileges for this step as the file is protected. - Follow the instructions for deploying Portainer, to create a dashboard for your local docker containers.
- Ensure you are inside the python virtualenv,
pipenv shell. - To run locally, use:
python run.py. - If you want to run the project with Kubernetes, first run:
minikube start. - Now use
python run.py -kto run the project using the Kubernetes cluster.
Here you can find some other useful information regarding the setup or usage of various aspects of the project.
- It may be the case that the frontend does not load properly upon starting aimmo (when running the script). If this is the case then you may need to follow the game frontend documentation in order to resolve this (usually all the packages are there, it just requires you to set them up manually).
- If the script fails when attempting to install Docker, it may be because you have an old version of docker currently installed. To fix this, run:
sudo apt-get remove docker docker-engine docker.io, then re-run the script. - If there is an issue when using containers or the virtual enviroment. Then there small chance that VT-x/AMD-x virtualization has not been enabled on your machine. If this is the case the main way to solve this is to enable it through the BIOS settings.
- Use
./all_tests.pyto run all the tests (note that this is several pages of output). - The
--coverageoption will generate coverage data for the tests usingcoverage.py.
kubectlandminikubecan be used to interact with the cluster.- Running either command without any options will give the most useful commands.
- Use
minikube dashboardto open the Kubernetes dashboard in your browser.
- To create an another admin account:
python example_project/manage.py createsuperuser- By default, we create an admin account with credentials admin:admin when you start the project.