From 9bc1c88201e3b9edd76608816037a7b18eebb89e Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Wed, 8 Jun 2022 11:02:29 +0530 Subject: [PATCH 1/5] fpm controller feature --- FPM.ftd | 2 ++ cli/install.ftd | 3 +++ dev/controller.ftd | 37 +++++++++++++++++++++++++++++++++++++ sync.ftd | 2 -- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 cli/install.ftd create mode 100644 dev/controller.ftd diff --git a/FPM.ftd b/FPM.ftd index 78994fbac..eca4a34ac 100644 --- a/FPM.ftd +++ b/FPM.ftd @@ -54,6 +54,7 @@ implements: fifthtry.github.io/theme - `fpm diff`: /diff/ - `fpm update`: /update/ - `fpm serve`: /serve/ + - `fpm install`: /cli/install/ @@ -99,6 +100,7 @@ implements: fifthtry.github.io/theme - Journal: /journal/ - Contribution Guide: /dev/contribute/ - How Versioning Works: /dev/versioning/ +- FPM Controller Support: /dev/controller/ - What is `FPM.manifest.ftd`?: /dev/fpm-manifest/ - File System Organization: /fs/ - `FPM.ftd`: /fpm-ftd-file/ diff --git a/cli/install.ftd b/cli/install.ftd new file mode 100644 index 000000000..bbd77af84 --- /dev/null +++ b/cli/install.ftd @@ -0,0 +1,3 @@ +-- ft.page: `fpm install` + +`fpm install` installs all the dependencies of current package. diff --git a/dev/controller.ftd b/dev/controller.ftd new file mode 100644 index 000000000..df446c2d2 --- /dev/null +++ b/dev/controller.ftd @@ -0,0 +1,37 @@ +-- ft.page: FPM Controller Support + +FPM cli supports communication with [fpm +controller](https://github.com/FifthTry/fpm-controller). This is an optional +feature, and is only available when `controller` feature is enabled, which is +not enabled by default. + +-- ft.h1: Controller Communication + +When `controller` feature is enabled, `fpm serve` will first communicate with +the FPM controller service's `/get-zip/` API. + +-- ft.h2: 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-zip/ and /fpm-ready/. + +-- ft.h1: `/get-zip/` + +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-zip` API. + +The API returns the URL of a package to download. The URL points to a zip file. + +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. + +FPM will then calls [`fpm install`](/cli/install/) on it. + +-- ft.h1: `/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. diff --git a/sync.ftd b/sync.ftd index 8b01365ad..10650e868 100644 --- a/sync.ftd +++ b/sync.ftd @@ -1,8 +1,6 @@ -- ft.page: `fpm sync` --- ft.markdown: - `fpm sync` operates in two modes. If the package is hosted on `fpm-repo` then it syncs the content of local folder with remote [not yet implemented]. If the package is hosted on `github` etc, then `sync` creates a snapshot of modified files in From 0e7c0df7831df17eb94c7b43924a583f2b17aaac Mon Sep 17 00:00:00 2001 From: Shobhit Sharma Date: Wed, 8 Jun 2022 16:23:30 +0530 Subject: [PATCH 2/5] Update `contoller.ftd` according to the discussion Ref: https://github.com/FifthTry/dotcom/pull/34 --- dev/controller.ftd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev/controller.ftd b/dev/controller.ftd index df446c2d2..2e225ed5a 100644 --- a/dev/controller.ftd +++ b/dev/controller.ftd @@ -16,18 +16,21 @@ 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-zip/ and /fpm-ready/. +FPM Controller Service has more than one APIs: /get-package/ and /fpm-ready/. --- ft.h1: `/get-zip/` +-- ft.h1: `/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-zip` API. +it's `instance id`, and it will pass the instance id to the `get-package` API. -The API returns the URL of a package to download. The URL points to a zip file. +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`](/cli/install/) on it. -- ft.h1: `/fpm-ready/` From 9ed57a69bec5451a94c9ae054961a39b6a0f8188 Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Thu, 9 Jun 2022 11:21:06 +0530 Subject: [PATCH 3/5] Update controller.ftd --- dev/controller.ftd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/controller.ftd b/dev/controller.ftd index 2e225ed5a..a490d2aba 100644 --- a/dev/controller.ftd +++ b/dev/controller.ftd @@ -8,7 +8,7 @@ not enabled by default. -- ft.h1: Controller Communication When `controller` feature is enabled, `fpm serve` will first communicate with -the FPM controller service's `/get-zip/` API. +the FPM controller service's `/get-package/` API. -- ft.h2: FPM Controller Service Endpoint From c192cd63e7ab8b2f3ca3ab7885df83ab8d2805b7 Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Thu, 9 Jun 2022 11:24:04 +0530 Subject: [PATCH 4/5] Update controller.ftd --- dev/controller.ftd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dev/controller.ftd b/dev/controller.ftd index a490d2aba..a3c4a18f5 100644 --- a/dev/controller.ftd +++ b/dev/controller.ftd @@ -26,15 +26,16 @@ 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 +FPM will clone the git repository in the 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`](/cli/install/) on it. -- ft.h1: `/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 +Once dependencies are ready `fpm` calls `/fpm-ready/` API on the controller. We +will pass the `FPM_INSTANCE_ID` and the git commit hash as input to the API + +The API will return with success, and once it is done fpm will start receiving HTTP traffic from the controller service. + From e388210df865f9497e78e04826d0691882d47685 Mon Sep 17 00:00:00 2001 From: wilderbit Date: Fri, 10 Jun 2022 10:23:02 +0530 Subject: [PATCH 5/5] install doc --- cli/install.ftd | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ sitemap.ftd | 6 ++---- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/cli/install.ftd b/cli/install.ftd index bbd77af84..4904e3189 100644 --- a/cli/install.ftd +++ b/cli/install.ftd @@ -1,3 +1,52 @@ -- ft.page: `fpm install` `fpm install` installs all the dependencies of current package. + +-- ft.h2: Synopsis + +-- ft.code: +lang: sh + +fpm install +fpm install # TODO +fpm install # TODO +fpm install # TODO +fpm install # TODO +fpm install / # TODO + +aliases: add, i, install + + +-- ft.h2: Description + +`fpm install` installs the package and any packages that it depends on. + +A `package` is: + +- a) a folder that contains `FPM.ftd` +- b) a gzipped tarball containing (a) +- c) a url that resolves to (b) +- d) a that resolves to (a) + +- `fpm install` install + + +Install the dependencies to local `.packages` folder. By default, `fpm install` +will install all packages listed as dependencies in `FPM.ftd` file. + + +- `fpm install ` + + +- `fpm install ` + +Install a package that is sitting on your file system. + +Tarball requirements: +- The filename must use .tar, .tar.gz, or .tgz as the extension. + + +- `fpm install ` + +Fetch the tarball url, and then install it. The url must start with `http://` or +`https://` \ No newline at end of file diff --git a/sitemap.ftd b/sitemap.ftd index e5d5da5ce..e9191e6ca 100644 --- a/sitemap.ftd +++ b/sitemap.ftd @@ -247,8 +247,6 @@ from section, subsection and it's parent TOC. i.e. `key1: value1`, `key2: value2 `key3: value3`, `key4: value4` and `key5: value5` - - -- ft.h1: Variable can be changed based on key value data Using the `get-data`, the title can be different: @@ -273,11 +271,11 @@ lang: ftd # Overview -- foo/ +- foo: foo/ # Development -- foo/-/1 +- foo: foo/-/1 show-dev-info: true