How to Integrate New Applications


This page is addressed to describe How to integrate new applications to Estuary platform for ARM64

In fact, we have¬†a very simple design for the new application integration, there is a packages git tree in Estuary repository, each application has itself own directory in the packages’ root, and then just implement 3 shell scripts: build.sh, postinstall.sh and remove.sh you can integrate your application into Estuary.

Ok, let’s follow below steps to achieve it:

1. Get the packages repository and create your own folder

a. git clone from https://github.com/open-estuary/packages.git to get the packages’ repository.
b. Create a dedicated folder in packages’ root with a special name, we suppose it’s app-name and doesn’t conflict with any existing app-name.

2. Implementation for build.sh

This script will be called automatically in building machine during Estuary building and it will be responsible for build and install application into target rootfs.
Estuary main builder supposes that your application will somehow be installed to target rootfs after calling this script, this script maybe will download some source code from somewhere, maybe will add some patches into the source code, maybe will rebuild and get the binaires, maybe will download some binaries from somewhere directly, maybe will copy some binaries\libs\config to target rootfs different folders, maybe will create a docker image with specified application and save it to the target rootfs… whatever, Estuary builder supposes this script will complete all preparation and building for this application, and finally install this application into target rootfs. Anyway, this script should entirely take the responsibility for the application’s getting, building and installing, and this script owner has complete right to decide how to implement it so long as the application is available in target system after calling.

By the way, there are two kinds of applications, one is named local-app which will be installed to the target rootfs directly, another is named docker-app which will be integrated into a docker image, and save the image to the target rootfs. For the local-app, they can be executed in target machine directly, but for the docker-app, they can only be called by running the docker image in target system.

At last, there are still some rules which must be obeyed by script owner.
1. This script maybe be called on both x86 machine and arm64 machines, so it should be certainly available on both two architecture machines.
2. It totally has 4 input parameters as follows:

$1: target platform name
$2: target distributions name
$3: target rootfs directory(absolutely)
$4: kernel build directory(absolutely)

3. One returned value is necessary: 0 means build succeed, other means build failed.

3. Implementation for <app-name>_postinstall.sh

This script is called on target arm64 machine for post process to the new application when necessary situation, e.g.: install some dependent libraries or complete some special configuration, whatever, the application owner can make decision do something or nothing in it.
One note is that, this script will be called successfully only one times at board boot up. If it exits with nozero value, the system will try to recall it at next board boot up untill it exits with zero.

4. Implementation for <app-name>_remove.sh

This script will be called on target arm64 machine too for application remove.

5. Add your application into Estuary config file

There is an estuarycfg.json file for whole Estuary configuration in estuary git tree. At last, you need add your app-name into “packages” segment in estuarycfg.json with “yes” as following example.

"packages":[
 {"name":"armor","install":"yes"},
 {"name":"mysql","install":"no"}
 ]

6. Building and validation

Now you can call following commands in Estuary project root, and deploy the produced images into target board, and validate your application on target board. If it works well on target board, congratulation to you, you succeed!

$./estuary/build.sh -f estuary/estuarycfg.json

Any more questions about new application integration, you can touch us by contact@open-estuary.org.