nodepool/doc/source/devguide.rst
James E. Blair 82d8c51250 Create a base Driver class
This is, like the drivers in zuul, designed to be a single instance
per driver that survives for the life of the process.  It is used
to further instantiate driver-specific interfaces.

Here we have it return the config object for the driver (replacing
the previous system which loaded it from specific config files).

We also move the reset method from the ProviderConfig to the Driver
object.  It's currently only used to clear a global os client config
object, so this better matches its lifecycle.

Change-Id: I1f5a7be9c597be842bfe4dbea8f153d7a96d7b9a
2018-06-06 14:11:43 -04:00

2.5 KiB

Developer's Guide

The following guide is intended for those interested in the inner workings of nodepool and its various processes.

Operation

If you send a SIGUSR2 to one of the daemon processes, Nodepool will dump a stack trace for each running thread into its debug log. It is written under the log bucket nodepool.stack_dump. This is useful for tracking down deadlock or otherwise slow threads.

Nodepool Builder

The following is the overall diagram for the nodepool-builder process and its most important pieces:

+-----------------+
|    ZooKeeper    |
+-----------------+
  ^      |
bld    |      | watch
+------------+  req    |      | trigger
|   client   +---------+      |           +--------------------+
+------------+                |           | NodepoolBuilderApp |
         |           +---+----------------+
         |               |
         |               | start/stop
         |               |
 +-------v-------+       |
 |               <-------+
+--------->   NodePool-   <----------+
|     +---+   Builder     +---+      |
|     |   |               |   |      |
|     |   +---------------+   |      |
|     |                       |      |
done  |     | start           start |      | done
|     | bld             upld  |      |
|     |                       |      |
|     |                       |      |
+---------v---+               +---v----------+
| BuildWorker |               | UploadWorker |
+-+-------------+             +-+--------------+
| BuildWorker |               | UploadWorker |
+-+-------------+             +-+--------------+
| BuildWorker |               | UploadWorker |
+-------------+               +--------------+

Drivers

nodepool.driver.Driver

nodepool.driver.Provider

nodepool.driver.NodeRequestHandler

nodepool.driver.ProviderConfig