为您的 LangSmith 安装镜像映像
默认情况下,LangSmith 将从我们的公共 Docker 注册表拉取映像。但是,如果您在没有互联网访问的环境中运行 LangSmith,或者您想使用私有 Docker 注册表,您可以将映像镜像到您自己的注册表,然后配置您的 LangSmith 安装以使用这些映像。
要求
- 已认证访问您的 Kubernetes 集群/机器可访问的 Docker 注册表。
- 在您的本地机器或可访问 Docker 注册表的机器上安装 Docker。
- 一个 Kubernetes 集群或一台可以运行 LangSmith 的机器。
镜像映像
为了您的方便,我们提供了一个脚本,可以为您镜像映像。您可以在 LangSmith Helm Chart 存储库中找到该脚本。
要使用该脚本,您需要运行以下命令,指定您的注册表和平台
bash mirror_images.sh <your-registry> [<platform>]
其中 <your-registry>
是您的 Docker 注册表的 URL(例如 myregistry.com
),<platform>
是您正在使用的平台(例如 linux/amd64
, linux/arm64
等)。如果您未指定平台,则默认为 linux/amd64
。
例如,如果您的注册表是 myregistry.com
,您的平台是 linux/arm64
,并且您想使用最新版本的映像,您将运行
bash mirror_langsmith_images.sh --registry myregistry --platform linux/arm64 --version 0.10.66
请注意,此脚本假定您已安装 Docker 并且已向您的注册表进行身份验证。它还将映像推送到指定的注册表,并使用与原始映像相同的仓库/标签。
或者,您可以手动拉取、镜像和推送映像。您需要镜像的映像可在 LangSmith Helm Chart 的 values.yaml
文件中找到。您可以在此处找到它们:LangSmith Helm Chart values.yaml
以下是如何使用 Docker 镜像映像的示例
# Pull the images from the public registry
docker pull langchain/langsmith-backend:latest
docker tag langchain/langsmith-backend:latest <your-registry>/langsmith-backend:latest
docker push <your-registry>/langsmith-backend:latest
您需要为要镜像的每个映像重复此操作。
配置
映像镜像完成后,您需要配置您的 LangSmith 安装以使用镜像映像。您可以通过修改 LangSmith Helm Chart 安装的 values.yaml
文件或 Docker 安装的 .env
文件来完成此操作。将标签替换为您要使用的版本,例如撰写本文时的最新版本 0.10.66
。
<CodeTabs
tabs={[
HelmBlock(`
images:
imagePullSecrets: [] # Add your image pull secrets here if needed
registry: "" # Set this to your registry URL if you mirrored all images to the same registry using our script. Then you can remove the repository prefix from the images below.
aceBackendImage:
repository: "(your-registry)/langchain/langsmith-ace-backend"
pullPolicy: IfNotPresent
tag: "0.10.66"
backendImage:
repository: "(your-registry)/langchain/langsmith-backend"
pullPolicy: IfNotPresent
tag: "0.10.66"
frontendImage:
repository: "(your-registry)/langchain/langsmith-frontend"
pullPolicy: IfNotPresent
tag: "0.10.66"
hostBackendImage:
repository: "(your-registry)/langchain/hosted-langserve-backend"
pullPolicy: IfNotPresent
tag: "0.10.66"
operatorImage:
repository: "(your-registry)/langchain/langgraph-operator"
pullPolicy: IfNotPresent
tag: "6cc83a8"
platformBackendImage:
repository: "(your-registry)/langchain/langsmith-go-backend"
pullPolicy: IfNotPresent
tag: "0.10.66"
playgroundImage:
repository: "(your-registry)/langchain/langsmith-playground"
pullPolicy: IfNotPresent
tag: "0.10.66"
postgresImage:
repository: "(your-registry)/postgres"
pullPolicy: IfNotPresent
tag: "14.7"
redisImage:
repository: "(your-registry)/redis"
pullPolicy: IfNotPresent
tag: "7"
clickhouseImage:
repository: "(your-registry)/clickhouse/clickhouse-server"
pullPolicy: Always
tag: "24.8"
`),
DockerBlock(
`# In your .env file
_REGISTRY=your-registry # Set this to your registry URL if you mirrored all images to the same registry using our script. Otherwise you will need to manually set the repository for each image in the compose file.
`
),
]}
/>
Once configured, you will need to update your LangSmith installation. You can follow our upgrade guide here: [Upgrading LangSmith](../upgrades).
If your upgrade is successful, your LangSmith instance should now be using the mirrored images from your Docker registry.