-
Notifications
You must be signed in to change notification settings - Fork 724
fs: adding SDKs #23957
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
Open
guangleibao
wants to merge
7
commits into
release-8.5
Choose a base branch
from
release-8.5-doc-updates
base: release-8.5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fs: adding SDKs #23957
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d7a7f6d
fs: adding SDKs
guangleibao 5ea1c75
add: Manage TiDB Cloud Filesystem Limits
guangleibao 24f3ed4
add: Billing and Pricing
guangleibao ff3523f
Merge branch 'release-8.5' into release-8.5-doc-updates
qiancai a29f00f
Apply suggestion from @qiancai
guangleibao 630ffcd
Apply suggestion from @qiancai
guangleibao f75a3c6
add instructions about console operations
qiancai 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 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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| title: Get Started with TiDB Cloud Filesystem via Console | ||
| summary: Create a file system in the TiDB Cloud console, connect to it from your computer, write a test file, and view the file in the console. | ||
| --- | ||
|
|
||
| # Get Started with TiDB Cloud Filesystem via Console | ||
|
|
||
| Create a file system in the [TiDB Cloud console](https://tidbcloud.com/), mount it on a macOS or Linux computer, write a test file, and view its metadata in the console. | ||
|
|
||
| > **Note:** | ||
| > | ||
| > TiDB Cloud Filesystem is currently in public preview. Its features and interfaces are subject to change without notice. | ||
|
|
||
| ## Step 1. Create a file system | ||
|
|
||
| 1. If you do not have a TiDB Cloud account, [sign up for one](https://tidbcloud.com/free-trial). | ||
| 2. Log in to the [TiDB Cloud console](https://tidbcloud.com/) with your TiDB Cloud account. | ||
| 3. In the left navigation pane, select your organization and click **File Systems**. | ||
| 4. In the upper-right corner, click **Create File System**. | ||
| 5. On the **Create File System** page, enter a file system name, and select a cloud provider and region. Review the usage limits in the summary. | ||
|
|
||
| > **Tip:** | ||
| > | ||
| > For organizations without a credit card, the file system limits are fixed. To edit the usage limit, add a credit card to your organization. For more information, see [Manage TiDB Cloud Filesystem Usage Limit](/tidb-cloud-filesystem/manage-filesystem-limits.md). | ||
|
|
||
| 6. Click **Create**. When the **Your File System is Ready!** dialog appears, keep the dialog open for the next step. | ||
|
|
||
| ## Step 2. Mount the file system | ||
|
|
||
| On macOS or Linux, follow the steps in the **Your File System is Ready!** dialog to install TiDB Cloud CLI and mount the file system. On Windows, follow [Quick Start via CLI](/tidb-cloud-filesystem/filesystem-quick-start.md) to work with files without a mount. | ||
|
|
||
| 1. Install the TiDB Cloud CLI `ti`. | ||
|
|
||
| ```bash | ||
| curl -fsSL https://github.com/tidbcloud/ti-cli/releases/latest/download/install.sh | sh | ||
| ``` | ||
|
|
||
| 2. Copy and run the command under **Mount Your File System** in the same shell. The command adds `ti` to `PATH`, sets `TI_FS_TOKEN`, creates `~/tidbcloudfs`, and mounts the file system there. | ||
|
|
||
| > **Note:** | ||
| > | ||
| > - The mount command includes the [default owner token](/tidb-cloud-filesystem/filesystem-authorization.md#owner-tokens) in `TI_FS_TOKEN`. This token grants full access to the file system and is displayed only once. Save it securely. Do not put the command or token in logs, issues, chat messages, or source control. | ||
| > - On Linux, mounting requires `fuse3` and access to `/dev/fuse`. If needed, follow [Install FUSE userspace tools](/tidb-cloud-filesystem/filesystem-mount-linux.md#install-fuse-userspace-tools) before running the mount command. | ||
|
|
||
| 3. Copy and run the command under **Start Using It** to list the mounted directory. | ||
| 4. Click **Done** to open the file system overview. | ||
|
|
||
| You can click **Connect** on the overview page to reopen the connection guidance, but you cannot retrieve the default owner token later. | ||
|
|
||
| ## Step 3. Write and view a file | ||
|
|
||
| After mounting the file system, use the mounted directory to write and read a test file. | ||
|
|
||
| Write a file in the mounted directory: | ||
|
|
||
| ```bash | ||
| echo 'Hello from TiDB Cloud Filesystem' > ~/tidbcloudfs/hello.txt | ||
| cat ~/tidbcloudfs/hello.txt | ||
| ``` | ||
|
|
||
| In the left navigation pane of the file system, click **Files**. The root directory lists `hello.txt`. You can search for the file or click its name to view its metadata. The console displays file information, but reading file contents and changing files require the TiDB Cloud CLI `ti` or a mount. | ||
|
|
||
| ## (Optional) Step 4. Unmount the file system | ||
|
|
||
| If you do not need to access the file system from the mounted directory, you can unmount it: | ||
|
|
||
| ```bash | ||
| ti fs unmount-file-system --mount-path ~/tidbcloudfs | ||
| ``` | ||
|
|
||
| On Linux, FUSE can buffer writes locally until a successful unmount. If unmounting fails, follow [Finish safely](/tidb-cloud-filesystem/filesystem-mount.md#finish-safely) before leaving the machine or removing its local cache. | ||
|
|
||
| ## What's next | ||
|
|
||
| - [Manage File Systems](/tidb-cloud-filesystem/manage-filesystem-resources.md) to inspect, rename, or delete a file system. | ||
| - [Manage File System Tokens](/tidb-cloud-filesystem/manage-filesystem-tokens.md) to create tokens with limited access. | ||
| - [Quick Start via CLI](/tidb-cloud-filesystem/filesystem-quick-start.md) for a CLI-only creation workflow. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| title: SDKs | ||
| summary: Learn how TiDB Cloud Filesystem relates to the Drive9 workspace engine and find client SDK documentation for six programming languages. | ||
| --- | ||
|
|
||
| # SDKs | ||
|
|
||
| TiDB Cloud Filesystem uses the Drive9 workspace engine to run file system operations. TiDB Cloud Filesystem is PingCAP's official hosted Drive9 service on TiDB Cloud. Drive9 is an open-source, community-based project owned by PingCAP, and TiDB Cloud Filesystem is its managed cloud service. At the API and SDK layers, you directly invoke the drive9 endpoints exposed by TiDB Cloud Filesystem service. | ||
|
|
||
| Drive9 is an open-source project (Apache 2.0) maintained in the [mem9-ai/drive9 repository](https://github.com/mem9-ai/drive9). Besides the workspace engine, that repository publishes client SDKs for several programming languages. The SDKs and their documentation are maintained there, so the guides listed on this page are the source of truth for SDK installation, configuration, and API details. | ||
|
|
||
| The SDK guides describe how a client connects to a Drive9 server, including how to provide the server URL and an API key. | ||
|
|
||
| The API Keys mentioned in Drive9 SDK/API documentations. | ||
|
|
||
| |TiDB Cloud Filesystem Object|Drive9 SDK/API Usage| | ||
| |:--|:--| | ||
| |TiDB Cloud API Key|File system control plane actions| | ||
| |File System Token|File system data plane actions| | ||
|
|
||
| Available server URL for Drive9 SDK/API server URL to TiDB Cloud Filesystem regions. | ||
|
|
||
| | TiDB Cloud Filesystem Region| Server URL for Drive9 SDK/API | API Key| | ||
| |:--|:--|:--| | ||
| |`aws-us-east-1`|`https://aws-us-east-1.drive9.ai`| FS token| | ||
| |`aws-us-west-2`|`https://aws-us-west-2.drive9.ai`| FS token| | ||
| |`aws-ap-southeast-1`|`https://aws-ap-southeast-1.drive9.ai`| FS token| | ||
| |`gcp-us-east1`|`https://gcp-us-east-1.drive9.ai`| FS token| | ||
| |`azure-centralus`|`https://azure-centralus.drive9.ai`|FS token| | ||
| |`alicloud-ap-southeast-1`|`https://alicloud-ap-southeast-1.drive9.ai`|FS token| | ||
|
|
||
| ## Available SDKs | ||
|
|
||
| | Language | Repository location | Documentation | | ||
| | --- | --- | --- | | ||
| | TypeScript | `clients/drive9-js` | [TypeScript SDK integration guide](https://github.com/mem9-ai/drive9/blob/main/docs/guides/typescript-sdk-integration.md) | | ||
| | Go | `pkg/client` | [Go SDK integration guide](https://github.com/mem9-ai/drive9/blob/main/docs/guides/go-sdk-integration.md) | | ||
| | Python | `clients/drive9-py` | [drive9-py README](https://github.com/mem9-ai/drive9/blob/main/clients/drive9-py/README.md) | | ||
| | Rust | `clients/drive9-rs` | [drive9-rs README](https://github.com/mem9-ai/drive9/blob/main/clients/drive9-rs/README.md) | | ||
| | Kotlin | `clients/drive9-kotlin` | [drive9-kotlin README](https://github.com/mem9-ai/drive9/blob/main/clients/drive9-kotlin/README.md) | | ||
| | Swift | `clients/drive9-swift` | [drive9-swift README](https://github.com/mem9-ai/drive9/blob/main/clients/drive9-swift/README.md) | | ||
|
|
||
| The SDKs are developed and released with the Drive9 project, so they can move ahead of the TiDB Cloud Filesystem service. Before you adopt an SDK for a TiDB Cloud Filesystem workload, check its documentation for the current server endpoint, credentials, and supported operations. | ||
|
|
||
| ## What's next | ||
|
|
||
| - [TiDB Cloud CLI (`ti`)](/ai/ti/ti-quick-start.md) to install, configure, and update the CLI. | ||
| - [Work with Files and Directories](/tidb-cloud-filesystem/work-with-filesystem-data.md) to manage file system data from the command line. | ||
| - [Automation and AI Agent Workflows](/tidb-cloud-filesystem/use-filesystem-for-automation-and-ai-agents.md) to use a file system in automated workflows. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| title: Manage TiDB Cloud Filesystem Usage Limit | ||
| summary: Learn how to view file system usage and free limits in the TiDB Cloud console, and edit usage limits after adding a credit card. | ||
| --- | ||
|
|
||
| # Manage TiDB Cloud Filesystem Usage Limit | ||
|
|
||
| > **Note:** | ||
| > | ||
| > The limits in [Limits without a credit card on the organization](#limits-without-a-credit-card-on-the-organization) apply only when your TiDB Cloud organization has no credit card. | ||
|
|
||
| You can create and use file systems in the TiDB Cloud Filesystem service without a credit card, but each free file system has tighter capacity limits. You can raise these limits after adding a credit card to your organization. | ||
|
|
||
| ## Limits without a credit card on the organization | ||
|
|
||
| When your organization has **no credit card registered**, the following limits apply to each free file system: | ||
|
|
||
| - One file system per region | ||
| - 2,000 files per file system | ||
| - 2 GB of storage per file system | ||
| - 500 MB maximum size for a single file | ||
|
|
||
| With a credit card, you can set higher limits and continue with pay-as-you-go usage. See [TiDB Cloud Filesystem pricing](https://www.pingcap.com/tidb-cloud-filesystem-pricing-details/) for billing details. | ||
|
|
||
| ## View file system usage | ||
|
|
||
| To view the current usage of a file system, go to its overview page in the [TiDB Cloud console](https://tidbcloud.com/) and check the **Usage** area. For usage details, click **Usage** in the left navigation pane. | ||
|
|
||
| ## When a file system reaches a limit | ||
|
|
||
| When a file system reaches a limit, existing files remain readable, but the file system stops accepting new writes. The TiDB Cloud console shows a warning. | ||
|
|
||
| ## Update the usage limit | ||
|
|
||
| 1. In the TiDB Cloud console, navigate to the [**File Systems**](https://tidbcloud.com/filesystems) page, select the **Cloud Provider** and **Region** for the file system, and click the name of your target file system. | ||
| 2. On the overview page of the file system, click **Edit Usage Limit** in the **Usage** area. | ||
| 3. Set maximum storage, file count, and file size as needed, then click **Save**. | ||
|
|
||
| If your organization has no credit card, these fields are disabled. Add a credit card to edit them and enable pay-as-you-go usage. |
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Remove the unsupported region entries.
Line 28 and Line 29 list
gcp-us-east1andazure-centralusas TiDB Cloud Filesystem regions. The current Filesystem regions guide lists only AWSus-east-1, AWSus-west-2, AWSap-southeast-1, and Alibaba Cloud Singapore. It does not list GCP or Azure. (docs.pingcap.com)Remove the unsupported region entries
📝 Committable suggestion
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.
The GPC line should be
|
gcp-us-east1|https://gcp-us-east1.drive9.ai| FS token|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.
@guangleibao, thanks for clarifying. My request to remove the GCP row was incorrect. Keep the row with this endpoint:Does TiDB Cloud Filesystem also support
azure-centralus? That part of the finding remains open.✏️ Learnings added
You are interacting with an AI system.
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.
@qiancai FYI