Environment control
What is environment control?
Controlling the environment where your robots run is a major part of software robot development.
Ensuring that each run happens in a clean and repeatable environment, preferably without any local manual installations, is key to scaling and getting the most benefit from your software robot projects.
Robocorp environment control can be broken into two:
- Environment control using the package management system conda
- Environment control that relies on local machine setup
Environment control using conda
Conda provides tools to create isolated environments that can use different versions of, for example, Python, Robot Framework, and a whole host of libraries. Conda also provides tools for "installing" these kinds of things without any operating system installations. This also protects the actual machine running from polluted environment variables etc.
Example: Having one robot that needs Python v2.7 and another that requires Python 3.8 can be a hassle to manage as the Windows PATH variable will provide the one that was installed last.
The way conda usage has been built into Robocorp tooling can be seen in the "robot template". The environment is defined in the conda.yaml
file.
If the robot contains
conda.yaml
file, the environment is created according to the config given.
You can use the conda.yaml
file to add conda and/or pip packages to your running environment. Both VS Code via RCC and Robocorp Workforce Agent use this config when running without any extra steps.
Each robot run via RCC or the Robocorp Workforce Agent gets a unique folder for execution, and the conda environment data is placed inside that folder. By default, Robocorp Workforce Agent holds the last five robot run folders. This means your unattended worker will not get cluttered with either run specific data or the environments used.
We heavily recommend this method, and the related supports for using conda are built-in to VS Code via RCC and Robocorp Workforce Agent.
Using this method, you can control which packages and which versions of those packages your robot will use editing one single configuration file.
Environment control that relies on local machine setup
Not all robots require Python, Robot Framework, etc. and robots sometimes need to heavily rely on specific machines installations and environments. In these cases, setting up the conda environments makes no sense.
The conda setup is optional in Robocorp products and can be skipped by removing the environment config file in the robot folder.
If the robot does NOT contain
conda.yaml
file, conda setup is skipped, and the run will see just the environment of the machine it is running on.
In these cases, you have to set up the targetted unattended workers for the robot.
Example: If your robot requires a specific zip tool to be available via Windows PATH you should install it and make sure the variable is set.
Each robot run is still getting a unique folder for the execution so that any temporary files created by the last run do not affect the next one.
See Conda main site for more information.