文件存储
自托管文档访问
本部分需要密码才能访问。 有兴趣自行托管?联系销售了解更多信息。
Self-Hosting Documentation Access Granted
文件存储是LlamaCloud不可或缺的组成部分。没有它,许多关键功能将无法实现。本页将逐步介绍如何为您的部署配置文件存储——需要创建哪些存储桶,以及对于非AWS部署,如何配置S3代理与这些存储桶进行交互。
- A valid blob storage service. We recommend the following:
- 由于LlamaCloud严重依赖文件存储,您需要创建以下存储桶:
llama-platform-parsed-documentsllama-platform-etlllama-platform-external-componentsllama-platform-file-parsingllama-platform-raw-filesllama-cloud-parse-outputllama-platform-file-screenshotsllama-platform-extract-output(用于LlamaExtract)
以下是配置连接到 AWS S3 的两种方式:
我们建议用户为LlamaCloud创建一个新的IAM角色和策略。然后您可以将角色ARN作为服务账户注解附加。
// Example IAM Policy{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:*"], // this is not secure "Resource": [ "arn:aws:s3:::llama-platform-parsed-documents", "arn:aws:s3:::llama-platform-parsed-documents/*", ... ] } ]}在创建类似于上述策略的内容后,使用EKS注解更新backend、jobsService、jobsWorker和llamaParse服务账户。
# Example for the backend service account. Repeat for each of the services listed above.backend: serviceAccountAnnotations: eks.amazonaws.com/role-arn: arn:aws:iam::<account-id>:role/<role-name>如需了解更多信息,请随时查阅关于此主题的官方AWS文档。
为上述S3存储桶创建一个附加策略的用户。之后,您可以通过在values.yaml文件中设置以下值来配置平台使用该用户的AWS凭据:
config: storageBuckets: provider: "aws" extraEnvVariables: AWS_REGION: us-east-1 AWS_DEFAULT_REGION: us-east-1 AWS_ACCESS_KEY_ID: <AWS-ACCESS-KEY> AWS_SECRET_ACCESS_KEY: <AWS-SECRET-KEY>我们允许用户在 values.yaml 文件中覆盖默认的存储桶名称。
config: storageBuckets: parsedDocuments: "<your-bucket-name>" parsedEtl: "<your-bucket-name>" parsedExternalComponents: "<your-bucket-name>" parsedFileParsing: "<your-bucket-name>" parsedRawFile: "<your-bucket-name>" parseOutput: "<your-bucket-name>" parsedFileScreenshot: "<your-bucket-name>" extractOutput: "<your-bucket-name>" parseFileUpload: "<your-bucket-name>" parseFileOutput: "<your-bucket-name>"使用S3Proxy连接至Azure Blob存储或其他服务提供商
Section titled “Connecting to Azure Blob Storage or Other Providers with S3Proxy”LlamaCloud最初是在AWS上开发的,这意味着我们一开始就原生支持S3。然而,为了实现自托管解决方案,我们需要让平台能够与其他服务提供商进行交互。
我们利用开源项目 S3Proxy 将 S3 API 请求转换为对其他存储提供商的请求。我们的 helm 图表中已开箱即用地支持 S3Proxy 的容器化部署。
S3代理功能可以启用(默认已启用),并可在您的values.yaml文件中进一步配置。以下是将您的LlamaCloud部署连接到Azure Blob Storage的示例。如需连接不同服务提供商的更多示例,请参阅项目的示例页面。
config: storageBuckets: s3proxy: config: # Example configuration for azure blob storage: S3PROXY_ENDPOINT: "http://0.0.0.0:80" S3PROXY_AUTHORIZATION: "none" S3PROXY_IGNORE_UNKNOWN_HEADERS: "true" S3PROXY_CORS_ALLOW_ORIGINS: "*" JCLOUDS_PROVIDER: "azureblob" JCLOUDS_REGION: "eastus" # Change to your region JCLOUDS_AZUREBLOB_AUTH: "azureKey" JCLOUDS_IDENTITY: "fill-out" # Change to your storage account name JCLOUDS_CREDENTIAL: "fill-out" # Change to your storage account key JCLOUDS_ENDPOINT: "fill-out" # Change to your storage account endpointconfig: storageBuckets: s3proxy: securityContext: runAsUser: 1000 runAsGroup: 1000 allowPrivilegeEscalation: false readOnlyRootFilesystem: true config: # Example configuration for azure blob storage: S3PROXY_ENDPOINT: "http://0.0.0.0:80" S3PROXY_AUTHORIZATION: "none" S3PROXY_IGNORE_UNKNOWN_HEADERS: "true" S3PROXY_CORS_ALLOW_ORIGINS: "*" JCLOUDS_PROVIDER: "azureblob" JCLOUDS_REGION: "eastus" # Change to your region JCLOUDS_AZUREBLOB_AUTH: "azureKey" JCLOUDS_IDENTITY: "fill-out" # Change to your storage account name JCLOUDS_CREDENTIAL: "fill-out" # Change to your storage account key JCLOUDS_ENDPOINT: "fill-out" # Change to your storage account endpoint