Skip to content

Commit

Permalink
Merge pull request #2 from yaacov/main
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
yaacov authored Jan 10, 2024
2 parents f51c62d + 1b8f95a commit 9d8f6b3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 17 deletions.
69 changes: 52 additions & 17 deletions README.md
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
```
Binary file added ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d8f6b3

Please sign in to comment.