Skip to content

AlterNT/AI-Agent-Competition-Platform

Repository files navigation

Server Installation And Execution

Dependencies

The only required dependency to run the server is docker. As everyone's environment is different there are no installation instructions that are guaranteed to work natively.

Setup & Configuration

# under the /server directory copy the config example
cp config.json5.example config.json5

Setting The Server Password

in docker-compose.yml replace password with your desired password in the following line: - NEO4J_AUTH=neo4j/password

In config.json5 change database.password to be the same password.

Setting The Secret Key And Salt

Set the following 2 properties in config.json5, they determine how authentication tokens are generated from student number:

  • config.database.aiPlatformSecretKey
  • config.database.aiPlatformSalt

Setting The Admin Token

Set the following property in config.json5, it determines what the admin password is by default:

  • config.database.defaultAdminToken

Note that when the server is started an admin user is created when, but not deleted when the default admin token changes, and must be manually deleted through neo4j browser.

Setting The Game

Add a key/value pair to config.games in the format of the existing examples.

Generating Tokens

Tokens for students and admins can be generated either from the CLI or the website. The instructions for generating them in the website are located in the website README. Token file contain student numbers in the following format:

20000000
30000000
40000000
...

User Tokens

# in /server
docker compose up neo4j
sleep 60 && docker compose run server node . tokens <path-to-token-file>

Admin Tokens

# in /server
sleep 60 && docker compose run server node . admin-tokens <path-to-token-file>

Configuring The Website

Please see the website README at /website/README.md for information.

Execution

Running The Server

# under the project directory (not in server!)
docker compose build && docker compose up

You may wish to docker compose up neo4j and then run docker compose up once neo4j has started. The server is prone to crashing upon losing connection to the database.

The server runs on port 8080 with the website running at port 3000. The two are not managed by the same program but their own separate containers.

Running Tests

cd tests
docker compose build && docker compose up

The process for running tests is the same as that of running the server but done with the docker containers in the /tests directory.

Make sure that the server or the database are not running at the same time (as they use the same ports).

Native Server Installation And Execution

This is heavily advised against and only applicable to development of the project. The project is expected to be run in docker containers and not officially supported natively.

Dependencies

node.js/npm and python (3) are the only required dependencies.

Installation tutorials:

Versions

Recommended:

  • node: >14

Requirements for Neo4j:

  • java: openjdk version >11 (or equivalent)
  • neo4j: >4.4
  • apoc: >4.4

Installation of Node Modules

cd server
npm ci

Installation of Neo4j

This step is optional, please refer here.

Starting the Server

# in the /server directory
node .

Server

All command under this section are executed under the /server directory. First change to the client directory and install dependencies:

cd server
npm i
cp config.json5.example config.json5

Starting the Server

node . start

Connection to DB Instance With Neo4j Browser

  1. Start Neo4j
  2. In Neo4j Browser: Add --> Remote Connection
  3. Fill in details from .env file on the 2 following steps
  4. Connect to the Remote Connection and Open
  5. If lacking any styling run :style reset
  6. If server hangs indefinitely disconnect Neo4j browser, and reconnect to the db from the server

Native Neo4j Installation (NOT REQUIRED)

Dependencies

Neo4j Installation

Download Neo4j Community edition TODO: install instructions

Configuring Neo4j

After installing neo4j you must change the default password

neo4j-admin set-initial-password <insert-password-here> # possibly requiring root permissions

Go to the server dir and edit config.json5 Fill in the same username and password.

Installing APOC (and Neo4j Libraries)

This section is only valid on debian based linux distros (ubuntu and ubuntu-derivatives count)

The development build of this project is using:

  • neo4j 4.4.10
  • APOC 4.4.0.8
  1. Check neo4j version (neo4j --version)
  2. Install a matching version of the APOC library (ends in -all.jar) from the GH releases
  3. Check plugin directory here, at the time of writing the plugin directory is located as follows:
    • Debian-based Linux: /var/lib/neo4j/plugins
    • MacOS/Linux: <neo4j-home>/plugins
    • Windows: <neo4j-home>\plugins

About

A online platform to allow for students to test their AI Agents against one another for any game implementation. UWA Professional Computing 2022 Project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors