Skip to content

Commit

Permalink
SDS-10516 the supervisor configuration must define the environment va…
Browse files Browse the repository at this point in the history
…riables, they're not automatically propagated to child processes
  • Loading branch information
AymericPlanche committed Apr 12, 2019
1 parent 80bbc70 commit 4d0141c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions onboarder/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Akeneo Onboarder
prerequisites/index
installation/index
synchronization/index
troubleshooting/index

.. toctree::
:hidden:
Expand Down
3 changes: 1 addition & 2 deletions onboarder/installation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ Here are two examples in order to define environment variables:

.. warning::

All the following variables must be set in order to configure the Onboarder correctly.

All the following variables must be set in order to configure the Onboarder correctly for all entrypoints, all processes that runs the PIM code source.

**Variables provided by the Akeneo team**

Expand Down
16 changes: 13 additions & 3 deletions onboarder/synchronization/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Launch the message worker
| The messages that are part of the synchronization process are queued.
| The queue is consumed by a command line process called ``worker``.
|
| The worker has to always be launched as it polls the queue waiting for new messages to handle.
| The worker as to always be launched as it polls the queue waiting for new messages to handle.

You want a supervised worker
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Add the following supervisor configuration (update the following example to your needs)
You can use supervisor to run the ``worker`` as a daemonized process, supervisor will monitor this process and according to the configuration you'll define it will be autostarted and autorestarted.

.. code-block:: bash
Expand All @@ -48,9 +48,19 @@ Add the following supervisor configuration (update the following example to your
autostart=true
autorestart=true
.. warning::

By default the environment variable of the shell that is running the supervisord process will not propagate the environment variables to the process it monitor.
You've to configure :doc:`the mandatory environment variables </onboarder/installation/index>` that the akeneo/pim-onboarder bundle requires in the ``/etc/supervisor.conf`` file.

.. code-block:: bash
[supervisord]
environment=GOOGLE_APPLICATION_CREDENTIALS="/srv/pim/serviceAccount.json",ONBOARDER_TOPIC_NAME_FOR_PUBLICATION_TO_MIDDLEWARE="middleware-topic-name",...
.. note::

Supervisor documentation: https://github.com/Supervisor/supervisor#documentation
Supervisor documentation: http://supervisord.org/

You want an infinite worker
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
19 changes: 19 additions & 0 deletions onboarder/troubleshooting/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Troubleshooting
===============

Running the job queue daemon command line leads to errors
---------------------------------------------------------

.. code-block:: bash
batch.ERROR: Encountered an error executing the step: No project ID was provided, and we were unable to detect a default project ID.
If you encounter this kind of error in ``var/logs/*.log``, it's because the job queue daemon command line isn't aware of the mandatory environment variables needed to run the onboarder properly.

If you launch this daemon :doc:`using supervisor configuration </install_pim/manual/daemon_queue>` as recommended by the PIM installation manual you have to configure :doc:`the mandatory environment variables </onboarder/installation/index>` that the akeneo/pim-onboarder bundle requires in the ``/etc/supervisor.conf`` file.

.. code-block:: bash
[supervisord]
environment=GOOGLE_APPLICATION_CREDENTIALS="/srv/pim/serviceAccount.json",ONBOARDER_TOPIC_NAME_FOR_PUBLICATION_TO_MIDDLEWARE="middleware-topic-name",...

0 comments on commit 4d0141c

Please sign in to comment.