langgraph-cli 0.4.34__tar.gz → 0.4.36__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/PKG-INFO +1 -1
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/yarn.lock +5 -5
- langgraph_cli-0.4.36/langgraph_cli/__init__.py +1 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/deploy.py +163 -54
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/host_backend.py +3 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/cli/test_deploy_command.py +231 -4
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_deploy_helpers.py +125 -14
- langgraph_cli-0.4.34/langgraph_cli/__init__.py +0 -1
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/.gitignore +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/LICENSE +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/Makefile +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/README.md +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/.env.example +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/.gitignore +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/Makefile +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs/agent.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs_fail/agent.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs_fail/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graph_prerelease_reqs_fail/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs/agent.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs/storm.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/graphs_submod/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/graphs_submod/agent.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/graphs_submod/subprompt.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/hello.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/prompt.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_a/requirements.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/graphs_submod/agent.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/graphs_submod/subprompt.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/hello.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/prompt.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/requirements.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/utils/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/graphs_reqs_b/utils/greeter.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/my_app.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/pipconf.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/examples/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/generate_schema.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/.dockerignore +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/.editorconfig +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/.env.example +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/.eslintrc.cjs +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/.gitignore +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/LICENSE +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/README.md +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/jest.config.js +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/package.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/src/agent/graph.ts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/src/agent/state.ts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/static/studio.png +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/tests/agent.test.ts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/tests/graph.int.test.ts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-examples/tsconfig.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/.eslintrc.cjs +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/apps/agent/package.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/apps/agent/src/graph.ts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/apps/agent/src/state.ts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/apps/agent/tsconfig.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/libs/shared/package.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/libs/shared/src/index.ts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/libs/shared/tsconfig.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/package.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/tsconfig.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/turbo.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/js-monorepo-example/yarn.lock +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/__main__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/_ignore.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/analytics.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/archive.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/cli.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/config.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/constants.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/dependency_tracking.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/docker.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/exec.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/image_reference.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/progress.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/py.typed +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/schemas.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/templates.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/util.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/uv_lock.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/langgraph_cli/version.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/apps/agent/.env.example +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/apps/agent/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/apps/agent/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/apps/agent/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/apps/agent/src/agent/state.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/libs/common/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/libs/common/helpers.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/libs/shared/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/libs/shared/src/shared/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/libs/shared/src/shared/utils.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/python-monorepo-example/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/schemas/schema.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/schemas/schema.v0.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/schemas/version.schema.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/integration_tests/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/integration_tests/test_cli.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/agent.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/cli/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/cli/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/cli/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/cli/test_cli.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/cli/test_templates.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/conftest.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/graphs/agent.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/helpers.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/multiplatform/js.mts +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/multiplatform/python.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/pipconfig.txt +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_archive.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_config.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_config.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_dependency_tracking.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_deploy_agents.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_docker.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_host_backend.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_image_reference.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_logs_helpers.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/tests/unit_tests/test_util.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/apps/agent/.env.example +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/apps/agent/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/apps/agent/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/apps/agent/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/libs/shared/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/libs/shared/src/shared/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/libs/shared/src/shared/utils.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/monorepo/uv.lock +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/simple/.env.example +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/simple/langgraph.json +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/simple/pyproject.toml +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/simple/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/simple/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv-examples/simple/uv.lock +0 -0
- {langgraph_cli-0.4.34 → langgraph_cli-0.4.36}/uv.lock +0 -0
|
@@ -2829,11 +2829,11 @@ graceful-fs@^4.2.11:
|
|
|
2829
2829
|
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
|
|
2830
2830
|
|
|
2831
2831
|
handlebars@^4.7.9:
|
|
2832
|
-
version "4.7.
|
|
2833
|
-
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.
|
|
2834
|
-
integrity sha512-
|
|
2832
|
+
version "4.7.10"
|
|
2833
|
+
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.10.tgz#12419ea1b41391b3ffcf003f2164dcbce090c417"
|
|
2834
|
+
integrity sha512-P5VJMVM7qgBn6vjXMw8WG9uVI+ncf2pi72j4de4yz5ZULLj2RGqLYaKOYGsgyrViQ0tePOVlN1tDCCXXtFqXKg==
|
|
2835
2835
|
dependencies:
|
|
2836
|
-
minimist "^1.2.
|
|
2836
|
+
minimist "^1.2.8"
|
|
2837
2837
|
neo-async "^2.6.2"
|
|
2838
2838
|
source-map "^0.6.1"
|
|
2839
2839
|
wordwrap "^1.0.0"
|
|
@@ -3920,7 +3920,7 @@ minimatch@^9.0.4:
|
|
|
3920
3920
|
dependencies:
|
|
3921
3921
|
brace-expansion "^2.0.2"
|
|
3922
3922
|
|
|
3923
|
-
minimist@^1.2.0, minimist@^1.2.
|
|
3923
|
+
minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8:
|
|
3924
3924
|
version "1.2.8"
|
|
3925
3925
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
|
|
3926
3926
|
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.36"
|
|
@@ -231,15 +231,6 @@ class RequestedPlacement:
|
|
|
231
231
|
def requested(self) -> bool:
|
|
232
232
|
return self.listener_id is not None or self.k8s_namespace is not None
|
|
233
233
|
|
|
234
|
-
def ensure_not_requested(self, deployment_id: str) -> None:
|
|
235
|
-
if self.requested:
|
|
236
|
-
raise click.UsageError(
|
|
237
|
-
"Listener and namespace are fixed when a deployment is created. "
|
|
238
|
-
f"Deployment {deployment_id} already exists, so drop --listener-id "
|
|
239
|
-
"and --k8s-namespace, or create a new deployment with a different "
|
|
240
|
-
"--name."
|
|
241
|
-
)
|
|
242
|
-
|
|
243
234
|
def on(self, listener: Listener) -> Placement:
|
|
244
235
|
return OnListener(listener.id, self._namespace(listener))
|
|
245
236
|
|
|
@@ -1055,15 +1046,28 @@ def _print_deployment_result(
|
|
|
1055
1046
|
# ---------------------------------------------------------------------------
|
|
1056
1047
|
|
|
1057
1048
|
|
|
1049
|
+
def _strip_url_scheme(url: str) -> str:
|
|
1050
|
+
"""Return a registry reference without a trailing slash or URL scheme."""
|
|
1051
|
+
reference = url.rstrip("/")
|
|
1052
|
+
if "://" in reference:
|
|
1053
|
+
reference = reference.split("//", 1)[1]
|
|
1054
|
+
return reference
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
# Artifact Registry's username for access tokens. Control planes whose registry
|
|
1058
|
+
# needs another one return it as `username`.
|
|
1059
|
+
_DEFAULT_REGISTRY_USERNAME = "oauth2accesstoken"
|
|
1060
|
+
|
|
1061
|
+
|
|
1058
1062
|
@contextmanager
|
|
1059
|
-
def _docker_config_for_token(registry_host: str, token: str):
|
|
1063
|
+
def _docker_config_for_token(registry_host: str, token: str, username: str):
|
|
1060
1064
|
"""Create a temporary Docker config with only the push token.
|
|
1061
1065
|
|
|
1062
1066
|
Yields the path to a temporary config directory that can be passed
|
|
1063
1067
|
to `docker --config <path>` so that system credential helpers
|
|
1064
1068
|
(e.g. gcloud) don't interfere with the push token.
|
|
1065
1069
|
"""
|
|
1066
|
-
auth_b64 = base64.b64encode(f"
|
|
1070
|
+
auth_b64 = base64.b64encode(f"{username}:{token}".encode()).decode()
|
|
1067
1071
|
config_data = {"auths": {registry_host: {"auth": auth_b64}}}
|
|
1068
1072
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
1069
1073
|
with open(os.path.join(tmpdir, "config.json"), "w") as f:
|
|
@@ -1201,10 +1205,37 @@ class DockerBuildCommand:
|
|
|
1201
1205
|
return cls(("docker", "build"), ())
|
|
1202
1206
|
flags: tuple[str, ...] = ("--platform", _DEPLOYMENT_PLATFORM, "--load")
|
|
1203
1207
|
if not verbose:
|
|
1204
|
-
flags += ("--progress=
|
|
1208
|
+
flags += ("--progress=plain",)
|
|
1205
1209
|
return cls(("docker", "buildx", "build"), flags)
|
|
1206
1210
|
|
|
1207
1211
|
|
|
1212
|
+
def _active_docker_host(runner: CommandRunner) -> str | None:
|
|
1213
|
+
"""Return the daemon endpoint of the user's active Docker context.
|
|
1214
|
+
|
|
1215
|
+
None when `DOCKER_HOST` is set, which Docker honors with any config
|
|
1216
|
+
directory. Also None when the lookup fails (for example, `DOCKER_CONTEXT`
|
|
1217
|
+
names a context that doesn't exist) or the context has no Docker endpoint
|
|
1218
|
+
(Docker prints `<no value>`); that keeps Docker's own default in place.
|
|
1219
|
+
"""
|
|
1220
|
+
if os.environ.get("DOCKER_HOST"):
|
|
1221
|
+
return None
|
|
1222
|
+
try:
|
|
1223
|
+
stdout, _ = runner.run(
|
|
1224
|
+
subp_exec(
|
|
1225
|
+
"docker",
|
|
1226
|
+
"context",
|
|
1227
|
+
"inspect",
|
|
1228
|
+
"--format",
|
|
1229
|
+
"{{.Endpoints.docker.Host}}",
|
|
1230
|
+
collect=True,
|
|
1231
|
+
)
|
|
1232
|
+
)
|
|
1233
|
+
except (click.exceptions.Exit, OSError):
|
|
1234
|
+
return None
|
|
1235
|
+
host = (stdout or "").strip()
|
|
1236
|
+
return host if "://" in host else None
|
|
1237
|
+
|
|
1238
|
+
|
|
1208
1239
|
def _docker_argv(docker_config_dir: str | None) -> tuple[str, ...]:
|
|
1209
1240
|
if docker_config_dir is None:
|
|
1210
1241
|
return ("docker",)
|
|
@@ -1238,17 +1269,13 @@ def _push_image(
|
|
|
1238
1269
|
runner: CommandRunner,
|
|
1239
1270
|
image: str,
|
|
1240
1271
|
*,
|
|
1241
|
-
|
|
1272
|
+
docker: tuple[str, ...],
|
|
1242
1273
|
verbose: bool,
|
|
1243
1274
|
) -> None:
|
|
1244
1275
|
for attempt in range(1, _PUSH_ATTEMPTS + 1):
|
|
1245
1276
|
try:
|
|
1246
1277
|
with Progress(message="Pushing...", elapsed=not verbose):
|
|
1247
|
-
runner.run(
|
|
1248
|
-
subp_exec(
|
|
1249
|
-
*_docker_argv(docker_config_dir), "push", image, verbose=verbose
|
|
1250
|
-
)
|
|
1251
|
-
)
|
|
1278
|
+
runner.run(subp_exec(*docker, "push", image, verbose=verbose))
|
|
1252
1279
|
return
|
|
1253
1280
|
except click.exceptions.Exit:
|
|
1254
1281
|
if attempt == _PUSH_ATTEMPTS:
|
|
@@ -1317,21 +1344,27 @@ def _run_local_build(
|
|
|
1317
1344
|
raise click.ClickException(
|
|
1318
1345
|
"Push token response missing token or registry_url"
|
|
1319
1346
|
)
|
|
1347
|
+
username = push_data.get("username") or _DEFAULT_REGISTRY_USERNAME
|
|
1320
1348
|
step += 1
|
|
1321
1349
|
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1350
|
+
if push_data.get("repository_url"):
|
|
1351
|
+
# The control plane chose the exact repository (an ECR repository
|
|
1352
|
+
# is a single image name, so nothing may be appended to it).
|
|
1353
|
+
repository = _strip_url_scheme(push_data["repository_url"])
|
|
1354
|
+
else:
|
|
1355
|
+
repo_seed = image_name or name or spec.config.parent.name
|
|
1356
|
+
repository = (
|
|
1357
|
+
f"{_strip_url_scheme(registry_url)}/{normalize_name(repo_seed)}"
|
|
1330
1358
|
)
|
|
1331
|
-
)
|
|
1332
|
-
registry_host =
|
|
1333
|
-
|
|
1334
|
-
with _docker_config_for_token(registry_host, deployment_token) as cfg:
|
|
1359
|
+
remote_image = str(ImageReference(repository, tag))
|
|
1360
|
+
registry_host = repository.split("/")[0]
|
|
1361
|
+
|
|
1362
|
+
with _docker_config_for_token(registry_host, deployment_token, username) as cfg:
|
|
1363
|
+
# A config directory has no current context, so Docker would fall
|
|
1364
|
+
# back to /var/run/docker.sock; keep using the daemon the build used.
|
|
1365
|
+
docker_host = _active_docker_host(runner)
|
|
1366
|
+
host_args = ("--host", docker_host) if docker_host else ()
|
|
1367
|
+
docker = (*_docker_argv(cfg), *host_args)
|
|
1335
1368
|
_log_deploy_step(step, f"Logging into {registry_host}")
|
|
1336
1369
|
token_input = (
|
|
1337
1370
|
deployment_token
|
|
@@ -1340,10 +1373,10 @@ def _run_local_build(
|
|
|
1340
1373
|
)
|
|
1341
1374
|
runner.run(
|
|
1342
1375
|
subp_exec(
|
|
1343
|
-
*
|
|
1376
|
+
*docker,
|
|
1344
1377
|
"login",
|
|
1345
1378
|
"-u",
|
|
1346
|
-
|
|
1379
|
+
username,
|
|
1347
1380
|
"--password-stdin",
|
|
1348
1381
|
registry_host,
|
|
1349
1382
|
input=token_input,
|
|
@@ -1356,7 +1389,7 @@ def _run_local_build(
|
|
|
1356
1389
|
runner.run(
|
|
1357
1390
|
subp_exec("docker", "tag", image_to_push, remote_image, verbose=verbose)
|
|
1358
1391
|
)
|
|
1359
|
-
_push_image(runner, remote_image,
|
|
1392
|
+
_push_image(runner, remote_image, docker=docker, verbose=verbose)
|
|
1360
1393
|
step += 1
|
|
1361
1394
|
|
|
1362
1395
|
resolved_image = _resolve_pushed_image_digest(
|
|
@@ -1647,10 +1680,72 @@ class PublishedImage:
|
|
|
1647
1680
|
ImageSource = BuildAndPush | PublishedImage
|
|
1648
1681
|
|
|
1649
1682
|
|
|
1683
|
+
def _resource_spec(image_pull_secrets: tuple[str, ...]) -> Mapping[str, object]:
|
|
1684
|
+
if not image_pull_secrets:
|
|
1685
|
+
return _OPERATOR_DEFAULT_RESOURCE_SPEC
|
|
1686
|
+
return {
|
|
1687
|
+
"image_pull_secrets": [{"name": name} for name in image_pull_secrets],
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
# Mirrors the control plane's own LocalObjectReference.name validation (a
|
|
1692
|
+
# Kubernetes DNS subdomain), so a bad secret name is rejected here instead of
|
|
1693
|
+
# after a build and push.
|
|
1694
|
+
_K8S_SECRET_NAME_RE = re.compile(
|
|
1695
|
+
r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
|
|
1696
|
+
)
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
@dataclass(frozen=True, slots=True)
|
|
1700
|
+
class CreateOnlySettings:
|
|
1701
|
+
"""Options for an external-image deployment that only apply when
|
|
1702
|
+
creating one, never when updating an existing deployment."""
|
|
1703
|
+
|
|
1704
|
+
placement: RequestedPlacement
|
|
1705
|
+
image_pull_secrets: tuple[str, ...] = ()
|
|
1706
|
+
|
|
1707
|
+
def __post_init__(self) -> None:
|
|
1708
|
+
for name in self.image_pull_secrets:
|
|
1709
|
+
if len(name) > 253 or not _K8S_SECRET_NAME_RE.match(name):
|
|
1710
|
+
raise click.UsageError(
|
|
1711
|
+
f"--image-pull-secret {name!r} is not a valid Kubernetes "
|
|
1712
|
+
"secret name (lowercase alphanumeric characters, '-', or "
|
|
1713
|
+
"'.' only, max 253 characters)."
|
|
1714
|
+
)
|
|
1715
|
+
|
|
1716
|
+
@property
|
|
1717
|
+
def requested(self) -> bool:
|
|
1718
|
+
return self.placement.requested or bool(self.image_pull_secrets)
|
|
1719
|
+
|
|
1720
|
+
def ensure_creatable(self, push_to: str | None, image_uri: str | None) -> None:
|
|
1721
|
+
if push_to is None and image_uri is None and self.requested:
|
|
1722
|
+
raise click.UsageError(
|
|
1723
|
+
"--listener-id, --k8s-namespace, and --image-pull-secret only "
|
|
1724
|
+
"apply when creating a deployment with --push-to or --image-uri."
|
|
1725
|
+
)
|
|
1726
|
+
|
|
1727
|
+
def ensure_not_existing(self, deployment_id: str) -> None:
|
|
1728
|
+
if self.placement.requested:
|
|
1729
|
+
raise click.UsageError(
|
|
1730
|
+
"Listener and namespace are fixed when a deployment is "
|
|
1731
|
+
f"created. Deployment {deployment_id} already exists, so "
|
|
1732
|
+
"drop --listener-id and --k8s-namespace, or create a new "
|
|
1733
|
+
"deployment with a different --name."
|
|
1734
|
+
)
|
|
1735
|
+
if self.image_pull_secrets:
|
|
1736
|
+
raise click.UsageError(
|
|
1737
|
+
"langgraph deploy does not update image pull secrets on an "
|
|
1738
|
+
f"existing deployment. Deployment {deployment_id} already "
|
|
1739
|
+
"exists, so drop --image-pull-secret and update resource_spec "
|
|
1740
|
+
"through the API or the LangSmith UI instead, or create a "
|
|
1741
|
+
"new deployment with a different --name."
|
|
1742
|
+
)
|
|
1743
|
+
|
|
1744
|
+
|
|
1650
1745
|
@dataclass(frozen=True, slots=True)
|
|
1651
1746
|
class CustomerRegistrySource:
|
|
1652
1747
|
image: ImageSource
|
|
1653
|
-
|
|
1748
|
+
create_only: CreateOnlySettings
|
|
1654
1749
|
|
|
1655
1750
|
def run(self, ctx: DeployContext) -> DeployOutcome:
|
|
1656
1751
|
if isinstance(ctx.selector, ById):
|
|
@@ -1672,7 +1767,7 @@ class CustomerRegistrySource:
|
|
|
1672
1767
|
self, ctx: DeployContext, existing: ExistingDeployment, step: int
|
|
1673
1768
|
) -> DeployOutcome:
|
|
1674
1769
|
_ensure_customer_registry_source(existing)
|
|
1675
|
-
self.
|
|
1770
|
+
self.create_only.ensure_not_existing(existing.id)
|
|
1676
1771
|
image_uri, step = self._publish(ctx, step)
|
|
1677
1772
|
_log_deploy_step(step, f"Updating deployment {existing.id}")
|
|
1678
1773
|
updated = ctx.client.update_deployment(
|
|
@@ -1687,7 +1782,7 @@ class CustomerRegistrySource:
|
|
|
1687
1782
|
)
|
|
1688
1783
|
|
|
1689
1784
|
def _resolve_placement(self, ctx: DeployContext) -> Placement:
|
|
1690
|
-
requested = self.
|
|
1785
|
+
requested = self.create_only.placement
|
|
1691
1786
|
if requested.listener_id is not None:
|
|
1692
1787
|
return requested.on(_requested_listener(ctx.client, requested.listener_id))
|
|
1693
1788
|
if not (ctx.endpoints.is_cloud or requested.requested):
|
|
@@ -1716,7 +1811,9 @@ class CustomerRegistrySource:
|
|
|
1716
1811
|
else None,
|
|
1717
1812
|
source=_CUSTOMER_REGISTRY_SOURCE,
|
|
1718
1813
|
source_config={
|
|
1719
|
-
"resource_spec":
|
|
1814
|
+
"resource_spec": _resource_spec(
|
|
1815
|
+
self.create_only.image_pull_secrets
|
|
1816
|
+
),
|
|
1720
1817
|
**placement.source_config(),
|
|
1721
1818
|
},
|
|
1722
1819
|
source_revision_config={"image_uri": image_uri},
|
|
@@ -1757,7 +1854,7 @@ class CustomerRegistrySource:
|
|
|
1757
1854
|
_build_image(runner, ctx.spec, image, verbose=ctx.verbose)
|
|
1758
1855
|
step += 1
|
|
1759
1856
|
_log_deploy_step(step, f"Pushing image {image}")
|
|
1760
|
-
_push_image(runner, image,
|
|
1857
|
+
_push_image(runner, image, docker=_docker_argv(None), verbose=ctx.verbose)
|
|
1761
1858
|
step += 1
|
|
1762
1859
|
digest = _resolve_pushed_image_digest(
|
|
1763
1860
|
runner, remote_image=image, docker_config_dir=None, verbose=ctx.verbose
|
|
@@ -1810,19 +1907,13 @@ def _select_source(
|
|
|
1810
1907
|
tag: str | None,
|
|
1811
1908
|
remote_build_flag: bool | None,
|
|
1812
1909
|
placement: RequestedPlacement,
|
|
1910
|
+
image_pull_secrets: tuple[str, ...],
|
|
1813
1911
|
selector: DeploymentSelector,
|
|
1814
1912
|
) -> DeploymentSource:
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
)
|
|
1820
|
-
if placement.requested and isinstance(selector, ById):
|
|
1821
|
-
raise click.UsageError(
|
|
1822
|
-
"Listener and namespace are fixed when a deployment is created, so "
|
|
1823
|
-
"they cannot be set for an existing --deployment-id. Drop them, or "
|
|
1824
|
-
"create a new deployment with --name."
|
|
1825
|
-
)
|
|
1913
|
+
create_only = CreateOnlySettings(placement, image_pull_secrets)
|
|
1914
|
+
create_only.ensure_creatable(push_to, image_uri)
|
|
1915
|
+
if create_only.requested and isinstance(selector, ById):
|
|
1916
|
+
create_only.ensure_not_existing(selector.deployment_id)
|
|
1826
1917
|
if image_uri is not None:
|
|
1827
1918
|
if push_to is not None:
|
|
1828
1919
|
raise click.UsageError("--image-uri cannot be combined with --push-to.")
|
|
@@ -1834,7 +1925,7 @@ def _select_source(
|
|
|
1834
1925
|
raise click.UsageError("--image-uri cannot be combined with --remote.")
|
|
1835
1926
|
return CustomerRegistrySource(
|
|
1836
1927
|
image=PublishedImage(_validate_image_uri(image_uri)),
|
|
1837
|
-
|
|
1928
|
+
create_only=create_only,
|
|
1838
1929
|
)
|
|
1839
1930
|
if push_to is not None:
|
|
1840
1931
|
if remote_build_flag is True:
|
|
@@ -1844,7 +1935,7 @@ def _select_source(
|
|
|
1844
1935
|
_require_local_docker()
|
|
1845
1936
|
return CustomerRegistrySource(
|
|
1846
1937
|
image=BuildAndPush(reference=reference, prebuilt_image=image),
|
|
1847
|
-
|
|
1938
|
+
create_only=create_only,
|
|
1848
1939
|
)
|
|
1849
1940
|
if image and remote_build_flag is True:
|
|
1850
1941
|
raise click.UsageError("--image cannot be combined with --remote builds.")
|
|
@@ -2122,11 +2213,13 @@ def _deploy_base_options(
|
|
|
2122
2213
|
),
|
|
2123
2214
|
click.option(
|
|
2124
2215
|
"--deployment-type",
|
|
2125
|
-
type=click.Choice(["dev", "prod"]),
|
|
2216
|
+
type=click.Choice(["serverless", "dedicated", "dev", "prod"]),
|
|
2126
2217
|
default="dev",
|
|
2127
2218
|
show_default=True,
|
|
2128
2219
|
help=(
|
|
2129
|
-
"Deployment type (used when creating a new deployment)
|
|
2220
|
+
"Deployment type (used when creating a new deployment): "
|
|
2221
|
+
"serverless (scale to zero) or dedicated (prod); "
|
|
2222
|
+
"legacy dev and prod are also accepted. "
|
|
2130
2223
|
"Ignored with --push-to."
|
|
2131
2224
|
),
|
|
2132
2225
|
),
|
|
@@ -2188,6 +2281,18 @@ def _deploy_base_options(
|
|
|
2188
2281
|
"creating a deployment with --push-to or --image-uri."
|
|
2189
2282
|
),
|
|
2190
2283
|
),
|
|
2284
|
+
click.option(
|
|
2285
|
+
"--image-pull-secret",
|
|
2286
|
+
"image_pull_secrets",
|
|
2287
|
+
multiple=True,
|
|
2288
|
+
help=(
|
|
2289
|
+
"Name of a Kubernetes secret (type kubernetes.io/"
|
|
2290
|
+
"dockerconfigjson) in the deployment's namespace to use for "
|
|
2291
|
+
"pulling the image from a private registry. Repeat to give "
|
|
2292
|
+
"more than one. Only used when creating a deployment with "
|
|
2293
|
+
"--push-to or --image-uri."
|
|
2294
|
+
),
|
|
2295
|
+
),
|
|
2191
2296
|
click.option(
|
|
2192
2297
|
"--config",
|
|
2193
2298
|
"-c",
|
|
@@ -2301,6 +2406,7 @@ def _deploy_cmd(
|
|
|
2301
2406
|
image_uri: str | None,
|
|
2302
2407
|
listener_id: str | None,
|
|
2303
2408
|
k8s_namespace: str | None,
|
|
2409
|
+
image_pull_secrets: tuple[str, ...],
|
|
2304
2410
|
tag: str | None,
|
|
2305
2411
|
base_image: str | None,
|
|
2306
2412
|
install_command: str | None,
|
|
@@ -2377,6 +2483,7 @@ def _deploy_cmd(
|
|
|
2377
2483
|
tag=tag,
|
|
2378
2484
|
remote_build_flag=remote_build_flag,
|
|
2379
2485
|
placement=RequestedPlacement(listener_id, k8s_namespace),
|
|
2486
|
+
image_pull_secrets=image_pull_secrets,
|
|
2380
2487
|
selector=selector,
|
|
2381
2488
|
)
|
|
2382
2489
|
|
|
@@ -2403,7 +2510,9 @@ def _deploy_cmd(
|
|
|
2403
2510
|
),
|
|
2404
2511
|
verbose=verbose,
|
|
2405
2512
|
selector=selector,
|
|
2406
|
-
deployment_type=
|
|
2513
|
+
deployment_type={"serverless": "dev_zero", "dedicated": "prod"}.get(
|
|
2514
|
+
deployment_type, deployment_type
|
|
2515
|
+
),
|
|
2407
2516
|
secrets=secrets,
|
|
2408
2517
|
tracked_packages=tracked_packages,
|
|
2409
2518
|
)
|
|
@@ -249,9 +249,12 @@ class HostBackendClient:
|
|
|
249
249
|
return self._request("DELETE", f"/v2/deployments/{deployment_id}")
|
|
250
250
|
|
|
251
251
|
def request_push_token(self, deployment_id: str) -> dict[str, Any]:
|
|
252
|
+
# Tells the control plane this client logs in with the returned
|
|
253
|
+
# `username` and pushes to `repository_url`. LangSmith AWS requires it.
|
|
252
254
|
return self._request(
|
|
253
255
|
"POST",
|
|
254
256
|
f"/v2/deployments/{deployment_id}/push-token",
|
|
257
|
+
{"supports_registry_username": True},
|
|
255
258
|
)
|
|
256
259
|
|
|
257
260
|
def request_upload_url(self, deployment_id: str) -> dict[str, Any]:
|