-
Notifications
You must be signed in to change notification settings - Fork 4
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
CLI migration #534
CLI migration #534
Conversation
Looks like there's a |
a86ac6f
to
c513382
Compare
CI deployment of testnet should be migrated to Mainly because the CLI is what is used as an application to deploy. So we cannot actually deploy anything from here. That's the app to this library. |
Make sure that this PR fixes the staging CI/CD too, so that staging CI should be passing when this is merged. @tegefaulkes |
Some tests are just going to fail until stage 2 agent migration is done. I'll have to skip these. |
It may be useful to add a new release job publish an pre-release version on NPN and only check build and linting. We may want to do a pre-release without running through all the tests. This will be useful for testing the |
Oh, I think this is already a thing? |
Not sure what you are talking about here? There's already prereleases. |
The following tests have been disabled for now, pending work and fixes in agent migration stage 2. I'll add a comment in that PR as well.
|
CI is failing on client domain tests. It's core dumping with
I ran the tests locally for that domain with
We can see that the client RPC is using a lot more memory compared to the others. I'll need to dig into why this is happening. I also ran the tests with
Related to this is one of the notifications test is holding the process open. |
Eyeballing htop shows that vaults and keys domain tests use up about 1GB-2GB, while client domain is using 4GB-5GB. |
The open handle is coming from |
Note, using |
The receiver of the context is suppose to clean it up. This is something that's handled by js-contexts. If you just create a Timer with nothing receiving it, then yes it will leak. Which means you should use js-contexts in these scenarios or make sure to clean up manually. |
Remember whoever created the object is supposed to destroy it. So whoever created the timer needs to clear the timer. |
Js-quic handle is just dlopen and that wouldn't be a memory leaks. |
Ok, from what I can tell, then the tests are run in band with I think there are 3 things we can do to help.
I'm going to move forward with 1. and 2. |
Applying .1 and .2 results in 1/4th the heap usage now, totalling 300MB. So this should resolve the problem. |
I don't like the idea of combining test files. That just increases the amount of cross-over interference and bugs. A better idea would be the reduce the concurrency... Memory should be garbage collected between test files. If they aren't that's a problem. |
How would we reduce concurrency? Everything already runs in a single band in CI. As for gabage collection between test files, that's up to jest isn't it? Even using I'll make a new issue for further investigation into the memory issue. |
New issue created at #542 |
Jest is just running nodejs processes. Nodejs should be GCing whatever is no longer necessary. It's unlikely jest is deliberately keeping memory around for no reason. It's far more likely that a memory leak is caused by introduction of the new code, and incorrect resource creation/destruction procedures during testing. It's a spiky system at scale. |
Well the fact that it runs single band convinces me even more that memory leaks is not caused by anything underlying. It's the new code and the new tests. |
CI has passed. |
[ci skip]
51bd7c4
to
a4e8311
Compare
This can be merged when CI passes again. |
Should we merge both at the same time? MatrixAI/Polykey-CLI#2 I'd like to make sure we don't lose anything in the extraction. |
fc.jsonValue can generate valid json that won't be equal to itself after a serialize/parse. This is normal for json but was breaking the tests sometimes.
I need a published version, preferably not an alpha one to test the CI in |
You need a published version of Polykey itself right? So CI needs to pass for that to occur. The CI will do an auto-publish when it's all done. |
The only thing necessary is to push up a pre-release tag. In fact I believe this is possible just even in the feature branch, and not the staging branch. Is there anything else that needs to be done here? Please ensure there's a list of tasks in the MatrixAI/Polykey-CLI#2 that tracks all that must be done there and preserved/factored out from here including README. |
Except for the pre-release tag, everything is done here. I'll do a tag really quick. |
The prepatch pipeline succeeded. It seems like it triggered a merge of staging to master. I'm not sure we want that to happen? considering it was initiated from a feature branch. |
I'll merge this now. |
Try doing prereleases from staging branch in the future. |
Description
In this PR we need to take the CLI part of
Polykey
and move it into it's own package that depends onPolykey
. This means moving thesrc/bin
directory as well as thetests/bin
and integration tests. Any CI jobs related to building and testing the built executables need to be moved along with this.Any package dependencies relating directly to CLI need to be moved as well.
This needs to be rebased on top of #525 consistently.
Issues Fixed
Tasks
Polykey-CLI
.Final checklist