Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from lcodeca/linux-version
Browse files Browse the repository at this point in the history
Refactoring the Linux version to allow Windows and MacOSX  versions.
  • Loading branch information
lcodeca authored Jul 31, 2020
2 parents 32c7a2e + ff23666 commit 5d7f5b8
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 37 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
test.sh
test.sh

setup-persuasive-devel.sh

build-persuasive-devel.sh
run-persuasive-devel.sh
exec-persuasive-devel.sh
34 changes: 2 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,6 @@ the Eclipse Public License 2.0 which is available at <http://www.eclipse.org/leg
The intent of this git is to provide a Docker environment for [RLLIB+SUMO Utils](https://github.com/lcodeca/rllibsumoutils).
It is based on the [Tensorflow Docker tutorial](https://www.tensorflow.org/install/docker), and presents the same the system requrements.

## docker-cms.sh usage
## Documentation

``` bash
Default parameters:
IMAGE name "tf-gpu-sumo-{today}" [-n, --image-name]
IMAGE folder "docker-image" [-f, --image-folder]
GPU enabled (true) [--no-gpu]
OPTIRUN disabled (false) [--with-optirun]
BUILD: false [-b, --build]
with CACHE: false [-c, --cache]
RUN: false [-r, --run]
with SCREEN: false [-s, --screen]
EXEC: false [-e, --exec]
CONTAINER: "" (use docker ps for the id)
COMMAND: "" [--cmd]
EXP: "" [--exp]
DETACH: (true) [--detach]
DEVELOPMENT dir "" [-d, --devel]
LEARNING dir "" [-l, --learn]
```

Example of use:

- Build the image (with GPU enabled) and launch the example learning in the terminal:
`bash docker-cmd.sh --build --cache --run`
- Build the image with a specific name and launch the example learning in the terminal:
`bash docker-cmd.sh --image-name=rllibsumoutils-docker --build --cache --run`
- Run the already built image in a screen:
`bash docker-cmd.sh --image-name=rllibsumoutils-docker --run --screen`
- Attach to an already running docker container (using docker ps to know the id):
`bash docker-cmd.sh --exec=9ed3cec06e`
- The default docker entry point in the image runs the tests. It can be changed by using:
`bash docker-cmd.sh --run --cmd="/bin/bash"`
Documentation and HOWTOs are available in the `docs` folder.
6 changes: 3 additions & 3 deletions docker-cmd.sh → docker-cmd-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
# http://www.eclipse.org/legal/epl-2.0.

set -e
set -u

IMAGE_NAME="tf-gpu-sumo-$(date +%Y-%m-%d)"
IMAGE_FOLDER="docker-image"
IMAGE_FOLDER="docker-image-linux"
GPU=true
GPU_OPT="--gpus all"
OPTIRUN=false
Expand Down Expand Up @@ -158,12 +159,11 @@ if [[ "$RUN" = true ]]; then
screen -d -m \
$OPTIRUN_OPT docker run $RUN_OPT $COMMAND
else
echo "Running the docker in this teminal."
$OPTIRUN_OPT docker run $RUN_OPT $COMMAND
fi
else
if [[ "$EXEC" = true ]]; then
echo "Attaching to a running docker (see container id using 'docker ps')."
$OPTIRUN_OPT docker exec -it "$CONTAINER" /bin/bash
fi
fi
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion docs/.placeholder

This file was deleted.

35 changes: 35 additions & 0 deletions docs/howto-linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# RLLIB SUMO Docker environment for Linux

## docker-cmd-linux.sh usage

``` bash
Default parameters:
IMAGE name "tf-gpu-sumo-{today}" [-n, --image-name]
IMAGE folder "docker-image-linux" [-f, --image-folder]
GPU enabled (true) [--no-gpu]
OPTIRUN disabled (false) [--with-optirun]
BUILD: false [-b, --build]
with CACHE: false [-c, --cache]
RUN: false [-r, --run]
with SCREEN: false [-s, --screen]
EXEC: false [-e, --exec]
CONTAINER: "" (use docker ps for the id)
COMMAND: "" [--cmd]
EXP: "" [--exp]
DETACH: (true) [--detach]
DEVELOPMENT dir "" [-d, --devel]
LEARNING dir "" [-l, --learn]
```

Example of use:

- Build the image (with GPU enabled) and launch the example learning in the terminal:
`bash docker-cmd-linux.sh --build --cache --run`
- Build the image with a specific name and launch the example learning in the terminal:
`bash docker-cmd-linux.sh --image-name=rllibsumoutils-docker --build --cache --run`
- Run the already built image in a screen:
`bash docker-cmd-linux.sh --image-name=rllibsumoutils-docker --run --screen`
- Attach to an already running docker container (using docker ps to know the id):
`bash docker-cmd-linux.sh --exec=9ed3cec06e`
- The default docker entry point in the image runs the tests. It can be changed by using:
`bash docker-cmd-linux.sh --run --cmd="/bin/bash"`
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ the Eclipse Public License 2.0 which is available at <http://www.eclipse.org/leg

The intent of this git is to provide a Docker environment for [RLLIB+SUMO Utils](https://github.com/lcodeca/rllibsumoutils).
It is based on the [Tensorflow Docker tutorial](https://www.tensorflow.org/install/docker), and presents the same the system requrements.

## HOWTOs

- How to use the RLLIB SUMO Docker environment with linux [HOWTO](docs/howto-linux.md)

0 comments on commit 5d7f5b8

Please sign in to comment.