|
| 1 | +# Contributing |
| 2 | + |
| 3 | +This project is still moving quickly. Contributions are welcome, but |
| 4 | +changes should preserve the main design goal: a general attested service |
| 5 | +mesh for dstack CVMs, not a collection of workload-specific shortcuts. |
| 6 | + |
| 7 | +## Development Setup |
| 8 | + |
| 9 | +Install: |
| 10 | + |
| 11 | +- Terraform |
| 12 | +- Docker |
| 13 | +- Go 1.24 for the Go modules, or Docker for running Go 1.24 tests |
| 14 | +- Phala Cloud credentials if you are testing real deployments |
| 15 | + |
| 16 | +Validate the Terraform example: |
| 17 | + |
| 18 | +```bash |
| 19 | +terraform -chdir=cluster-example init -upgrade |
| 20 | +terraform -chdir=cluster-example validate |
| 21 | +``` |
| 22 | + |
| 23 | +Run local Go tests: |
| 24 | + |
| 25 | +```bash |
| 26 | +(cd admission-broker && go test ./...) |
| 27 | +(cd signaling && go test ./...) |
| 28 | +(cd webdemo && go test ./...) |
| 29 | +``` |
| 30 | + |
| 31 | +Run Go 1.24 module tests through Docker when needed: |
| 32 | + |
| 33 | +```bash |
| 34 | +docker run --rm -v "$PWD:/src" -w /src/admission-client golang:1.24 go test ./... |
| 35 | +docker run --rm -v "$PWD:/src" -w /src/bootstrap-secrets golang:1.24 go test ./... |
| 36 | +docker run --rm -v "$PWD:/src" -w /src/mesh-conn golang:1.24 go test ./... |
| 37 | +``` |
| 38 | + |
| 39 | +Build the main sidecar image: |
| 40 | + |
| 41 | +```bash |
| 42 | +docker build -t service-mesh-mesh-sidecar-check -f mesh-sidecar/Dockerfile . |
| 43 | +``` |
| 44 | + |
| 45 | +## Pull Request Expectations |
| 46 | + |
| 47 | +- Keep platform behavior declarative where possible. `cluster.tf` and |
| 48 | + compose inputs should drive service registration, Envoy listeners, |
| 49 | + mesh allowlists, and admission policy. |
| 50 | +- Avoid workload-specific logic in `mesh-sidecar` and `mesh-conn`. |
| 51 | + Workload-specific behavior should live in the workload image or |
| 52 | + compose service definition. |
| 53 | +- Do not add fallback paths that silently weaken attestation, Consul |
| 54 | + ACLs, TLS, or mesh admission. If a security check is optional, make |
| 55 | + the policy explicit. |
| 56 | +- Update docs when changing deployment shape, trust model, image names, |
| 57 | + Terraform variables, or operational procedures. |
| 58 | +- Prefer digest-pinned images for real-cluster evidence and release |
| 59 | + validation. |
| 60 | + |
| 61 | +## Real-Cluster Testing |
| 62 | + |
| 63 | +Real Phala Cloud tests should record: |
| 64 | + |
| 65 | +- provider version |
| 66 | +- dstack OS image |
| 67 | +- image tags or digests |
| 68 | +- whether `enable_attestation_admission` and `production_profile` were |
| 69 | + enabled |
| 70 | +- apply, no-op plan, failover, and destroy results |
| 71 | + |
| 72 | +Do not commit API keys, Terraform state, generated tfvars, or decrypted |
| 73 | +secrets. |
0 commit comments