acme-corp/field-reports: an app that turns field technicians’ notes into reports, with
a workflow blob flows and a scheduler blob schedules.
The repository
The repository is laid out as the app blob it fills.app.yaml sits at the root, each blob of the app is one folder
under blobs/ holding its blob.yaml manifest, and README.md and LICENSE become the app blob’s Readme and License.
- A folder is a blob. Blobs are found by folder, never listed, and the folder’s name is the blob’s alias in the
app: installed as
reports, Field Reports makesreports-flowsandreports-schedules. build/is git-ignored.blobhub app buildwrites it from the sources, and the app blob holds it file for file. The build warns withBUILD_NOT_IGNOREDwhile git does not ignore it.- Everything else is the repository’s own, such as
tests/, and is never uploaded (The repository).
app.yaml opens with the app itself. app.alias names the app blob in the organization the CLI works in, the app’s
home organization, so field-reports is acme-corp/field-reports (App):
blob.yaml says what its blob holds once installed. The workflow blob lists its definitions, each naming
its file with file; build tells the CLI what to compile into a definition, here a code component’s entry point in
src/:
limits says what the blob needs of the organization. Field Reports needs 400 executions in its reports session, a
year of nightly runs and some by hand; the bound assumes the organization’s retention, and the app’s README says so.
An install checks it and never raises it (Limits an app needs). describe
checks that a declaration is well formed, so push prints its problems and commit refuses a version that has any,
and a plain blobhub workflow deploy of the same file ignores it and says so
(Limits).
blob.yaml has the manifest of each blob type an app holds: a
workflow, a scheduler and an
ONNX model.
Inputs, accounts and templates
One version installs in many organizations, so what differs between them is not written into the app. Four things carry it:- Inputs are what an install asks for. Field Reports asks for
config, a document of report settings checked againstschemas/config.json, andweather_key, an optional secret (Inputs). - Accounts are the service accounts the app acts as, so its runs are its own and not the installing admin’s.
runner, installed asreports-runner, is a member of the installation’s blobs with WRITE and of nothing else (Accounts). - Credentials are stored on an account, where its runs find them by alias:
weatherholds the secret input,blobhuba key of the account that the platform mints, andsync_tokenstarts empty for the app to fill (Credentials). - Templates are the values a manifest fills in at install,
{{ … }}, from the installation’s inputs, blobs, accounts and the installation itself (Templates).
config document into its session as an
object:
as: "{{ accounts.runner.id }}", and targets the
installation’s own workflow blob, "{{ blobs.flows.id }}", so an install applies flows before schedules
(Scheduler). A secret is read only by a credential’s body: a manifest that
reads weather_key is a problem, and a version with a problem is not committed. Left out, the optional weather_key
skips the weather credential (Install-time names).
The migration
An app whose data changes shape between versions names a migration workflow, last inapp.yaml:
reports-migrate, in the session reports of reports-flows, as reports-runner. Field
Reports keeps a data_version object in that session and one step per change of shape, so an upgrade that skips a
version, or a migration run twice, ends in the same place. The new version’s workflows may run before its migration
ends, so they read the old shape too, or take their own lock: they wait until the data_version the migration writes
is theirs. When it runs, what it is given and what its outcome does to the installation are on
Apps.
Migration has the keys,
The migration workflow the contract, and
Between any two versions the workflow’s code.
When an upgrade may run
An app whose long work must not be cut by an upgrade names, underupgrade in app.yaml, a session object its own
workflows write, its busy object. They write busy: true with an until before that work starts, and busy: false
after it. While it says busy, an upgrade or an uninstall is refused
(When the app is busy). Beside it, from names the oldest version a version
moves from. Field Reports needs neither, and leaves upgrade out. Upgrade has the
keys, and The busy object what an app writes.
Build and push
Two commands take the repository to the app blob.blobhub app build compiles the sources into build/; it makes no
API call, so it runs in a pre-commit hook or the first step of CI. blobhub app push builds, makes the app blob’s
draft equal build/ by uploading only the files that changed, and asks the platform to read the result with
describe, printing each problem it finds.
acme-corp/field-reports, private. A problem does not stop the upload, so fixing
the sources and pushing again converges; it stops a commit. build and
push have their output and errors, and the App commands the whole
loop.


The app blob: the files a push uploaded, and what the platform read from them.
Try it in a development installation
Before a draft becomes a version, it is installed through the same path a customer’s install takes.--install
installs the draft over a development installation in the app blob’s own organization, here reports-dev in
acme-corp/installed-apps, the installer the CLI uses unless --installer names another:
The recorded run of push --install: the build, the upload, the plan and the installation it made.
reports-dev-flows and reports-dev-schedules, stay editable, so the workflow editor and the playground
work on them as on any blob. blobhub app pull copies graph and layout edits back into blobs/flows/definitions/,
and the sources keep what was drawn:


The development installation: its record marked Development, with its JSON and its Log.
src/: an edit that is not pulled is replaced by the
next install, which applies the draft again. push --install confirms by itself over a new or development
installation unless the plan deletes a blob; with a deletion, it prints the plan and refuses until --yes. Over a
ready or failed installation of a committed version it is refused with development_mismatch, and --yes does not
change that: a development installation takes only the draft, and any other only committed versions. Over an
uninstalled one, push --install --yes makes the record again, as a development installation.
Development installations and
pull have the rules.
Commit a version
When the draft is right,blobhub app commit makes it the version app.yaml names, 0.2.0, which is never reopened
(Versions):
describe reports a problem, or when the app blob already holds 0.2.0.
commit has its checks, and blobhub app ls lists the versions.
Release the next version
A fix or a feature is the next version. Bumpapp.version in app.yaml from 0.2.0 to 0.3.0, push and try it over
reports-dev, which keeps its inputs and credentials (Upgrading), then commit:
0.2.0 stays as it was. Committing without the bump is refused
with APP_VERSION_EXISTS, and committing a bump that was never pushed with APP_NO_DRAFT or APP_DRAFT_STALE, whose
hint is blobhub app push. The version must be a semantic version (app.version).
Installations move forward only, so a repair is the next version: a repair of 0.3.0 is 0.3.1, not a 0.2.x,
which an installation already at 0.3.0 refuses with version_downgrade. A version that changes the shape of the
data adds a step to the migration, as 0.3.0 reshapes the report templates. An installation moves to the new version
by upgrading.
Share it and install it
The app blob starts private (who may install it). To offer it to another organization, either:- Share it. An ADMIN of the app blob adds a person, or a service account, as a member with READ. Members are users: no organization is a member of anything.
- Make it public. A person with WRITE on the app blob changes its visibility.
--yes and then with it; on Apps, Installing has what the first
command prints and who makes the first install, and Upgrading the migration’s run.
plan and install are the
operations behind the web and the terminal alike, and blobhub installer install
has the command’s output.
