Skip to content

Commit

Permalink
Enable scrimmage docker container to run host mission files
Browse files Browse the repository at this point in the history
  • Loading branch information
SyllogismRXS committed Apr 17, 2018
1 parent deee8e5 commit 493a79e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,41 @@ tree:

cmake .. -DMOOSIVP_SOURCE_TREE_BASE=/path/to/moos-ivp

## Download SCRIMMAGE Docker Image
## Running SCRIMMAGE inside of Docker

The SCRIMMAGE docker image is pushed to a public repository after a successful
build on Travis. If docker is installed on your machine, you can obtain the
SCRIMMAGE docker image by running the following command:

$ docker pull syllogismrxs/scrimmage:latest

Now you can run an instance of the SCRIMMAGE docker image and run SCRIMMAGE in
headless mode:
You can pass mission files from your host machine to the `scrimmage` executable
inside of the docker container with the following command:

$ cd /path/to/scrimmage/missions
$ docker run --name my-scrimmage \
-v ${PWD}/straight_jsbsim.xml:/straight_jsbsim.xml \
syllogismrxs/scrimmage:latest /straight_jsbsim.xml

The previous command mounts the `straight_jsbsim.xml` mission file on your host
machine into the scrimmage container and then the `/straight_jsbsim.xml`
portion at the end of the command overwrites the default docker `CMD`, which is
defined in the Dockerfile. Finally, the `scrimmage` executable is passed the
`/straight_jsbsim.xml` mission file.

Since we provided a name for our container, we can easily extract the SCRIMMAGE
log files from the docker container:

$ docker cp my-scrimmage:/root/.scrimmage/logs .

If you need to drop into a shell inside of the scrimmage container, you will
need to overwrite the docker image's ENTRYPOINT.

$ docker run -it --entrypoint="/bin/bash" syllogismrxs/scrimmage:latest

Once inside of the container, you will need to source the `setup.bash` file
manually before running a mission.

$ docker run -it syllogismrxs/scrimmage:latest /bin/bash
$ source ~/.scrimmage/setup.bash
$ scrimmage ./missions/straight-no-gui.xml

Expand Down
4 changes: 4 additions & 0 deletions ci/dockerfiles/ubuntu-16.04
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,7 @@ RUN pip install -e .

WORKDIR /root/scrimmage/scrimmage
RUN /bin/bash -c "source ~/.scrimmage/setup.bash && py.test python/tests"

# Setup the scrimmage docker image to run as an executable
ENTRYPOINT ["/root/scrimmage/scrimmage/ci/scripts/scrimmage-wrapper.sh"]
CMD ["/root/scrimmage/scrimmage/missions/straight-no-gui.xml"]
4 changes: 4 additions & 0 deletions ci/scripts/scrimmage-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

source /root/.scrimmage/setup.bash
scrimmage $1

0 comments on commit 493a79e

Please sign in to comment.