Skip to content

Commit

Permalink
Merge pull request #9 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 0ba574f + 6652386 commit ea4a6bc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
63 changes: 44 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,63 @@
# rose-game-web-ui
Web based user interface for the ROSE game.
[ROSE game](https://github.com/RedHat-Israel/ROSE) web based graphical user interface.

This component implement a web based graphical user interface for the ROSE game.

<p align="center">
<img src="web-ui.png" alt="rose game components diagram" width="400"/>
</p>

ROSE project: https://github.com/RedHat-Israel/ROSE

Run the rose reference driver:
## Requirements

``` bash
Requires | Version | |
----------|---------| ---- |
Podman (or Docker) | >= 4.8 | For running containerized |
Node | >= 20 | 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 the web based graphical user interface loally

Clone this repository, and make sure you have a game engine running.

Run the user interface:

```bash
# Get help
podman run --rm --network host -it quay.io/rose/rose-game-ai-reference:latest --help
npm start -- --help

# 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
# Run the server (connect to a game engine running on http://127.0.0.1:8880)
npm start -- -hp http://127.0.0.1:8880 -wp ws://127.0.0.1:8880 -p 8080
```

Run the rose game engine:
## Running ROSE game components containerized

### Running the game engine ( on http://127.0.0.1:8880 )

``` bash
# Start the ROSE game game engine, and connect to the Go driver
podman run --rm \
--network host \
-it quay.io/rose/rose-game-engine:latest \
--drivers http://127.0.0.1:8082
podman run --rm --network host -it quay.io/rose/rose-game-engine:latest
```

Run the rose game web UI:
### Running the game web based user interface ( on http://127.0.0.1:8080 )

```bash
``` bash
podman run --rm --network host -it quay.io/rose/rose-game-web-ui:latest
```

Run locally:
### Running your self driving module, requires a local `driver.py` file with your driving module. ( on http://127.0.0.1:8081 )

```bash
npm start
``` 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
```

Browse to http://127.0.0.1:8080 to run the game.
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ function startServer (server, args) {
console.log(`SSL Key: ${args.key}`)
console.log('Running in HTTPS mode')

console.log(`Lissten https://127.0.0.1:${args.port}`)
console.log(`Server URL https://127.0.0.1:${args.port}`)
} else {
console.log('Running in HTTP mode')

console.log(`Lissten http://127.0.0.1:${args.port}`)
console.log(`Server URL http://127.0.0.1:${args.port}`)
}
})
}
Expand Down
Binary file added web-ui.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 ea4a6bc

Please sign in to comment.