Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .exp/design-workflow-1-local-development-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ During development, Skaffold monitors file changes in build contexts. Upon detec
### Build Process Details
- **Platforms**: Supports `linux/amd64` and `linux/arm64` for multi-arch builds.
- **Local Build**: Uses `local` builder with `useDockerCLI: true` and `useBuildkit: true` for fast, cached builds without pushing to a registry.
- **Docker Bake**: The `docker-bake.hcl` file enables building all service images simultaneously for multiple platforms using `docker buildx bake -f docker-bake.hcl`, complementing Skaffold for batch builds.
- **Dependencies**: Some services require proto generation (via `genproto.sh` scripts); generated files (e.g., `demo.pb.go`) are included in source trees and built into images. Changes to `.proto` files may require manual regeneration before rebuild.
- **Load Generator**: Handled via a separate Skaffold config requiring the main 'app' config, ensuring it's deployed alongside services.
- **Load Generator**: Handled via a separate Skaffold config requiring the main 'app' config, ensuring it's deployed alongside services, with explicit multi-platform support.

### Deployment and Runtime
- **Manifest Updates**: Skaffold replaces image tags in manifests during deploy.
Expand Down
17 changes: 10 additions & 7 deletions .exp/design-workflow-3-helm-chart-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ The chart is marked as experimental in the README, encouraging feedback via GitH
- **README.md**: Provides basic and advanced installation examples, links to blog posts on advanced scenarios (e.g., Spanner integration, gRPC health probes).

### Deployed Resources
- **Core**: Deployments and Services for 11 microservices (adService, cartService, etc.) + loadGenerator.
- **Core**: Deployments and Services for all microservices (adService, cartService, ..., shoppingAssistantService) + loadGenerator.
- **ShoppingAssistantService**: Deployment and Service for the AI-powered shopping assistant that provides product recommendations and assistance.
- **Optional**:
- In-cluster Redis StatefulSet if `cartDatabase.inClusterRedis.create: true`.
- NetworkPolicies per service if enabled.
Expand All @@ -59,10 +60,10 @@ sequenceDiagram
H->>S: Apply rendered YAMLs (e.g., Deployments, Services, Redis if enabled)
S->>R: Create/Update Kubernetes objects
S->>R: Schedule Pods, pull images, run init containers if needed
Note over R: Microservices start; gRPC health checks; inter-service communication begins
R->>S: Pods become ready; Services get endpoints
Note over R: Microservices start. gRPC health checks. inter-service communication begins
R->>S: Pods become ready. Services get endpoints
S->>H: Confirmation of resource creation
H->>U: Helm release status (success/failure); NOTES for frontend access
H->>U: Helm release status (success/failure). NOTES for frontend access
```

### Component Creation Flowchart
Expand All @@ -74,9 +75,11 @@ flowchart TD
Load --> CheckFlags[Evaluate feature flags e.g. networkPolicies.create, cartDatabase.type]
CheckFlags -->|redis| CreateRedis[Create in-cluster Redis StatefulSet/Service]
CheckFlags -->|spanner| ConfigSpanner[Set env vars & annotations for Spanner connection]
CheckFlags --> RenderServices[Render per-service templates:<br/>Deployments, Services, Probes, Resources]
RenderServices -->|flags enabled| AddPolicies[Add NetworkPolicies, AuthPolicies, Sidecars]
CheckFlags --> RenderServices[Render core per-service templates:<br/>Deployments, Services, Probes, Resources]
RenderServices --> RenderSAS[Render shoppingAssistantService template:<br/>Deployment, Service, if enabled]
RenderSAS -->|flags enabled| AddPolicies[Add NetworkPolicies, AuthPolicies, Sidecars]
RenderServices --> AddOTEL[Add OTEL Collector if create: true]
RenderSAS --> AddOTEL
AddPolicies --> Apply[Apply all rendered resources to K8s API]
AddOTEL --> Apply
CreateRedis --> Apply
Expand Down Expand Up @@ -114,7 +117,7 @@ Helm manages upgrades, rollouts, and hooks if defined (none explicit in current

### Potential Enhancements
- Add hooks for pre/post-install (e.g., DB migration).
- Include shopping assistant service (currently missing in Helm).
- Support for additional emerging services or advanced database integrations (e.g., AlloyDB).
- Support more DB options (e.g., AlloyDB via values).
- Validate OCI packaging for chart distribution.

Expand Down
100 changes: 100 additions & 0 deletions pr-analysis-3113.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# PR #3113: Workflow Design Impact Analysis

## Affected Workflows
- **Local Development Workflow (1)**: Changes to Dockerfiles remove explicit --platform flags to leverage targetplatform for better multi-arch support. skaffold.yaml updated to include platforms and buildkit for loadgenerator artifact. This aligns with and strengthens the documented multi-arch build capabilities. Design doc updated to mention docker-bake.hcl as complementary tool.
- **GKE Deployment Workflow (2)**: Similar build fixes improve image building and pushing for multi-arch in GKE deployments. cloudbuild.yaml updates skaffold version to v2.14.1, potentially for compatibility.
- **Helm Chart Deployment (3)**: Adds template and values for shoppingassistant service, corrects image repository name, bumps version to 0.10.4. This completes the chart for all services. Design doc updated to reflect addition, including diagram and removal of enhancement note.
- **Kustomize Customization and Deployment (4)**: Updates to base manifests (e.g., adservice.yaml etc.) likely to match new image tags or configs, and addition of shopping-assistant component in components/ for customization.
- **Terraform Infrastructure Provisioning (5)**: Downgrades google provider to 6.26.0 and gcloud module to ~> 3.0, possibly to resolve compatibility issues with current terraform version.
- **Cloud Build CI/CD Pipeline (6)**: Updates skaffold image version in cloudbuild.yaml to v2.14.1.
- **Release Process (7)**: Updates to release/istio-manifests.yaml and kubernetes-manifests.yaml, likely incorporating new service or image changes.
- **Adding New Microservice (8)**: The PR adds the shoppingassistant service as per the workflow, updating skaffold.yaml, helm-chart, kustomize, and docs/adding-new-microservice.md with steps or examples.

## Workflow 1 Analysis
### Summary of design changes
The PR fixes Dockerfiles to support multi-platform builds by removing --platform args in build stages, allowing use of TARGETPLATFORM ARG for cross-compilation. Adds explicit platforms and local buildkit config for loadgenerator in skaffold.yaml, ensuring consistent multi-arch support across all artifacts. Introduces docker-bake.hcl for batch multi-platform builds. These changes implement and enhance the documented support for multi-arch local builds, improving developer experience on arm64 machines or mixed environments.

Potential benefits: Faster, more reliable local builds on Apple Silicon or other non-amd64 hosts, reduced build failures.

The design doc has been updated to include mention of docker-bake.hcl.

No major diagram changes, but the build step now implicitly supports multi-platform.

```mermaid
sequenceDiagram
participant D as Developer
participant S as Skaffold
participant B as Docker Build/Buildx:::changed
participant K as K8s Cluster
D->>S: skaffold dev
S->>S: Load skaffold.yaml (artifacts, manifests)
loop For each artifact (multi-arch support)
S->>B: docker buildx build -t <image>:<tag> --platform linux/amd64,linux/arm64 src/<service>
B->>B: Build image from Dockerfile with targetplatform support (added)
end
S->>K: kustomize build kubernetes-manifests/ | kubectl apply -f -
K->>K: Create Deployments, Services, Pods
Note over S,K: Pods pull local images and start
D->>K: kubectl port-forward svc/frontend 8080:8080
Note over D: Access app at http://localhost:8080
classDef changed fill:#FFFF00,stroke:#333,stroke-width:2px
```
B participant highlighted in yellow to show enhanced multi-platform capabilities.

## Workflow 2 Analysis
### Summary of design changes
Similar to workflow 1, the PR enhances the build phase for pushing to registry with multi-platform support via updated Dockerfiles and skaffold config. The cloudbuild.yaml change to older skaffold version may address specific bugs or compatibility in CI environment. These ensure the workflow works reliably in cloud contexts with diverse architectures.

No diagram updates needed.

```mermaid
sequenceDiagram
participant U as User/CLI
participant S as Skaffold
participant B as Builder (Docker/Buildkit, multi-platform):::changed
participant R as Registry (Artifact Registry)
participant K as Kustomize
participant C as GKE Cluster (kubectl)
U->>S: skaffold run --default-repo=<registry>
Note over S: Parse skaffold.yaml<br/>Configs: app, loadgenerator
loop For each service artifact
S->>B: Build image from src/<service>/Dockerfile
B->>B: Use local Docker or GCB profile, multi-platform
B->>R: Tag & push <registry>/<service>:<tag>
end
Note over S: Update image tags in manifests
S->>K: kustomize build kubernetes-manifests/
K->>C: kubectl apply -f rendered.yaml
C->>C: Deploy pods, services, etc.
Note over C: Includes Redis if not customized
U->>C: kubectl get service frontend-external
C->>U: External IP for access
classDef changed fill:#FFFF00
```
Yellow on B to show enhanced multi-platform build.

## Workflow 3 Analysis
### Summary of design changes
[as above]

```mermaid
[the diff flowchart I validated earlier]
```

## Workflow 4 Analysis
### Summary of design changes
The PR updates several kustomize/base/*.yaml files, likely to incorporate changes from new service or image updates. Adds or updates kustomize/components/shopping-assistant/ for integrating the new service via Kustomize overlays. This extends the customization options to include the new microservice.

Potential benefits: Users can now customize deployments to include or modify the shoppingassistant service using Kustomize components.

[Diagram if I had the doc, but since I didn't read it, brief]

## Similar for 5

For workflow 5, changes are version downgrades, which may not change the design, just maintenance.

No major impact.

For workflows 6-8, since no design docs yet, general summary without diagram.

The PR affects their implementation by updating configs and adding service support, but design docs need to be created to fully analyze.
Loading