TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Bot Changes in 2.7 - Running Bots with Docker

    Scheduled Pinned Locked Moved News
    2 Posts 1 Posters 1.2k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LaFayetteL Offline
      LaFayette Admin
      last edited by LaFayette

      Bots can now be run with docker. After installing docker on your system, you can run a bot with:

      docker run \
         --rm \
         --network host \
         --pull always \
         --restart always \
         --env BOT_PORT_NUMBER=4000 \
         --env LOBBY_URI=https://prod.triplea-game.org \
         --env BOT_NAME=BotYOUR_BOT_NAME_HERE \
         --env EXIT_ON_GAME_END=true \
         --env BOT_MAX_MEMORY=256m \
         -v /opt/bot/maps:/downloadedMaps \
         -v /home/bot/triplea/savedGames/autoSave:/home/bot/triplea/savedGames/autoSave \
         --name bot \
         ghcr.io/triplea-game/bot:latest
      

      The above mounts two folders, these folders need to exist on your file system:

      • /opt/bot/maps
      • /home/bot/triplea/savedGames/autoSave

      Those folders need to be owned by a user named 'bot' with UID '999'

      Port 4000 needs to be opened up on firewall.

      To download maps, this is a download script: https://github.com/triplea-game/infrastructure/blob/master/ansible/roles/bot/templates/download-all-maps.sh.j2

      You'll need to download that, modify it as needed, replace anything that is in double braces, eg: {{ ... }}.

      Then chmod +x <script> and then run it. Put the script on a cronjob and maps will be updated regularly.

      Note the "--pull always", which means the latest version of the bots will be started each time on startup. Also note the "exit on game end" flag, which restarts when a game ends. This way, after each game - the bot will shutdown. Note the "--restart always" which will have docker automatically start the bot whenever it is shut down. Thereby, the bot will restart between games & will then automatically update and read any updated maps on the file system.

      More info & authoritative documentation for everything bots, is at: https://github.com/triplea-game/triplea/tree/master/game-app/game-headless

      1 Reply Last reply Reply Quote 3
      • LaFayetteL Offline
        LaFayette Admin
        last edited by

        The 'EXIT_ON_GAME_END' flag is new in 2.7.
        All 2.7 lobby bots have this configured.
        The lobby bots are configured in a very similar way, except as a linux service (using systemctl)

        The way lobby bots are installed can be reverse engineered from:

        • https://github.com/triplea-game/infrastructure/blob/master/ansible/roles/bot/tasks/main.yml
        • https://github.com/triplea-game/infrastructure/tree/master/ansible/roles/bot/templates
        1 Reply Last reply Reply Quote 3

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums