Getting Started

To use AnyRobot you must go through all of the following steps. In addition, it is recommended to familiarize yourself with.

Generating licenses

to be announced... (2 January 2023) #TBA

You will need a Portal License Key and a Runner License Key. (Trial License Keys are available for both Portals and Runners).

Setup Portal

Now that you have your license keys ready, let's first set up a Portal. Portals are "control panels" for managing and monitoring bots and their assigned jobs in real-time.

Creating a new portal instance

For convenience, we provide Portals as docker images, so the first step will be to install docker according to the instructions here.

Since Portals require services such a databases, we'll use Docker Compose to create them for us.

Create a new directory with the following 2 files: docker-compose.yml :

docker-compose.yml
version: '3.8'

services:
  app:
    image: "ghcr.io/anyrobotcom/anyrobot-portal:latest"
    depends_on:
      - "postgres"
      - "redis"
    restart: "unless-stopped"
    env_file:
      - "environment.txt"
    environment:
      DATABASE_URL: "postgres://anyrobot:mysecretpassword123@postgres/postgres"
      APP_URL: "http://localhost:8000"
      REDIS_URL: "redis://redis:6379/1"
    ports:
      - "8000:8080"
    volumes:
      - "storage:/app/storage"

  postgres:
    image: "postgres:15.0-bullseye"
    restart: "unless-stopped"
    environment:
      POSTGRES_USER: "anyrobot"
      POSTGRES_PASSWORD: "mysecretpassword123"
    volumes:
      - "postgres:/var/lib/postgresql/data"

  redis:
    image: "redis:7.0.5-bullseye"
    restart: "unless-stopped"
    volumes:
      - "redis:/data"

volumes:
  postgres: {}
  redis: {}
  storage: {}

and environment.txt :

environment.txt
# Required: a valid Portal License Key
ANYROBOT_PORTAL_LICENSE_KEY=XXXX-XXXX-XXXX # Here is the place for your license

# Required: 
ADMIN_FULL_EMAIL="James Bond <[email protected]>" # admin name and email
ADMIN_PASSWORD=adminSecret123 # admin password/first user password
ADMIN_ORGANIZATION=organization # organization name

MAILERS_DEFAULT_FROM="[email protected]"
MAILER_URL=plain://apikey:[email protected]:587/my.subdomain.example.org

To properly configure sending emails it is recommended to check this documentation

Remember to enter your license key (ANYROBOT_PORTAL_LICENSE_KEY) into .env.docker.prod, change your administrator password (ADMIN_PASSWORD) and change the administrator email (ADMIN_FULL_EMAIL), as you will need it for later steps.

At this point, you should be able to download and launch the containers. Open a terminal and navigate to the directory where docker-compose.yml and .env.docker.prod are located and then run:

docker compose up

You can go now into your browser and visit the address localhost:8000.

You should see a login page to which you log in with the email and the password you entered in environment.txt.

At this stage, you already have a working test portal and can move on to the next step in which you will create a bot.

Creating your first bot

To create a new bot you need to click the big green "Create" button and then from the drop-down list click the "Bot" item.

At this point, you should see a text box in the middle of the screen that you need to fill in with the bot's name and then click the "Create" button.

The name of the bot will be very useful for recognizing them, so choose one by which you will be able to recognize it in the future.

At this stage, you should see a "bot secret" which we will need later, but you don't have to save it because you will be able to find it later in the bots tab.

Your bot should already be created so if everything checks out click the "Save" button and move on to the next step in which you will install AnyRobot Runner.

Setup Runner

In this step, we will install AnyRobot Runner and connect it to the previously created portal. This is necessary to have a device on which we will perform the work ordered in the portal. This has to be a Windows or macOS computer.

Install dependencies

The first step would be to install a package manager if you still don't have one, for Windows this would be chocolatey, and for macOS homebrew.

To do this you need to paste the following command into Powershell or Terminal respectively.

Windows
macOS
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

If you have encountered any problems it is recommended to check the program's documentation, which for Windows can be found here and for macOS here.

If you use Windows you will also need to install git, which you can do by running.

choco install git -Y

The next step will be to install Chrome and Chromedriver.

Windows
macOS
choco install googlechrome -Y
brew install google-chrome
choco install chromedriver -Y
brew install chromedriver

In the next step, we will install Python:

Windows
macOS
choco install python -Y
brew install pyenv
python -m pip install -U pip
pyenv install $(pyenv install -l | grep -v - | tail -1)

If you encounter a problem with pip installation, you can use instead of command above:

python -m ensurepip

pyenv global $(pyenv install -l | grep -v - | tail -1)

eval "$(pyenv init -)"

pip install --upgrade setuptools pip

In this step, we will take care of the installation of Ruby:

Windows
macOS
choco install ruby --version=3.0.0.1
brew install rbenv ruby-build
rbenv init
gem install bundler
rbenv install 3.0.0
rbenv global 3.0.0

The final step will be to install imagemagic:

Windows
macOS
choco install imagemagick
brew install imagemagick

brew install mono-libgdiplus

In addition, on Windows, you need to download msys2 and you can do this with the following command:

choco install msys2

Remember you only have to do this on Windows and it does not apply to other systems.

Install AnyRobot Runner on your bot

To get through this step you will need to download the AnyRobot Runner installation file from here and install it on your machine and follow the steps that occur during the installation.

macOS System Access

On macOS, when you launch the application, the first screen you see will inform you of the current status of your granted permissions.

You need to click the buttons one by one which will open the appropriate tab in the settings and grant all the necessary access to the application.

After doing this, the window will close and you can proceed to the next step.

Running AnyRobot Runner

At this stage, you should turn on the applications and fill in the Portal URL and Bot secret fields with the parameters you acquired at step Setup Portal Portal URL - is the address of your portal. Bot secret - is a field for the bot secret that you created earlier in the portal.

After filling in the above fields, your Runner application should look like this:

After doing so, click Save and the application should disappear after that you can proceed to the next step to run your first job.

Running your first job

We'll start by creating a test.rb file and then output a simple message there. So after creating the file, paste the following code and save it.

test.rb
#!/usr/bin/env ruby

puts "Hello, I'm AnyRobot! 😀"

With the file prepared this way, go to the portal and click create then workflow. Workflow is a task and conditions under which the task will be performed.

On this page, we need to enter a name such as test-workflow-rb, select the bot on which we want to perform this workflow, and in genre select file-based and upload the newly created test.rb file, the completed form should look roughly like this.

Once done, click Save and after going to the next page, click Save again and you should be taken to the newly created workflow page. From here you should be able to click the green play button which should run the uploaded script on the bot.

The test script is very short so you probably won't even notice when it has executed but you can go into AnyRobot Runner and check the activity monitor where you will notice that the script has executed.

We highly encourage you to check out the sample repository for task-based solutions. You can find them in this git repository or checkout Developing Robots page.

Last updated