-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
feat(core): Integrate object store as binary data manager #7253
Merged
ivov
merged 300 commits into
master
from
pay-848-integrate-object-store-service-as-binary-data-manager
Oct 5, 2023
Merged
Changes from 250 commits
Commits
Show all changes
300 commits
Select commit
Hold shift + click to select a range
e8ccf05
Merge branch 'master' into pay-771-implement-soft-deletion
ivov 2071c7f
Remove call from hook
ivov be44721
Merge parent branch
ivov 1d50b61
Refix conflict
ivov e042e91
Add formats to schema
ivov e948f8f
Add `ensureStringArray` util
ivov 0feb926
Adjust types based on parsing
ivov c73f18c
Add type guard
ivov f8fec92
Clean up types in `init()`
ivov 93ea57c
Fix test
ivov c8676be
Remove unneeded modifier
ivov 25006e8
Cleanup
ivov a7156f8
Fix node tests
ivov e0e90b6
Remove unneeded line
ivov 219addb
Rename constant
ivov d7c7f5f
Remove comment
ivov 1ea380d
Fix tests
ivov a5b388b
Cleanup
ivov 9204754
Rename error
ivov 9597508
Improve error message
ivov 8fde8be
Better error
ivov ada012e
Better message
ivov 67e163f
Make execution ID non-nullable
ivov 9665da1
Merge master
ivov 12636dd
Readability improvements
ivov e5c8c72
Adjust types, followup to 67e163f
ivov 8849007
Merge parent branch
ivov b7062e5
Fix lint
ivov 79ecaa9
Fix lint
ivov 02b6d86
Cleanup
ivov 745437f
Install `aws4` and `@types/aws4`
ivov ccd3abb
Add to config schema
ivov afcc474
Set up object store service
ivov 0f909b0
Set up temp dev code
ivov 96ea9ea
Comment out cache keys
ivov 3d76b21
Revert "Comment out cache keys"
ivov 455c327
Rename dir to `TempBinaryData`
ivov 65b4fb0
Rename back to `BinaryData`
ivov 3bf3430
Merge master
ivov abe6d9d
Clear timers on shutdown
ivov 2682b3d
Set timers only on main instance
ivov 1c788fe
Also for clearing timers
ivov f248982
Merge parent branch
ivov 04f4b83
Rename back to `localStoragePath`
ivov 03264f9
Remove unused arg
ivov a6e33d4
Fix lint
ivov fa09435
Merge parent branch
ivov 552860a
Make as enterprise edition
ivov 8823554
Add logging, refactor for readability
ivov a5def40
Ensure hard-deletion select includes soft-deleted rows
ivov 77955e4
Switch `info` to `debug`
ivov b930e3e
Fix tests
ivov e91f3de
Remove redundant checks for `deletedAt` being `NULL`
ivov 2c3704d
Fix lint
ivov 215f58e
Fix last test
ivov fabecea
More setup
ivov 33344bc
Add sample path structure
ivov 70ab53b
Set up some errors
ivov e22f0bf
Remove unused
ivov d5c8935
Cleanup
ivov 55b6b6f
Fix `HEAD` request
ivov c33d164
More missing loggers in tests
ivov 69764f7
Add logger to even more test
ivov 6b313ee
Fix upload
ivov 7c3e58d
Refactor logging for tests
ivov 7f6d66a
Consolidate `getStream` and `getBuffer`
ivov 3408a31
Cleanup
ivov 2aeb9ac
Support single deletion
ivov cc60aeb
Cleanup
ivov e52ca88
More cleanup
ivov 6fe79b8
Merge parent branch
ivov eebadfd
Merge parent branch
ivov 6008c41
Remove sample image
ivov f1b0ca6
Add listing
ivov d82749b
Implement `deleteMany`
ivov 9e43623
Rename arg
ivov 09ace0c
Major refactor to keep reducing interface
ivov 5810a1b
refactor(core): Include workflow ID in binary data operations
ivov 04584b0
Fix lint
ivov 4f025b2
Merge master, fix conflicts
ivov 80a4fc5
Fix misresolved conflict
ivov 20d5ea7
Remove excess check on init
ivov eb0849e
Merge parent branch
ivov f99df11
Fix misresolved conflicts
ivov 4475773
Remove commented out bits
ivov 4362e23
Remove comment
ivov 0714d44
Consistent naming
ivov 7614b6f
Merge parent branch
ivov fa8e51d
Reorder
ivov 91f0755
Better error message
ivov 6d0c271
Remove `ObjectStore` from this PR
ivov fa88894
Remove schema change from this PR
ivov de61768
Update deps
ivov eb03437
Remove missing dep
ivov c9e4924
Remove reference
ivov c9453fd
Cleanup
ivov 3d04b9e
Remove `ObjectStore.manager.ts` stub
ivov 0f84eb6
Remove `ObjectStore.manager.ts` stub
ivov 8d21370
Merge parent branch
ivov 9d3b7e5
Revert changes to lockfile
ivov a4a915a
Cleanup
ivov cd501d7
Cleanup
ivov 824fc21
Remove unneeded comment
ivov 875188b
Better naming
ivov f3a9729
Cleanup
ivov f85cf8b
Move `ensureDirExists` to utils
ivov 571fe0a
Consolidate errors
ivov 03b3947
Improve typings
ivov 9ab615f
Merge parent branch, resolve conflicts
ivov 594aab1
Fix misresolved conflict
ivov e190efd
Restore error
ivov 605d02b
Revert rename to `BinaryDataManager`
ivov 922ce32
Merge parent branch
ivov 6e6b28e
Merge parent branch
ivov b49cb7a
Cleanup
ivov ba91b05
More accurate naming
ivov ffc994d
Merge parent branch
ivov c430f22
Missing renaming in test
ivov 5a603d2
Merge parent branch
ivov 90a85eb
Merge parent branch
ivov 73b38df
Initial setup
ivov 73c0cb3
Add stub for `ObjectStore.manager.ts`
ivov ed9d514
Tighten typings
ivov 6613f23
Merge parent branch
ivov f3c8983
Merge parent branch
ivov 0fe0aeb
Mark spots to update
ivov 06002ad
Cleanup
ivov f144cb9
Simplify
ivov 94e5449
More simplifications
ivov 47d5646
Better naming
ivov a22818d
Merge parent branch
ivov 1f485da
Simplify stub
ivov 08ae523
Make `getAsStream` async
ivov 2d0325b
Async change also in `WebhookHelpers`
ivov a1f3d99
Address user-written files
ivov a1b82ae
Cleanup
ivov bba6f76
Fix test
ivov caac8e1
Cleanup
ivov 75eb2f0
Fill out copy and deletion methods
ivov d79fbe3
Cleanup
ivov 40df3d1
Integrate manager into service
ivov ac90df9
Add TODO
ivov 06c80c6
Cleanup
ivov 414a357
Better typing
ivov 05034e2
Dyamic imports
ivov dd6d085
Revert test changes
ivov fe52383
Add metadata support
ivov 99c0371
Adjust `/data/:path`
ivov 0cdfb79
Rename constant
ivov 08ce3f7
Merge master
ivov 61c2f5a
Restore `LogCatch`
ivov 74adb24
Add file not found error to `getSize`
ivov 0bc2457
Add `mode` to `InvalidBinaryDataManagerError`
ivov 3c96f2f
Merge parent branch
ivov 4c62df6
Resolve more conflicts
ivov bd3d202
Merge parent branch, fix conflicts
ivov 672d0a5
Merge parent branch, fix conflicts
ivov 3fa72d0
Update per merge
ivov 8a28853
Add breaking change
ivov c90da67
Refactor `prepareRequestBody`
ivov fa0f6d0
Remove jest-injected args
ivov 092d212
Await for QS to build
ivov 40c054d
Fix headers in HTTPRN
ivov 0620800
Merge master, fix conflicts
ivov 00e4a87
Remove comment
ivov 410c932
Set order `workflowId -> executionId` in `copyBinaryFile`
ivov 86580c8
Set order `workflowId -> executionId` in `store`
ivov 55062f3
Set order `workflowId -> executionId` in duplication methods
ivov 91e60e1
Cleanup
ivov f66dfb9
Remove needless casting
ivov aac2bff
Set order `workflowId -> executionId` in `copyByFileId`
ivov 0d5b425
Add unit tests
ivov b546a4d
Merge parent branch
ivov 209b024
Add license and schema flags
ivov c44925e
Merge master, fix conflicts
ivov de88aeb
Merge master, fix conflicts
ivov 1dfec1f
Merge parent branch
ivov 824ceb4
Fix build
ivov c79ba57
Remove integration parts
ivov 84596ab
Cleanup
ivov f556cee
Remove comment
ivov c27b798
Initial setup
ivov 596ae8d
Merge master
ivov 923499f
Cleanup
ivov 6577851
Minor improvements
ivov 5278f4b
Merge parent branch
ivov 2dbbfa8
Remove from FE settings
ivov bbddb2a
Remmove from `IN8nUISettings`
ivov 73b09b3
Missing spot
ivov 16503c5
Initialize s3 binary manager
ivov e3cb832
Add rename
ivov b2bd541
Fix check
ivov 09d862e
Inject dependency
ivov 2dd42b2
Missing spot
ivov 769550b
Fix serving to UI
ivov 377245b
Fill out comment
ivov 310fa9a
Better naming
ivov e3f7bf3
Rename env vars
ivov 145bce5
Remove `deleteOne`
ivov 89919a1
Fix tests
ivov 98d0c3a
Rename errors
ivov 63c03d5
Straighten out license checks
ivov d1ae8fa
Fix tests
ivov 157d2ef
Adjust license checks
ivov 7f65303
Add explanatory comments
ivov b92d6d7
Merge master, fix conflicts
ivov a3ecaed
Merge parent branch, fix conflicts
ivov 24cc474
Add readonly mode
ivov 4afcb19
Implement `copyByFilePath`
ivov 537bb0c
Remove logging
ivov 63b2db2
Adjust `restoreBinaryDataId` for s3
ivov 8dcc087
Write docs
ivov 8575f49
Write unit tests
ivov 7e7902c
Merge master, fix conflicts
ivov a444552
Typo
ivov 5af3015
Better naming
ivov 5aeb541
Cleanup
ivov d768250
Remove `inTest`
ivov 37cbdb9
Add TODO
ivov d53a2e2
Account for license expiring when blocking writes
ivov b6363c8
Clarifications
ivov da4c118
Update setting on doc
ivov 5873b93
Parameterize host
ivov 9c48a7b
Switch pattern from bucket before host to bucket in path
ivov a2f67dd
Cleanup
ivov 5b27a9b
Add example
ivov 9c5d2be
Avoid checking connection twice
ivov 75d66f9
Remove logging
ivov c1e8fdf
Fix tests
ivov 889c8d3
Add logging
ivov 05cea35
Remove logging
ivov 9b61f85
Fix tests
ivov bc90500
Cleanup
ivov 258f218
Add more logging
ivov 07d2b1b
Fix lint
ivov b75cbbb
Improve check
ivov 9fde3f0
Simplify check
ivov 2a3c1e2
Add examples
ivov f98a467
Typo
ivov a398719
Refactor test
ivov e584be1
Expand tests
ivov 39b3188
Improve error message
ivov fe56d4e
Inject dependency
ivov 05f2467
Comment to clarify
ivov d4bb172
Merge master
ivov 02a54da
Refactor startup logic
ivov a8c39ed
Remove setup doc
ivov 4e99a90
Rename envs
ivov deb6076
Remove Axios error from log
ivov 7a0039c
Better var naming
ivov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -901,7 +901,7 @@ export const schema = { | |
doc: 'Available modes of binary data storage, as comma separated strings', | ||
}, | ||
mode: { | ||
format: ['default', 'filesystem'] as const, | ||
format: ['default', 'filesystem', 's3'] as const, | ||
default: 'default', | ||
env: 'N8N_DEFAULT_BINARY_DATA_MODE', | ||
doc: 'Storage mode for binary data', | ||
|
@@ -914,6 +914,45 @@ export const schema = { | |
}, | ||
}, | ||
|
||
externalStorage: { | ||
s3: { | ||
host: { | ||
format: String, | ||
default: '', | ||
env: 'N8N_EXTERNAL_STORAGE_S3_HOST', | ||
doc: 'Host of the n8n bucket in S3-compatible external storage, e.g. `s3.us-east-1.amazonaws.com`', | ||
}, | ||
bucket: { | ||
name: { | ||
format: String, | ||
default: '', | ||
env: 'N8N_EXTERNAL_STORAGE_S3_BUCKET_NAME', | ||
doc: 'Name of the n8n bucket in S3-compatible external storage', | ||
}, | ||
region: { | ||
format: String, | ||
default: '', | ||
env: 'N8N_EXTERNAL_STORAGE_S3_BUCKET_REGION', | ||
doc: 'Region of the n8n bucket in S3-compatible external storage, e.g. `us-east-1`', | ||
}, | ||
}, | ||
credentials: { | ||
accountId: { | ||
format: String, | ||
default: '', | ||
env: 'N8N_EXTERNAL_STORAGE_S3_ACCOUNT_ID', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This turned out a bit misleading - I tried using the AWS account ID but what's supposed to be here is the access key. I think we should rename this to access key and access secret WDYT? |
||
doc: 'Account ID in S3-compatible external storage', | ||
}, | ||
secretKey: { | ||
format: String, | ||
default: '', | ||
env: 'N8N_EXTERNAL_STORAGE_S3_SECRET_KEY', | ||
doc: 'Secret key in S3-compatible external storage', | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
deployment: { | ||
type: { | ||
format: String, | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a fan of the naming here since it does not show relation to the binary data mode and onfeaturechange() is a general function