Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to buildengine WatchEvent to indicate if it was a hash change or schema change #1032

Closed
wesbillman opened this issue Mar 6, 2024 · 2 comments · Fixed by #1059
Closed
Assignees

Comments

@wesbillman
Copy link
Collaborator

This will be useful so we only rebuild dependent modules when a module's schema changes. This will improve performance of the build system.

@wesbillman wesbillman self-assigned this Mar 6, 2024
@alecthomas alecthomas mentioned this issue Mar 6, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Mar 6, 2024
@wesbillman wesbillman removed the triage Issue needs triaging label Mar 6, 2024
@wesbillman
Copy link
Collaborator Author

@alecthomas for this one, I think I can watch PullSchema to get schema changes and react accordingly, but it seems like the schema always thinks it changed when we redeploy a module because of this code during the deploy step.

	module.Runtime = &schemapb.ModuleRuntime{
		CreateTime:  timestamppb.Now(),
		Language:    config.Language,
		MinReplicas: replicas,
	}

So when we deploy the CreateTime of the Runtime will be different indicating a change. I could do something like remove that from the schema before comparing, but not sure if that's the best approach or not. Maybe we can sync on this when you have a sec.

Or maybe there's something else I can watch like just the build schema changes vs. deploy changes.

@alecthomas
Copy link
Collaborator

Makes sense, you figure something out and send it in the PR.

wesbillman added a commit that referenced this issue Mar 11, 2024
Fixes #1032 

Schema change on the `time` module:
```sh
ftl dev examples/go --recreate

info:time: Building module
info:time: Deploying module
info: time's schema changed; redeploying: [echo]
info:echo: Building module
info:controller0: Stopped time-cbfb2a0492
info:controller0: Deployed time-e21924cdd1
info:echo: Deploying module
info:controller0: Stopped echo-040fbeef14
info:controller0: Deployed echo-be607675b7
```

Schema change on the `productcatalog` module:
```sh
ftl dev ../ftl-examples/online-boutique/backend/services examples/go --recreate

info:productcatalog: Building module
info:productcatalog: Deploying module
info: productcatalog's schema changed; redeploying: [checkout recommendation]
info:recommendation: Building module
info:checkout: Building module
info:controller0: Stopped productcatalog-18dcbb6b02
info:controller0: Deployed productcatalog-d1d5fc9afd
info:recommendation: Deploying module
info:checkout: Deploying module
info:controller0: Stopped checkout-6c32b3cd6c
info:controller0: Stopped recommendation-c37d4bb336
info:controller0: Deployed checkout-e21c6b7419
info:controller0: Deployed recommendation-cd2ab7120f
```

Non-schema change to `time` module:
```sh
ftl dev examples/go --recreate

info:time: Building module
info:time: Deploying module
info:controller0: Stopped time-a77c27533b
info:controller0: Deployed time-243020e400
```
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 a pull request may close this issue.

2 participants