Skip to content

Commit 285f860

Browse files
authored
add info about the new profile for docker run (#115)
1 parent 6f04df1 commit 285f860

File tree

1 file changed

+30
-11
lines changed

1 file changed

+30
-11
lines changed

installation/docker.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ This command starts a docker container using the same version of the CLI.
3333

3434
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)).
3535

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.
3840

3941
When you kill the application with Ctrl-C, the environment is automatically disposed of.
4042
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
5153

5254
You can use the following flags to select the services to run:
5355

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`)
5961

6062
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.
6163

@@ -72,14 +74,14 @@ the id would be the id of a Statefulset.
7274

7375
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.
7476

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.
7678

7779
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).
7981

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.
8183

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.
8385

8486

8587
### Tuning the docker container
@@ -100,3 +102,20 @@ The following flags are available:
100102
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
101103

102104
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
120+
```
121+

0 commit comments

Comments
 (0)