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: fix docker run on linux #604

Merged
merged 6 commits into from
Oct 19, 2023
Merged

Cli: fix docker run on linux #604

merged 6 commits into from
Oct 19, 2023

Conversation

nicoloboschi
Copy link
Member

@nicoloboschi nicoloboschi commented Oct 17, 2023

Changes:

  • Set generated files readable for every user to avoid permissions error. The files are copied to $HOME/.langstream/tmp directory which is protected to other unix machine users but still readable from the container
  • Improve the installation script error message

After these changes, I successfully setup an amazon linux machine to run langstream (I'll add it to the doc):

sudo yum update
sudo yum install -y docker jq unzip  java-11-amazon-corretto-headless
sudo usermod -a -G docker ec2-user
id ec2-user
newgrp docker
sudo systemctl enable docker.service
sudo systemctl start docker.service
curl -Ls "https://raw.githubusercontent.com/LangStream/langstream/main/bin/get-cli.sh" | bash
source ~/.bashrc
export OPEN_AI_ACCESS_KEY=your-key-here
langstream docker run test -app https://github.com/LangStream/langstream/blob/main/examples/applications/openai-completions -s https://github.com/LangStream/langstream/blob/main/examples/secrets/secrets.yaml

@nicoloboschi nicoloboschi changed the title Fix docker run on fresh ubuntu vm Fix docker run on linux Oct 17, 2023
@nicoloboschi nicoloboschi marked this pull request as ready for review October 17, 2023 15:33
@nicoloboschi nicoloboschi changed the title Fix docker run on linux Cli: fix docker run on linux Oct 17, 2023
@nicoloboschi
Copy link
Member Author

This might be a better solution https://stackoverflow.com/a/57776923/7309769

@eolivelli eolivelli added this to the 0.3.0 milestone Oct 19, 2023
@eolivelli eolivelli added the bug Something isn't working label Oct 19, 2023
.addShutdownHook(
new Thread(
() -> {
log("Cleaning environment");
Copy link
Member

Choose a reason for hiding this comment

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

can we log this only if there are "temporary files"

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -45,6 +51,8 @@ public class LocalRunApplicationCmd extends BaseDockerCmd {

protected static final String LOCAL_DOCKER_RUN_PROFILE = "local-docker-run";

private static final Set<Path> temporaryFiles = new HashSet<>();
Copy link
Member

Choose a reason for hiding this comment

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

use a Concurrent set, this structure is accessed from multiple thread

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@nicoloboschi nicoloboschi merged commit 092046a into main Oct 19, 2023
9 checks passed
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
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants