Skip to content

Commit

Permalink
pdate docs
Browse files Browse the repository at this point in the history
  - update readme
  - move pipenv to the docs package
  - update how to check exercises doc

Signed-off-by: yzamir <kobi.zamir@gmail.com>
  • Loading branch information
yaacov committed Sep 12, 2023
1 parent dbaf159 commit e2c8463
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 44 deletions.
76 changes: 37 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,34 @@ Refer to our GitHub pages for the course materials and additional resources:
- [Read](https://opensource.com/education/15/9/open-source-education-israel)
an article by Laura Novich on [opensource.com](https://opensource.com)

## Getting started
# Getting started

The following commands should be performed only once; after creating the
environment you will be connecting to the same environment each time you
open a new session.

Use venv to create a virtual environment and to install the rest of
the dependencies:
## Cloning the Repository

python3 -m venv ~/.venv/rose
First, clone the ROSE repository from GitHub:

After creating the environment, we want to activate and enter our
environment (make sure you're in the ROSE directory):
```bash
git clone https://github.com/RedHat-Israel/ROSE.git
```

source ~/.venv/rose/bin/activate
Navigate to the cloned directory:

After entering the virtual enviornment we need to install the project dependencies:
```bash
cd ROSE
```

pip install -r requirements.txt
Once you're in the ROSE directory, install the project dependencies:

Indication that you are inside the environment, the prompt line will
look like this:

(rose) [username@hostname ROSE]$
```bash
pip install -r requirements.txt
```

## Running the server

If you are not in your virtual environment, please activate it:

source ~/.venv/rose/bin/activate

Start the server on some machine:

./rose-server
Expand All @@ -103,7 +100,7 @@ Build the Docker image:

Run the Docker image on port 8880:

podman run -it --rm --name=rose_server -p 8880:8880 rose_server python ./rose-server
podman run -it --rm --name=rose_server -p 8880:8880 -p 8765:8765 rose_server

If you don't want to see the log of the run in the current window,
replace `-it` with `-d`.
Expand All @@ -116,7 +113,7 @@ game.
You can use SSH tunneling when running the server on your remote VM, so
you can view the game in you local browser:

ssh -L 8880:127.0.0.1:8880 {user}@{server-address}
ssh -L 8880:127.0.0.1:8880 -L 8765:127.0.0.1:8765 {user}@{server-address}

After starting the server (as mentioned above), open a browser at
http://127.0.0.1:8880/ to view and control the game.
Expand All @@ -128,15 +125,11 @@ server, and browse from a local machine in case port 8880 or 8888 are
blocked by [firewalld](https://firewalld.org/):

sudo firewall-cmd --add-port=8880/tcp --permanent
sudo firewall-cmd --add-port=8888/tcp --permanent
sudo firewall-cmd --add-port=8765/tcp --permanent
sudo firewall-cmd --reload

## Running a driver

In a new window, open your virtual environment:

source ~/.venv/rose/bin/activate

Create your driver file:

cp examples/none.py mydriver.py
Expand All @@ -146,16 +139,11 @@ name.

Start up the client, using your driver file:

./rose-client mydriver.py

The server address can be specified that way (Replace '10.20.30.44' with
your server address):

./rose-client -s 10.20.30.44 mydriver.py
./rose-client --driver mydriver.py

For running the driver on the Docker container use:

docker exec -it rose_server python ./rose-client examples/random-driver.py
docker exec -it rose_server --driver examples/random-driver.py

For driver modules, see the [examples](examples) directory.

Expand All @@ -176,6 +164,14 @@ To stop a race, use the rose-admin tool on any machine:

./rose-admin {server-address} stop

To reset a race, use the rose-admin tool on any machine:

./rose-admin {server-address} reset

To set drivers, use the rose-admin tool on any machine:

./rose-admin {server-address} set-drivers {URL of driver1} {URL of driver2}

To modify the game rate, you can use the "set-rate" command. The
following command would change game rate to 10 frames per second:

Expand Down Expand Up @@ -208,26 +204,28 @@ Example `tmux` commands:
Should you want to contribute to the project, please read the
[Code of Conduct](docs/code-of-conduct.md).

To create venv use:
Make sure you have python and make installed

# On fedora
dnf install python make

python3 -m venv ~/.venv/rose

To enter the venv:
Change directory to the application you want to work on:

source ~/.venv/rose/bin/activate
# For the client code
cd rose/client

To install development requirements:

pip install -r requirements-dev.txt

For development in docker, use:

docker build --build-arg DEV=True -t rose_dev .
make build-image

Before submitting patches, please run the tests:

flake8
pytest
make test
make lint

Creating coverage report in html format:

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions how_to_check_student_exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

## Running the checks

First, make sure you are using python 3.7 or later:
First, change directory to test folder before running the tests:

`cd docs/course_materials/exercises/test_exercises

Make sure you are using python 3.7 or later:

`pipenv --python /usr/local/bin/python3.7 shell`

Install all dependencies:

`pipenv install --dev`

Second, change directory to test folder before running the tests:

`cd docs/course_materials/exercises/test_exercises`

For getting the Help use:

`python rose_check.py --help`
Expand Down

0 comments on commit e2c8463

Please sign in to comment.