Skip to content

Commit

Permalink
local block adaptor import support (#5277)
Browse files Browse the repository at this point in the history
* local block adaptor import support

* apply code review changes

* local cache information for import performance

* fix lint errors

* integration test for default import

- will ignore file size as we generate locally smaller files
- does not support non directory source

* remove unused and reuse block type as prefix

* Update docs/reference/configuration.md

Co-authored-by: Ariel Shaqed (Scolnicov) <ariels@treeverse.io>

* calc hash as part of iteration

* using constant for magic numbers

* fix lint err on md5

* Skip hidden files by default

* Update import_hidden parameter

---------

Co-authored-by: Ariel Shaqed (Scolnicov) <ariels@treeverse.io>
  • Loading branch information
nopcoder and arielshaqed authored Feb 21, 2023
1 parent a940c20 commit 1aedf49
Show file tree
Hide file tree
Showing 40 changed files with 582 additions and 134 deletions.
11 changes: 11 additions & 0 deletions api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ components:
application/json:
schema:
$ref: "#/components/schemas/Error"
Forbidden:
description: Access is forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
NotFound:
description: Resource Not Found
content:
Expand Down Expand Up @@ -937,6 +943,7 @@ components:
- blockstore_namespace_example
- blockstore_namespace_ValidityRegex
- pre_sign_support
- import_support
properties:
blockstore_type:
type: string
Expand All @@ -948,6 +955,8 @@ components:
type: string
pre_sign_support:
type: boolean
import_support:
type: boolean

VersionConfig:
type: object
Expand Down Expand Up @@ -3150,6 +3159,8 @@ paths:
$ref: "#/components/responses/ValidationError"
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
404:
$ref: "#/components/responses/NotFound"
default:
Expand Down
16 changes: 16 additions & 0 deletions clients/java/api/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/java/docs/ImportApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/java/docs/StorageConfig.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/docs/ImportApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/docs/StorageConfig.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions clients/python/lakefs_client/model/storage_config.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/lakefs/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ func checkMetadataPrefix(ctx context.Context, repo *catalog.Repository, logger l
if _, err := adapter.Get(ctx, block.ObjectPointer{
StorageNamespace: repo.StorageNamespace,
Identifier: dummyFile,
IdentifierType: block.IdentifierTypeRelative,
}, -1); err != nil {
logger.WithFields(logging.Fields{
"path": dummyFile,
Expand Down
11 changes: 11 additions & 0 deletions docs/assets/js/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ components:
application/json:
schema:
$ref: "#/components/schemas/Error"
Forbidden:
description: Access is forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
NotFound:
description: Resource Not Found
content:
Expand Down Expand Up @@ -937,6 +943,7 @@ components:
- blockstore_namespace_example
- blockstore_namespace_ValidityRegex
- pre_sign_support
- import_support
properties:
blockstore_type:
type: string
Expand All @@ -948,6 +955,8 @@ components:
type: string
pre_sign_support:
type: boolean
import_support:
type: boolean

VersionConfig:
type: object
Expand Down Expand Up @@ -3150,6 +3159,8 @@ paths:
$ref: "#/components/responses/ValidationError"
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
404:
$ref: "#/components/responses/NotFound"
default:
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ This reference uses `.` to denote the nesting of values.
If specified, the storage namespace will be filled with this default value as a prefix when creating a repository from the UI.
The user may still change it to something else.
* `blockstore.local.path` `(string: "~/lakefs/data")` - When using the local Block Adapter, which directory to store files in
* `blockstore.local.import_enabled` `(bool: false)` - Enable import for local Block Adapter, relevant only if you are using shared location
* `blockstore.local.import_hidden` `(bool: false)` - When enabled import will scan and import any file or folder that starts with a dot character.
* `blockstore.local.allowed_external_prefixes` `([]string: [])` - List of absolute path prefixes used to match any access for external location by the local block adapter (ex: /var/data/).
* `blockstore.gs.credentials_file` `(string : )` - If specified will be used as a file path of the JSON file that contains your Google service account key
* `blockstore.gs.credentials_json` `(string : )` - If specified will be used as JSON string that contains your Google service account key (when credentials_file is not set)
* `blockstore.gs.pre_signed_expiry` `(time duration : "15m")` - Expiry of pre-signed URL.
Expand Down
Loading

0 comments on commit 1aedf49

Please sign in to comment.