Skip to content

fix: unblock release-plz, add Phala deploy on release#50

Merged
skgbafa merged 2 commits into
mainfrom
fix/release-and-phala-deploy
Apr 27, 2026
Merged

fix: unblock release-plz, add Phala deploy on release#50
skgbafa merged 2 commits into
mainfrom
fix/release-and-phala-deploy

Conversation

@skgbafa
Copy link
Copy Markdown
Contributor

@skgbafa skgbafa commented Apr 27, 2026

Summary

Unblocks the release-plz pipeline that failed on the first post-changeset run, and adds automated Phala Cloud deployment on every published GitHub release.

Why release-plz failed

PR #49 enabled publish = true and switched the release tooling to release-plz + cargo-dist. On the first run, release-plz refused to proceed:

package tinycloud-node not found in the registry, but the git tag v1.3.0 exists. Consider running cargo publish manually to publish this package.

The v1.3.0 tag was created by the old changesets workflow, but the package was never published to crates.io. release-plz cannot reconcile a tag-without-registry-entry, so it errors.

Fix

  • Deleted v1.3.0 from the remote (and local) so release-plz can publish v1.3.0 fresh on the next run. No code-level version bumpCargo.toml stays at 1.3.0 so this becomes the first crates.io version.
  • Added workflow_dispatch trigger to .github/workflows/release-plz.yml so the workflow can be re-triggered from the Actions UI without pushing a dummy commit.

Phala deployment

  • New docker-compose.yml at the repo root for Phala Cloud. References the GHCR image by version, exposes 8000 (HTTP API), 8001 (Prometheus), 8081 (P2P relay), mounts a named volume at /app/data, and pulls TINYCLOUD_KEYS_SECRET from the CVM's encrypted secret store via env var (managed out-of-band in the Phala dashboard, never committed).
  • New deploy-phala job in .github/workflows/docker.yml, gated on github.event_name == 'release' and needs: build. Rewrites the image tag in compose to match the released version (stripping the leading v to match metadata-action's {{version}} output), then runs phala deploy -c docker-compose.yml -n tinycloud-node --wait using PHALA_CLOUD_API_KEY from secrets.

The deploy targets the standard (non-dstack) image. If TEE-derived keys are wanted later, switch to the -dstack tag, set TINYCLOUD_KEYS_TYPE=Dstack, drop the keys secret env var, and mount /var/run/dstack.sock.

Pre-deploy validation

Compose was checked with the phala-compose-check skill: single-file, 950 bytes (well under 200 KB), no hardcoded secrets, named volume only, ports clean. CI builds the image on ubuntu-latest so amd64 is guaranteed.

Test plan

  • After merge, manually trigger release-plz from Actions UI (workflow_dispatch).
  • Verify release-plz opens a release PR; merging it should publish v1.3.0 to crates.io and create the v1.3.0 GitHub release.
  • Verify the build job in docker.yml pushes ghcr.io/tinycloudlabs/tinycloud-node:1.3.0.
  • Verify deploy-phala runs on the published release and phala deploy --wait reports a healthy CVM.
  • Confirm TINYCLOUD_KEYS_SECRET is configured in the Phala CVM's encrypted secret store before the first deploy.

skgbafa added 2 commits April 27, 2026 12:53
Two changes to unblock the release pipeline that failed on the first
post-changeset run, and to wire up automated CVM deployment.

* Add `workflow_dispatch` trigger to `release-plz.yml` so the workflow
  can be re-run from the Actions UI without pushing a dummy commit.
  (The leftover v1.3.0 tag, which release-plz could not reconcile
  against the empty crates.io registry entry, has been deleted from
  the remote so the next run can publish v1.3.0 fresh.)

* Add `docker-compose.yml` at the repo root for Phala Cloud. References
  the GHCR image by version (rewritten by CI on release), exposes 8000
  / 8001 / 8081, mounts a named volume at /app/data, and pulls the
  keys secret from the encrypted secret store via ${TINYCLOUD_KEYS_SECRET}.

* Add `deploy-phala` job to `docker.yml`. Runs only on
  `release: published`, after the standard image build, rewrites the
  compose tag to match the released version, and runs
  `phala deploy --wait`.
The prior commit added a brand-new docker-compose.yml at the repo root
configured for SQLite + local storage. That doesn't match the prod CVM,
which runs the dstack image variant against an external Postgres + S3
(Topology 2). Phala IS the TEE platform, so the deploy must use the
dstack image — using the non-TEE image would silently regress prod's
KMS-derived key model.

Verified the running prod CVM (workspace: Tiny Cloud, app_id
350d124c81d53a57e8899e9f85a904918e663b61, name: tinycloud-node) by
fetching its compose via the Phala API. It is byte-identical to the
already-checked-in docker-compose.dstack-postgres.yaml.

Changes:
* Delete docker-compose.yml — wrong topology, wrong image variant.
* deploy-phala job now needs both build and build-dstack so the
  versioned dstack image exists at deploy time.
* Compose path: docker-compose.dstack-postgres.yaml (matches prod).
* Image substitution: replace the floating ':dstack' tag with the
  versioned ':<version>-dstack' tag emitted by the build-dstack job.
* Use 'phala deploy --cvm-id tinycloud-node' to update the existing
  prod CVM (CVM identifier accepts name) rather than risk creating
  a duplicate.

The PHALA_CLOUD_API_KEY repo secret must be issued from the Tiny Cloud
workspace; Phala API tokens are workspace-scoped, so a key from another
workspace would fail to find the CVM.
@skgbafa skgbafa merged commit e134b11 into main Apr 27, 2026
15 checks passed
@skgbafa skgbafa deleted the fix/release-and-phala-deploy branch April 27, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant