-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add file tree and s3 tree docs (#54)
- Loading branch information
Showing
10 changed files
with
155 additions
and
8 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Using Config Files | ||
menuOrder: 3 | ||
menuOrder: 6 | ||
--- | ||
|
||
<script> | ||
|
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: Viewing Files | ||
menuOrder: 2 | ||
--- | ||
|
||
<script> | ||
import Key from "$lib/components/key.svelte" | ||
import file_tree from "$lib/assets/docs/file-tree.png" | ||
</script> | ||
|
||
Harlequin's Data Catalog optionally displays file trees for either local files or remote objects stored in Amazon S3 (or another object storage service that provides an S3-compatible API.) | ||
|
||
To view the file tree, use your mouse to select the "Files" tab, or focus on the Data Catalog with <Key>F6</Key> and then switch tabs with <Key>k</Key> or <Key>j</Key>. Insert file paths into the query editor with <Key>ctrl+enter</Key> or <Key>ctrl+j</Key>, or copy them to the clipboard with <Key>ctrl+c</Key>. | ||
|
||
<div class="flex flex-wrap justify-center py-2"> | ||
<figure> | ||
<img src={file_tree} alt="Example of the file tree." class="h-auto w-full max-h-80"> | ||
<figcaption class="text-center text-sm text-purple font-bold">Example of the file tree.</figcaption> | ||
</figure> | ||
</div> | ||
|
||
Keep reading for: | ||
|
||
1. [Local Files](local) | ||
2. [Remote Objects (S3)](remote) |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Local Files | ||
menuOrder: 3 | ||
--- | ||
|
||
Harlequin's Data Catalog will show remote files in a second tab in the Data Catalog if Harlequin is initialized with the `--show-files` option (alias `-f`). `--show-files` takes an absolute or relative file path to a directory as its argument: | ||
|
||
For example, an absolute path: | ||
|
||
```bash | ||
harlequin --show-files /path/to/my/data | ||
``` | ||
|
||
For the current working directory: | ||
|
||
```bash | ||
harlequin -f . | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
title: Remote Objects (S3) | ||
menuOrder: 4 | ||
--- | ||
|
||
## Installation | ||
|
||
Before viewing remote objects, you must install the `boto3` package in the same environment as Harlequin. You can do this by installing Harlequin with the `s3` extra: | ||
|
||
```bash | ||
pip install harlequin[s3] | ||
``` | ||
|
||
## Compatibility | ||
|
||
Harlequin works with any object storage system that provides an S3-compatible API, including Amazon S3, Google Cloud Storage, and Minio; basically, if you can query the storage with `boto3` and manage credentials with the AWS CLI, Harlequin can display your files. | ||
|
||
## Authentication | ||
|
||
Harlequin relies on the AWS CLI credential toolchain for authentication. Specifically, it will attempt to connect to your storage using whatever credentials are currently active (or default) in your AWS CLI config, **including the region**. You can use the credentials from another profile by setting the `AWS_PROFILE` environment variable. | ||
|
||
For Google Cloud Storage please see [the docs](https://cloud.google.com/storage/docs/authentication/hmackeys) on the XML API and HMAC authentication. After generating HMAC Keys, you can use the AWS CLI (`aws configure`) to store these keys in a profile accessible to Harlequin. | ||
|
||
Your user must have `ListObjects` or the equivalent permission to view a bucket's objects in Harlequin. | ||
|
||
Currently this is not configurable; if that doesn't work for you, please [open an issue](https://github.com/tconbeer/harlequin/issues/new/choose). | ||
|
||
## Usage | ||
|
||
Harlequin will display the remote tree if it is initialized with the `--show-s3` option (alias `--s3`). This option takes a reference to remote object storage. | ||
|
||
### Displaying All Buckets | ||
|
||
Use Harlequin with `--show-s3 all` to display all Amazon S3 buckets that the authenticated user has access to. (This is not advised if you have access to millions of objects in S3): | ||
|
||
```bash | ||
harlequin --show-s3 all | ||
``` | ||
|
||
For GCS or another endpoint that supports `ListBuckets`, provide the endpoint url without a path: | ||
|
||
```bash | ||
harlequin --show-s3 "https://storage.googleapis.com" | ||
``` | ||
|
||
### Displaying a Single Bucket | ||
|
||
Use `--show-s3` with an argument that represents a bucket and (optionally) an endpoint url and key prefix: | ||
|
||
```bash | ||
harlequin --show-s3 my-bucket | ||
``` | ||
|
||
```bash | ||
harlequin --show-s3 my-bucket/my-prefix | ||
``` | ||
|
||
A one-liner to set the AWS Profile and connect to a GCS bucket, filtering for a prefix: | ||
|
||
```bash | ||
AWS_PROFILE=gcs harlequin --s3 "https://storage.googleapis.com/my-gcs-bucket/my-prefix" | ||
``` | ||
|
||
Harlequin takes any of the following formats: | ||
|
||
``` | ||
# Amazon S3 Formats | ||
all | ||
my-bucket | ||
my-bucket/my-prefix | ||
s3://my-bucket | ||
s3://my-bucket/my-prefix | ||
https://s3.amazonaws.com/my-bucket | ||
https://s3.amazonaws.com/my-bucket/my-prefix | ||
https://my-bucket.s3.amazonaws.com | ||
https://my-bucket.s3.amazonaws.com/my-prefix | ||
# Google Cloud Storage Formats | ||
https://storage.googleapis.com | ||
https://storage.googleapis.com/my-bucket | ||
https://storage.googleapis.com/my-bucket/my-prefix | ||
https://my-bucket.storage.googleapis.com | ||
https://my-bucket.storage.googleapis.com/my-prefix | ||
# Minio, AWS PrivateLink, etc. | ||
https://my-storage.com/my-bucket/ | ||
https://my-storage.com/my-bucket/my-prefix | ||
``` |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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