You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: installation/docker.md
+30-11Lines changed: 30 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,10 @@ This command starts a docker container using the same version of the CLI.
33
33
34
34
The container by default runs all the LangStream components, a Kafka Broker, and an S3 service (using [Minio](https://min.io/docs/minio/kubernetes/upstream/index.html)).
35
35
36
-
The docker container exposes the Control Plane on the default port (8090) and the API Gateway on the default port (8091),
37
-
so you can run most of the CLI commands against the local container, especially the commands to interact with the API Gateway.
36
+
The docker container exposes the Control Plane on the default port (`8090`) and the API Gateway on the default port (`8091`),
37
+
so you can run most of the CLI commands against the local container, especially the commands to interact with the API Gateway. See this [section](#connect-to-the-docker-application) to learn more.
38
+
39
+
Note that one of the two port is not available, the command will fail. Parallel executions of local run is not supported.
38
40
39
41
When you kill the application with Ctrl-C, the environment is automatically disposed of.
40
42
If you need to persist your topics or the S3 environment, then you have to build your own instance.yaml file and pass it using the "-i" flag.
@@ -51,11 +53,11 @@ By default the docker container runs all the LangStream components, a Kafka Brok
51
53
52
54
You can use the following flags to select the services to run:
53
55
54
-
* --start-broker true|false: starts the Kafka broker (default is `true`)
55
-
* --start-s3 true|false: starts the S3 service (default is `true`)
56
-
* --start-webservices true|false: starts the LangStream HTTP components (control plane and API gateway) (default is `true`)
57
-
* --start-database true|false: starts an embedded vector JDBC compliant database (HerdDB) (default is `true`)
58
-
* --start-ui true|false: starts and open a UI application that helps you to test the application
56
+
*`--start-broker`: starts the Kafka broker (default is `true`)
57
+
*`--start-s3`: starts the S3 service (default is `true`)
58
+
*`--start-webservices`: starts the LangStream HTTP components (control plane and API gateway) (default is `true`)
59
+
*`--start-database`: starts an embedded vector JDBC compliant database (HerdDB) (default is `true`)
60
+
*`--start-ui`: starts and open a UI application that helps you to test the application (default is `true`)
59
61
60
62
For example, if you are using an external Apache Kafka or Pulsar broke, you don't need to start Kafka in the container and you can save local resources by not running the service.
61
63
@@ -72,14 +74,14 @@ the id would be the id of a Statefulset.
72
74
73
75
When you run your application in "docker run" mode, the container runs a simplified environment that doesn't need Kubernetes, but this comes with a few simplifications to the execution runtime.
74
76
75
-
In production mode on Kubernetes, the LangStream planner builds an execution plan from your pipeline files, and then it submits the execution plan to the Kubernetes cluster in the form of Statefulsets. Each Statefulset is responsible for running a single agent. You can configure the number of replicas for each agent in the "resources" section of the pipeline.yaml file.
77
+
In production mode on Kubernetes, the LangStream planner builds an execution plan from your pipeline files, and then it submits the execution plan to the Kubernetes cluster in the form of Statefulsets. Each Statefulset is responsible for running a single executor (one or many agents). You can configure the number of replicas for each agent in the `resources` section of the pipeline.yaml file. In docker mode, the resources configuration is ignored.
76
78
77
79
In docker mode there is only one Java process that runs all the agents, and for each agent it starts only one execution flow, like having a Statefulset with only one replica.
78
-
The resources (JVM and CPU) are shared between all the agents, so if you have a lot of agents in your application you may need to increase the resources of the docker container (see "Tuning the docker container" below).
80
+
The resources (memory and CPU) are shared between all the agents, so if you have a lot of agents in your application you may need to increase the resources of the docker container (see [Tuning the docker container](#tuning-the-docker-container) below).
79
81
80
-
The initialisation of the assets is always performed independently from the agents that are running, for all the assets declared in the application. This is because the assets are shared between all the agents, even if they are declared in some pipeline file.
82
+
The initialisation of the assets is always performed independently from the agents that are running, for all the assets declared in the application. The deletion of the assets is not performed in this mode.
81
83
82
-
You cannot select which logs to display, as all the agents share the same output (but you can still run one agent at a time). The "langstream apps logs" command is not available in this mode.
84
+
You cannot select which logs to display, as all the agents share the same output (but you can still run one agent at a time). The `langstream apps logs` command is not available in this mode.
83
85
84
86
85
87
### Tuning the docker container
@@ -100,3 +102,20 @@ The following flags are available:
100
102
If you have built [the CLI locally from the sources](../installation/build-and-install-source.md) the docker image defaults to the local docker image
101
103
102
104
You can also override the command used to launch the container, the default value is `docker`, but you can pass the `--docker-command` flag to use a different binary path.
105
+
106
+
107
+
### Connect to the docker application
108
+
The docker container exposes the API gateway on port `8091` and the control plane on port `8090` of your local machine.
109
+
To connect to the docker container it's highly suggested to use a special profile named `local-docker-run`.
110
+
This profile ensures you will always connect to the right endpoints.
111
+
112
+
For example, starting the chat gateway:
113
+
```bash
114
+
langstream -p local-docker-run gateway chat test chat
115
+
```
116
+
117
+
or for getting the application description:
118
+
```bash
119
+
langstream -p local-docker-run apps get test -o yaml
0 commit comments