docker-compose file for starting multiple CARLA servers #4361
markcoletti
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using multiple CARLA servers running in parallel to train autonomous vehicle models using an evolutionary algorithm (EA). We had previously used a bash script that would spin up a CARLA server for each available GPU. Since this script used the CARLA docker image to spin up the servers, we decided to switch to using a
docker-compose
file to spin up and down CARLA servers. This not only allowed us to havedocker-compose
automatically restart failed servers, but to manage the logging such that we can easily look at the logs for a specific CARLA server to diagnose problems.I'm sharing the
docker-compose.yml
file that I use to do this; it uses the 0.9.5 image because, unfortunately, that's the latest version of the corresponding client thatpip install carla
yields.In case you are not familiar with
docker-compose
, all of the following must be done for the same directory that contains the abovedocker-compose.yml
file.docker-compose up -d --remove-orphans
docker-compose down
docker-compose ps
carla2
's logs:dco logs --tail=30 carla2
There may be a more elegant implementation where a single server can be specified, and the use of
docker-compose
's--scale
parameter can be used to freely dial up and down the desired number of coincident CARLA servers. But, for now, thisdocker-compose.yml
meets our needs, and hopefully it may be useful to someone else.Beta Was this translation helpful? Give feedback.
All reactions