-
Notifications
You must be signed in to change notification settings - Fork 16
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
sqd deploy from within a monorepo #63
Comments
Hey! We run |
We're running
Ya, that's why we have to add this fake |
Hi @mo4islona gentle reminder. Is there a pattern to make squid-cli work in a monorepo without the hacks and to allow it to import from local packages? |
Hey @mlenser! Sorry for the delay.
You can run the
In general, I see 2 options to solve the issue:
WDYT? |
Copying the
|
Got it. Are you using |
We're currently using Our
This allows it to function as the
I'm trying to solve for the second issue at least, but I'm not seeing a way to make |
So, we are preparing a new release with a feature allowing customization of the |
So
build:
# ... other options
install:
cmd:
- pnpm
- install This will allow you to install deps without a lockfile. But be aware of their possible inconsistency. |
That sounds very promising, thank you! Upon testing it our squid has been building for 1 hour and 20 mins when it previously took around 5-30 mins. I assume it has failed.
|
Well, your build just hanged on our builder. I'm investigating |
Update: I let one build run for 1 hour & 22 minutes. It built the squid forever and then got to
|
Thats fine for now. I'll come back when issue will be fixed |
I assume the problem is that the squid directory cannot be built with pnpm install
ERR_PNPM_WORKSPACE_PKG_NOT_FOUND In : "eslint-config-astaria@workspace:*" is in the dependencies but no package named "eslint-config-astaria" is present in the workspace
This error happened while installing a direct dependency of /Users/user/Downloads/b0a8bd69-9c5f-430b-be13-d024a56eb664
Packages found in the workspace: |
But, in general, you are importing internal packages thats missing in the archive
In that case, I think, you should try to upload whole monorepo and modify build:
node_version: 20
# package_manager: pnpm - BTW no need to specify it explicitly, it will understand by the pnpm lockfile in the root
# do not modify install / build command
deploy:
processor:
cmd:
- cd
- packages/indexer
- &&
- node
- lib/main
api:
cmd:
- cd
- packages/indexer
- &&
- npx
- squid-graphql-server
- '--dumb-cache'
- in-memory
- '--dumb-cache-ttl'
- '1000'
- '--dumb-cache-size'
- '100'
- '--dumb-cache-max-age'
- '1000'
|
|
Please add quotes |
Ya, I tried that as well. 😋
|
Oh, I see :( Okay, I'll try to make it work and come back again. |
Hey! What is the structure of your monorepo directories? A classical one?
|
Indexer only imports from packages. pnpm wires it all together. The current structure of squid isn't setup for the standard setup or our setup. |
Well, we've added support for combining commands with "&&". Please update to 2.8.5 How do you build the squid? Probably you have to setup a proper |
When deploying from the root I run into:
😢 Our monorepo isn't very big. Any idea how to prune things like |
Could you please provide a full log? |
Or, if the repo is in the public domain, I can take a look at it and try to deploy it |
Let me get back to you tomorrow. I may have it set up properly and working in CI minus some internal config issues. The memory warning only happens when I run it locally. I'll update tomorrow. |
Is there a way I can give you a log via some The issue is squid throws an error if it's >52 MB. Not sure that'll be avoidable with these methods that inherently group a lot more data. Deploying from the root for example includes everything in |
I'm actually interested in the client-side log. 52 MB is not a memory issue, it's the maximum size of the uploaded file. I believe the problem is that the |
I hope it's only |
BTW have you tried to deploy a package?
|
I'm trying 2 methods currently: Method 1: Deploy from the rootFrom root package.json run This uses
This includes everything and I don't love deploying from the root as it requires me to install things at the root. Method 2: pnpm deploy and then sqd deploy thatFrom
This is including all the I think this is likely the better option if I can get it working as pnpm deploy includes all the dependencies. The issue is that squid is then trying to reinstall dependencies (maybe ok?) and including the |
Unfortunately the Also these used sub-packages within a monorepo will be copied as is with |
What's the recommendation then? Neither method works - from the root is hanging again (may be due to the size?) and |
Please take a look at https://github.com/mo4islona/squid-monorepo I see 2 ways: And easy - include full monorepo into Docker
With manifest Is not working for now but it could be fixed More complicated
And please update cli first before try |
should it be line 11? |
Yes, sorry for confusing. I just added one more line after comment |
I've found a way how run w/o any fix on backend/cli side |
I've been trying the basic version and everything seems to work except the migration/init of the db When you say:
What doesn't work and how can it be fixed? Logs I'm seeing: Healthy deploy (old setup):
Unhealthy deploy (monorepo imports setup):
|
Using cd command — |
Is it
|
Ya, that's us. I'll look into this and get back to you. Thanks for being so responsive. |
@mo4islona I've tried the "more complicated" version of what you're shared above and it appears to be having the same issue. It seems to not do the migration successfully. The logs on https://app.subsquid.io/squids don't provide any data while it's in progress. Is there any way to see the issue as you saw it? It could be a problem on our end, but it's hard to know what is going on. |
Yup, that's the next step. We're using internal-packages for turbo repo. We'll have to hack together some builds to make squid work. 😢 |
We've got step one done: building from the root with all the setup above. Now I'm working on the building dependency packages. How were you able to see the above images about
|
Nevermind - I'm seeing some errors in the logs
|
Update: We got it working, mostly. I'm finishing off some edge case stuff. Once it's in a solid state hopefully I can write our solution here for others. |
I'm looking into moving our indexers from EC2 instance to Squid cloud and I'm experiencing the same issue. We have one module for all EVM chains (named moonbeam, chain controled via env variables) and 1 module per Substrate chain plus additional I've tried to override ymls build.install.cmd with npm install but I'm still getting this error:
@mlenser , would you be so kind to share your solution? Considering it's a workaround, is there any way for proper solution? It would also be nice if CLI would be able to npm install once from the root an then deploy all of the indexer modules. |
Hey, @tad3j ! Are you deploying from the project root? |
I've tried from root as well as copying the lock file to module folder and deploying from there. |
Hi,
We have a monorepo where our
indexer
is a package of many.sqd deploy
expects apackage-lock.json
(or the equivalent for yarn/pnpm) within the package, but the lock file is at the root of the monorepo. We've worked around this a bit by forcing ourindexer
to generate apackage-lock.json
vianpm i --omit=dev --legacy-peer-deps --install-strategy=nested --workspaces=false --package-lock-only
.But that presents its own challenges as we cannot import from any other packages within the monorepo and we have to continuously update the
package-lock.json
just forsqd deploy
.Is there a recommended path here? We just switched from
yarn
topnpm
at the monorepo root if it matters.The text was updated successfully, but these errors were encountered: