-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from yaacov/main
update readme
- Loading branch information
Showing
2 changed files
with
52 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,67 @@ | ||
# rose-game-ai | ||
Reference AI driver for the ROSE game using machine learning. | ||
[ROSE game](https://github.com/RedHat-Israel/ROSE) template for self driving AI module. | ||
|
||
This is a reference implementation of a self driving modules for the ROSE game. | ||
|
||
This example uses machine learning algorithms, and requires [pytorch](https://pytorch.org/) when running locally. | ||
|
||
<p align="center"> | ||
<img src="ai.png" alt="rose game components diagram" width="400"/> | ||
</p> | ||
|
||
ROSE project: https://github.com/RedHat-Israel/ROSE | ||
|
||
Run the driver: | ||
## Requirements | ||
|
||
``` bash | ||
# Get help | ||
podman run --rm --network host -it quay.io/rose/rose-game-ai-reference:latest --help | ||
Requires | Version | | | ||
----------|---------| ---- | | ||
Podman (or Docker) | >= 4.8 | For running containerized | | ||
Python | >= 3.9 | For running the code loally | | ||
|
||
## ROSE game components | ||
|
||
Component | Reference | | ||
----------|-----------| | ||
Game engine | https://github.com/RedHat-Israel/rose-game-engine | | ||
Game web based user interface | https://github.com/RedHat-Israel/rose-game-web-ui | | ||
Game car driving module | https://github.com/RedHat-Israel/rose-game-ai | | ||
|
||
## Running a self driving module | ||
|
||
Clone this repository, and make sure you have a game engine running. | ||
|
||
Write your own driving module, you can use the file `mydriver.py`: | ||
|
||
```bash | ||
vi mydriver.py | ||
``` | ||
|
||
Run using `mydriver.py` as the driving module: | ||
|
||
# Run the driver on localhost port 8082 (default port in 8081) | ||
podman run --rm --network host -it quay.io/rose/rose-game-ai-reference:latest --port 8082 | ||
```bash | ||
make run | ||
``` | ||
|
||
Run the server: | ||
## Running ROSE game components containerized | ||
|
||
### Running the game engine ( on http://127.0.0.1:8880 ) | ||
|
||
``` bash | ||
# Start the ROSE game server, and connect to the Go driver | ||
podman run --rm \ | ||
--network host \ | ||
-it quay.io/rose/rose-server:latest \ | ||
--drivers http://127.0.0.1:8082 | ||
podman run --rm --network host -it quay.io/rose/rose-game-engine:latest | ||
``` | ||
|
||
Run locally: | ||
### Running the game web based user interface ( on http://127.0.0.1:8080 ) | ||
|
||
```bash | ||
python client/main.py -d ./driver.py | ||
``` bash | ||
podman run --rm --network host -it quay.io/rose/rose-game-web-ui:latest | ||
``` | ||
|
||
Browse to http://127.0.0.1:8880 to run the game. | ||
### Running your self driving module, requires a local `driver.py` file with your driving module. ( on http://127.0.0.1:8081 ) | ||
|
||
``` bash | ||
# NOTE: will mount mydriver.py from local directory into the container file system | ||
podman run --rm --network host -it \ | ||
-v $(pwd)/mydriver.py:/mydriver.py:z \ | ||
-e DRIVER /mydriver.py \ | ||
quay.io/rose/rose-game-ai:latest | ||
``` |