How LPK Works: Core Mechanism and Minimal Spec
Why LPK
First, consider traditional Docker/Compose delivery:
- Docker Compose solves part of multi-container orchestration and is better than ad-hoc commands.
- But during final delivery, operational burden often still falls to end users (env vars, upgrades/rollback, data path, logs).
- This causes role overlap: IT maintenance work that should belong to developers/platform shifts to end users.
- For non-technical users, this is usually complex and risky.
In Lazycat microservice, LPK completes this chain by moving responsibilities to "developer + platform":
- Developers package app identity, version, entry routes, exposure boundaries, deployment form, and data semantics into LPK.
- Platform provides standardized install/start/runtime/isolation mechanisms.
- End users receive a one-click reproducible package and focus on usage instead of operations.
Goal
After this guide, you can verify these 5 points:
- LPK is a package file (
tarorzip); you can inspect its internals by changing extension. lzc-build.ymlis build-stage only. After package is produced and installed, runtime flow does not read your locallzc-build.yml.- You can build a valid LPK even without
lzc-cli. - Compose solves part of orchestration, while LPK further solves microservice delivery and operation-role separation.
- Understand the two traffic paths for an app in Lazycat: the default HTTPS/HTTP path and the TCP/UDP L4 forwarding path. The runtime term for this app instance is
lzcapp.
Prerequisites
- You completed HTTP Routing with Backend.
- You have run
lzc-cli project deployat least once.
App Traffic Map (runtime term: lzcapp)
Legend:
- Blue nodes (
1~4): platform-level security mechanism, app-agnostic. - Orange nodes (
6B,9A): the main places app developers need to care about, technicallyapplication.ingressandmanifest.yml.
Code-level mapping (summary)
- ingress extracts subdomain from
Hostand resolves target app instance (supports multi-instance mapping). - HTTPS/HTTP path checks login state; unauthenticated and non-
public_pathrequests are redirected to login. - After checks, the request is forwarded to the target app; then
lzcinitroutes it bymanifest.yml(routes/upstreams). - TCP/UDP path uses
application.ingressfor L4 matching/forwarding and does not parse HTTP semantics. - For L4 ingress, system allocates/maintains dedicated virtual IP mapping; domain access resolves to that virtual IP.
Differences:
- Both paths are identical before ingress.
- HTTPS/HTTP does instance routing + access control + manifest-based routing.
- TCP/UDP does pure L4 forwarding.
Further reading:
1. Development and Release Flow (by scenario)
Scenario A: Daily development
Goal: rapid verification on target microservice.
lzc-cli project deploy
lzc-cli project infoDefault behavior:
- New projects normally contain
lzc-manifest.yml,package.yml, andlzc-build.yml. projectcommands preferlzc-build.dev.ymlwhen it exists.- Each command prints the active
Build configline. package.ymlis where static package metadata now lives, instead of the top level oflzc-manifest.yml.- Use
--releaseif you want to operate on the release build configlzc-build.yml.
Scenario B: CI release
Goal: produce distributable artifact only.
lzc-cli project release -o release.lpk
lzc-cli lpk info release.lpkLPK distribution
release.lpk is commonly used by:
- App Store distribution.
- Direct file sharing; receiver can place
.lpkinto Lazycat drive and click install.
2. LPK as an archive package
Generate package:
lzc-cli project release -o release.lpk
lzc-cli lpk info release.lpkTypical contents:
manifest.yml: the app runtime description.content.tarorcontent.tar.gz: static app content.images/: optional embedded OCI image layout.images.lock: optional layer source metadata (embed/upstream).
Notes:
- You can inspect
.lpkwith archive tools. - Most tools do not recognize
.lpkdirectly; copy and rename to.taror.zipbased on detectedformat.
3. lzc-build.yml is build-stage only
lzc-build.yml defines how package is produced, for example:
- Which
buildscriptto run. - Which
contentdirto collect. - How
imagesare built (embedded image workflow).
Install/runtime flow consumes artifacts inside LPK (manifest.yml, content.tar, images.lock, etc.), not your local lzc-build.yml file.
4. Build LPK without lzc-cli
lzc-cli is recommended for engineering efficiency, but LPK format is open and can be generated manually.
Minimal tar-form example:
mkdir -p manual-lpk/web
cat > manual-lpk/package.yml <<'YAML'
package: org.example.hello.manual
version: 0.0.1
name: hello-manual
YAML
cat > manual-lpk/manifest.yml <<'YAML'
application:
subdomain: hello-manual
routes:
- /=file:///lzcapp/pkg/content/web
YAML
cat > manual-lpk/web/index.html <<'HTML'
<html><body><h1>Hello Manual LPK</h1></body></html>
HTML
tar -C manual-lpk -cf manual-lpk/content.tar web
tar -C manual-lpk -cf hello-manual.lpk manifest.yml package.yml content.tarInstall this manually built LPK:
lzc-cli lpk install hello-manual.lpk5. Where to check first when things fail
- Build failed: check
lzc-build.ymland build logs. - Installed but inaccessible: check
application.routesinlzc-manifest.yml, which defines where requests should go. - Version not updated: check
Current version deployedinlzc-cli project info. - Service errors: check
lzc-cli project log -f.
Verification
lzc-cli project release -o release.lpk
lzc-cli lpk info release.lpk
lzc-cli project infoYou should be able to answer:
- Is
release.lpktar or zip, and how to inspect internals. - Why
lzc-build.ymlis build-stage only. - Minimal files required to manually produce valid LPK.
- How LPK shifts operational burden from end users to developers/platform.
Troubleshooting
1. Build config file not found
Fix: ensure you are in project root and lzc-build.yml or lzc-build.dev.yml exists. The printed Build config line tells you which file the command is actually using.
2. Manifest changed but behavior unchanged
Fix: rerun project deploy (not only project info).
3. embed:<alias> alias not found
Fix: ensure matching alias exists under lzc-build.yml.images.
4. Cannot open release.lpk directly
Fix:
- Run
lzc-cli lpk info release.lpkand checkformat. - Copy and rename extension to
release.tarorrelease.zip, then open.
Next
Continue with: Advanced Embedded Image Practice
Further reading: