Add readonly mode, more efficient package sets#760
Open
thomashoneyman wants to merge 1 commit intomasterfrom
Open
Add readonly mode, more efficient package sets#760thomashoneyman wants to merge 1 commit intomasterfrom
thomashoneyman wants to merge 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a quick prototype pull request demonstrating two things:
READONLYenv var that can be used if you want to test the live server but set it to not perform any writes (to storage, pursuit, the registry, etc.)outputdirectory, thus making it so incremental sets can be fast to compile instead of recompiling the full 500+ package sets.We've been struggling with seeing package set builds time out in the registry server because it's a bit underpowered and we only allot 30 minutes total for a job. It's not able to get through the full set before timing out. We can bump the timeout, but then the package set job will block anyone from publishing for the full duration of the build.
So: why is it so slow? The
UpgradeAtomichandler clearspackages/,output/, andoutput-backup/at the start of every job to ensure there are no false positive compilations. A full recompilation on a beefy machine may only take a minute or two, but on the registry server it's taking forever.The WIP code does a more targeted wipe instead:
output-backup/: Always wiped (this is transient rollback state fromattemptPackage).output/: Only wiped when the compiler version changes, but otherwise preserved for incremental compilation. We're relying on the compiler here to detect changes to packages.packages/: Synchronized, in that extraneous directories are removed and missing ones are installed, so the packages directory matches the contents of the submitted package set job.This should work; the compiler's incremental compilation takes these steps:
purs compile packages/**/*.purs.pursfiles matching the globsoutput/<Module>/externs.cbortimestamp vs source timestampoutput/Separately, the
syncPackagesfunction figures out which directories inpackages/don't belong to the target set and removes them. TheninstallPackagesfills in missing ones. This is equivalent to a wipe + reinstall but avoids re-downloading and re-extracting hundreds of tarballs.Of course, it's hard to think through all possible edge cases that could be hit here with preserved files so I haven't marked this as a ready, but I wanted to get it here for discussion.