Installation of Pimcore Copilot
Installation
To install the Pimcore Copilot bundle, follow the steps below:
- Install the required dependencies:
composer require pimcore/copilot-bundle
- Make sure the bundle is enabled in the
config/bundles.phpfile. The following lines should be added:
use Pimcore\Bundle\CopilotBundle\PimcoreCopilotBundle;
// ...
return [
// ...
PimcoreCopilotBundle::class => ['all' => true],
// ...
];
Prerequisite: PimcoreGenericDataIndexBundle and PimcoreGenericExecutionEngineBundle are registered into the kernel
automatically as dependent bundles, so they need no entry in config/bundles.php. Installing Copilot does not cascade
to them, so install each one separately first:
bin/console pimcore:bundle:install PimcoreGenericDataIndexBundle
bin/console pimcore:bundle:install PimcoreGenericExecutionEngineBundle
PimcoreGenericExecutionEngineBundle creates the job run tables that Copilot's automation actions depend on.
(PimcoreStaticResolverBundle and PimcoreEnterpriseSubscriptionToolsBundle ship no installer.)
- Install the bundle:
bin/console pimcore:bundle:install PimcoreCopilotBundle
- Schedule the cronjob for the Pimcore Copilot bundle: To set up the cronjob, add the following line to your crontab. This will check for scheduled actions every minute and execute them if necessary.
* * * * * php /home/project/www/bin/console copilot:automation-action:scheduled-actions
The command takes a lock, so a run that is still busy when the next minute starts is not run a second time: the
additional run ends right away with a success exit code. The lock uses Pimcore's lock factory, which stores it in the
database by default, so this also works when the cronjob runs on several hosts. To store it elsewhere, override the
Symfony\Component\Lock\PersistingStoreInterface service.
If a run crashes, its lock is held until it expires after 600 seconds, so scheduled actions pause for up to ten
minutes.
- [Optional] Setting environment variables:
If you intend to use the OpenAI or Hugging Face actions, you need to set the respective environment variables:
- OpenAI API key:
To use the OpenAI API Actions, you need to set the environment variable
OPEN_AI_AUTH_TOKEN - Hugging Face API key:
To use the Hugging Face API Actions, set the environment variable
HUGGING_FACE_AUTH_TOKEN
There is a collection of additional actions for showcasing Pimcore Copilot. To install them, install the
bundle composer require pimcore/copilot-showcase-bundle and activate it in config/bundles.php.
Bundle Configuration
The execution of automated actions is based on the Symfony Messenger queue. If activated, the selected automated actions are automatically executed.
Messages are dispatched via pimcore_generic_execution_engine transport. Please ensure you have workers processing this transport when using automated actions.