Skip to content
This page View Markdown Open in ChatGPT Open in Claude

Deploy API Maker

  • Install another version of API Maker on every server of the cluster from the Deploy API Maker page of the admin panel.
  • This page upgrades API Maker itself. To deploy your APIs, use a Git pull. Learn more Git.
Deploy API Maker v4 : admin panel → Caddy → API Maker → Redis → every server installs the package of its machine (5 stages, live progress) → systemd starts it, wait for the new version, reload Admin panel Deploy API Maker Deploy from NPM choose a version or Upload a package .tgz of v4 · one machine A card per server · live log Caddy HTTPS · WSS reverse proxy :443 npm registry registry.npmjs.org each server downloads the package of its machine API Maker Gets the order a version, or your upload Sends it out to every server at once Redis one message to every server Every server installed by the v4 installer 1 Package SHA-512 2 Unpack releases/ 3 Check program 4 Switch current 5 Start systemd Server 1 ✓ installed Server 2 checking… Server 3 … N unpacking… The running version stays : the 3 newest are kept Each server at its own pace · 20 minutes at most live progress of every stage WebSocket · WSS through Caddy every server done the page takes over Started by systemd each server, on the new version; silent : back to the one before Wait for the version the page asks until every process answers on the new version Reload the page the admin panel opens on the new version A server fails or stays silent it keeps the version it runs ; the page says why · deploy again

Two ways

  • Deploy from NPM: pick a published version and click Deploy. Every server downloads the package of its own machine (@sava-info-systems/api-maker-engine-linux-x64 or -linux-arm64) from the npm registry and checks its SHA-512 before anything is installed. A cluster of x64 and arm64 servers is upgraded in one go.
  • Upload a package: select the .tgz of a version (the npm package of one machine), or the .tar.gz of a release, up to 512 MB, and click Upload. The page sends it in pieces of 4 MB, a request each, so a slow connection or a package of more than 100 MB is no problem; a piece whose request fails on the way is sent again. The pieces wait in the Redis of the installation for an hour, every server reads the package from there, and each one checks its SHA-256 before using it. A server of another machine refuses it.

What happens on each server

  1. The package is downloaded (its SHA-512 checked) or received (its SHA-256 checked).
  2. It is unpacked next to the running version, into ~/projects/api_maker/releases/<version>.
  3. Its program is checked : built for this machine, and it starts (api_maker_be --version).
  4. The current link moves to it, all at once. The 3 newest versions are kept, the older ones removed.
  5. systemd starts API Maker on the new version. A watchdog outside of API Maker waits for it to answer; when it does not answer within two and a half minutes, current goes back to the version which ran before and that one is started again. The server which took the request from the page restarts last, once every server has answered, so the page gets the result of each server.

  6. .env, license.txt, the uploads and the logs are outside of the versions : nothing has to be kept aside.

  7. The page shows a card per server and the live progress of each stage, then waits until every server answers on the new version and reloads.
  8. A server which fails keeps the version it runs, and the page says why : deploy again once the cause is gone.

Good to know

  • The page works on servers installed by the installer of API Maker v4 and run by systemd. A server laid out otherwise refuses and is upgraded by running the installer again with the version.
  • Versions of the Node.js edition (v1 to v3) are not deployed from here : the installer moves a server to v4.
  • A deployment waits up to 20 minutes for the servers to finish.
  • If the WebSocket connection of the page is down, the deployment keeps running and the page reports the result when it ends.