[feat] add flags to limit extraction#108
Closed
flipswitchingmonkey wants to merge 3 commits into
Closed
Conversation
|
I would also like to see this feature implemented. The project I'm working on contains a lot of independent "modules" and to work effectively across our team, the ability to extract a subset of collections would be very beneficial. |
|
I forgot this PR existed when I made my own. I used the same conventions for flags on the apply side. Thoughts? |
Collaborator
|
Closing in favor of #134 |
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 PR adds a number of flags to the
extractcommand.--skipCollectionFiles: do not extract thedirectus_filescollection--skipDownloadFiles: do not download the actual file attachments--syncExtractContent: extract content collections in a serial manner to limit load on instance--limitContentCollections "articles,something_else": only extract named content collectionsMotivation
We have a few very underpowered instances running Directus in a Kubernetes context, with a limit on CPU usage. Some of these have large collections, for example large amounts of image files. Running the template extract will cause the CPU load on these instances to spike over a long time, causing them to crash eventually (either by running out of RAM or by being forcibly stopped by Kubernetes).
To make the template CLI usable without crashing the instances, we had to disable all file related extractions. Thus, these added flags.
Possible Issues
By selectively extracting collections or files, there is a real danger of breaking relations if other collections point to these missing entries. Managing these issues is the responsibility of the user - since these flags are only to be used in specific use cases, it is assumed that the user knows what he or she does...
Edit: just noticed that a similar PR exists. Oh well...