langchain icon indicating copy to clipboard operation
langchain copied to clipboard

langchain-server script fails to run on new Docker install

Open craigdrayton opened this issue 2 years ago • 4 comments
trafficstars

In a freshly installed instance of Docker for Ubuntu (following the instructions at https://docs.docker.com/desktop/install/ubuntu/), the langchain-server script fails to run.

The reason is that docker-compose is not a valid command following this install process: https://github.com/hwchase17/langchain/blob/afc7f1b892596bd0d4687e1d5882127026bad991/langchain/server.py#L9-L10

This change fixes the issue (while breaking the script for people using the docker-compose command):

def main() -> None:
    """Run the langchain server locally."""
    p = Path(__file__).absolute().parent / "docker-compose.yaml"
    subprocess.run(["docker", "compose", "-f", str(p), "pull"])
    subprocess.run(["docker", "compose", "-f", str(p), "up"])

craigdrayton avatar Feb 08 '23 00:02 craigdrayton

flagging for @agola11

fix would be... to detect os?

hwchase17 avatar Feb 11 '23 07:02 hwchase17

It's not an os problem, it seems. It's that docker compose (with space) is v2 of the tool and is rewritten in go. I think we should just tell people to use the latest version of Docker Desktop and use docker compose, maybe fall back to docker-compose if that fails

https://github.com/docker/compose/tree/v2#docker-compose-v2

agola11 avatar Feb 11 '23 20:02 agola11

I run headless on an Ubuntu VM; unless Docker Desktop can be installed in this environment, I think I and others will have problems with this solution.

tensiondriven avatar Apr 17 '23 01:04 tensiondriven

I've got an ubuntu 20.04, download latest docker-compose from github and it worked like a charm

franperezlopez avatar Apr 22 '23 18:04 franperezlopez

Hi, @craigdrayton. I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, the issue you reported regarding the langchain-server script failing to run on a new Docker install has been resolved. The proposed fix involves using the docker compose command instead of docker-compose. However, this fix may break the script for users relying on the docker-compose command. To mitigate this, it is suggested to tell people to use the latest version of Docker Desktop and use docker compose, with a fallback to docker-compose if that fails. Some users have concerns about this solution not working in certain environments, but others have successfully used the latest version of docker-compose on Ubuntu 20.04.

Now, we would like to confirm if this issue is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution to the LangChain project. Let us know if you have any further questions or concerns.

dosubot[bot] avatar Sep 20 '23 16:09 dosubot[bot]