Home
Author Manual
Themes Guide
Development
Roadmap
Journal
Contribution Guide
How Versioning Works
FPM Controller Support
What is FPM.manifest.ftd?
File System Organization

FPM Controller Support

FPM cli supports communication with fpm controller. This is an optional feature, and is only available when controller feature is enabled, which is not enabled by default.

Controller Communication
When controller feature is enabled, fpm serve will first communicate with the FPM controller service’s /get-zip/ API.

FPM Controller Service Endpoint

The FPM Controller Service’s enpoint is computed by using environement variable FPM_CONTROLLER, which will look something like this: https://controller.fifthtry.com, with the API path.

FPM Controller Service has more than one APIs: /get-package/ and /fpm-ready/.

/get-package/

Through an environemnt variable FPM_INSTANCE_ID, the fpm serve will learn it’s instance id, and it will pass the instance id to the get-package API.

The API returns the URL of the package to be downloaded, git repository URL and the package name.

FPM will download the zip file and unzip it in current directory. The current directory will contain FPM.ftd and other files of the package.

The API will respond with the latest commit SHA as the response.

FPM will then calls fpm install on it.

/fpm-ready/
Once dependencies are ready fpm calls /fpm-ready/ API on the controller. The API will return with success, and once it is done fpm will start receiving HTTP traffic from the controller service.