Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] Add a tool to run locally an application on docker #393

Merged
merged 4 commits into from
Sep 11, 2023

Conversation

eolivelli
Copy link
Member

@eolivelli eolivelli commented Sep 11, 2023

Goals:
allow users to quickly iterate over the configurations without needing to deploy the application to a kubernetes cluster

Summary:

  • new docker image langstream-runtime-tester that allows you to run a single LangStream application on the local enviroment, on a single docker container

How to run the tool:

bin/langstream docker run -app /path/to/app -i /path/to/instance -s /path/to-secrets --start-broker=true|false --start-s3=true|false

it is the same command as "apps deploy" but you use "local-run" instead of "deploy".
As the environment is ephemeral you must always pass the instance.yaml and the secrets.yaml files

By default we also start Kafka and Minio, you can control them by using --start-broker and --start-s3

Limitations of the "local mode":

  • this is not for production, only for quick iterations
  • all the pipelines and agents executors run in the same Java process
  • no parallelism
  • you always have to pass the "secrets" and the "instance file"
  • the system is almost stateless, each time you run you deploy the application from scratch

@eolivelli eolivelli changed the title [cli] Add a new tool to run locally the pipelines [cli] Add a new tool to run locally an application on docker Sep 11, 2023
@eolivelli eolivelli changed the title [cli] Add a new tool to run locally an application on docker [cli] Add a tool to run locally an application on docker Sep 11, 2023
Files.write(tmpInstanceFile.toPath(), instanceContents.getBytes(StandardCharsets.UTF_8));
File tmpSecretsFile = Files.createTempFile("secrets", ".yaml").toFile();
Files.write(tmpSecretsFile.toPath(), secretsContents.getBytes(StandardCharsets.UTF_8));
String imageName = "langstream/langstream-runtime-tester:latest-dev";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should make this configurable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably in this case it's better to push a "latest" for the runtime-tester image?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be configurable and it should use "some release", ideally the same version of the CLI

@eolivelli
Copy link
Member Author

I am committing this first part of the PR.
I am adding support for the "gateways" in the next one.
and I will also make the version configurable

@eolivelli eolivelli marked this pull request as ready for review September 11, 2023 15:51
@eolivelli eolivelli merged commit 73183e6 into main Sep 11, 2023
8 checks passed
@eolivelli eolivelli deleted the impl/local-runner branch September 11, 2023 15:51
benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants