fix: replace broken Phala CLI flags with direct API calls for prod deploy#208
Open
fix: replace broken Phala CLI flags with direct API calls for prod deploy#208
Conversation
The phala CLI does not have --prepare-only, --commit, --token,
--compose-hash, or --transaction-hash flags. Replace these with
direct Phala Cloud API calls:
Phase 1: POST /cvms/{id}/compose_file/provision to get compose_hash
Phase 2: PATCH /cvms/{id}/compose_file with compose_hash to commit
Also removes the non-existent commit_token from the deployment context.
Fixes CPL-163
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Capture stderr and show actual error message when the API call fails. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Phala Cloud API requires a name field in the compose file provision request. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Auto-detect dstack_app_address from Phala CVM info instead of requiring APP_AUTH_ADDRESS_CHIPOTLE_PROD variable - Use BASE_DEPLOYER_SECRET as proposer key (0x7774... is Safe owner #1 and the diamond contract deployer) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BASE_DEPLOYER_SECRET (0x51ba..94ea) was rotated and is no longer a Safe owner. Try PHALA_DSTACKAPP_PRIVATE_KEY which may be the original deployer key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The proposer address (0x51ba...94ea) is registered as a Safe delegate, not an owner. The Protocol Kit's signTransaction() requires owner keys. Instead, detect whether the proposer is an owner or delegate: - Owner: use Protocol Kit's EIP-712 signature (existing behavior) - Delegate: sign with eth_sign (message hash prefix, v+4 adjustment) and propose via the Transaction Service API This allows the CI pipeline's proposer key to submit Safe transactions without being a multisig owner. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The comment documented BASE_DEPLOYER_SECRET but the workflow actually references SAFE_PROPOSER_PRIVATE_KEY. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GTC6244
approved these changes
Mar 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phala deploy --prepare-only/--commitCLI flags with directphala apicalls to the Phala Cloud REST API (/cvms/.../compose_file/provisionand/cvms/.../compose_file PATCH)commit_tokenfield from the deployment contextTest plan
deploy-prod-1-propose.ymlon tag v0.0.8 (run 23678671774)🤖 Generated with Claude Code