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 workspace support #564

Closed
chesedo opened this issue Jan 3, 2023 · 5 comments
Closed

Add workspace support #564

chesedo opened this issue Jan 3, 2023 · 5 comments
Labels
T-Improvement Improvement or addition to existing features

Comments

@chesedo
Copy link
Contributor

chesedo commented Jan 3, 2023

When I deploy a crate that is within a workspace and that has a { workspace = true } dependency, then I get an error that the manifest cannot be parsed.

The reason for this is because shuttle did not archive the entire workspace, but only the single crate.

@chesedo chesedo added the T-Improvement Improvement or addition to existing features label Jan 3, 2023
@gautamprikshit1
Copy link
Contributor

Any help on how to achieve this

@chesedo
Copy link
Contributor Author

chesedo commented Jan 26, 2023

I can think of the following changes that will be needed (each in a separate PR):

  1. Our way of finding the Cargo.toml file is wrong since it currently stops at the first one found. Rather it should do whatever cargo is doing to continue looking in the parent tree for another Cargo.toml that might be the workspace one. When shuttle collects the correct Cargo.toml (for the workspace) then I believe everything is already in place for shuttle to correctly archive the entire workspace. Identifying the correct Cargo.toml is a change that needs to happen in cargo-shuttle somewhere.
  2. We have a loader.rs file (in service) which builds an archive, but then only gets the first cdylib from the build. Since the archive is now the entire workspace there might be multiple cdylibs so this build method needs to be updated to return a Vec<_>. The caller might then also need a small update, but I believe shuttle has everything else in place to support running multiple services / crates in a workspace.

@brokad
Copy link
Collaborator

brokad commented Mar 2, 2023

Just to confirm here @chesedo, I suppose this also requires a change in deployer somewhere since a workspace could contain multiple services, each of which needs recognition in the deployer's state?

@chesedo
Copy link
Contributor Author

chesedo commented Mar 29, 2023

@brokad the deployer state can already start multiple services. For services that depend on one another, starting them in the correct order is just missing.

@chesedo
Copy link
Contributor Author

chesedo commented Mar 29, 2023

Change number 2 for the above comment is implemented in #767

@oddgrd oddgrd closed this as completed Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Improvement Improvement or addition to existing features
Projects
None yet
Development

No branches or pull requests

4 participants