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

Did not manage to sucessfully setup just by following README #12

Open
Bachibouzouk opened this issue Mar 7, 2024 · 4 comments
Open

Comments

@Bachibouzouk
Copy link
Collaborator

If I blindly follow the readme here is what I found out:

  • pip install -r api/requirements.txt does not work as the file does not exist, pip install -r requirements/requirements.txt should be executed instead.
  • pip install -r app/requirements/requirements.txt worked except for psycopg2 installation, psycopg2-binary did work
  • There is no mention of pip install app/requirements/InRetEnsys-0.2a7-py3-none-any.whl but it seems to be needed
  • uvicorn api.api:app --reload did not work as 127.0.0.1:8000 was already taken by the local InRet GUI, uvicorn api.api:app --reload --port 8001 worked. Note that this is only a problem if a user want to setup the server from the README of the GUI. If better explanations are provided for setting up the server for use with the GUI on the GUI README directly the ports are not an issue at all :)
@Bachibouzouk
Copy link
Collaborator Author

I deployed locally with docker using
docker build -t InRet_server .
and
docker run -dp 127.0.0.1:8001:8001 InRet_server
However I am still not able to communicate with the container, do I need a user_name and a password? I did not see where I should configure those but it seems they are needed according to the request to the server

@Bachibouzouk
Copy link
Collaborator Author

@pyrokar1993 - If I understand well you are creating docker containers on the fly here whenever a simulation demand comes in?

@Bachibouzouk
Copy link
Collaborator Author

I tried differently, I dumped a .json file with the model from the GUI and I uploaded this file on the simulation server interface, now I get this error:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 91, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 146, in simple_response
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 758, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 778, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 299, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 79, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 74, in app
    response = await func(request)
  File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "/app/api/api.py", line 47, in upload_file
    return run_simulation(request, input=filelist)
  File "/app/api/api.py", line 77, in run_simulation
    simulate_docker(nameOfConfigFile, nameOfJob, ftype, datafile, external)
  File "/app/api/docker.py", line 57, in simulate_docker
    docker_client = docker.from_env()
  File "/usr/local/lib/python3.10/site-packages/docker/client.py", line 94, in from_env
    return cls(
  File "/usr/local/lib/python3.10/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/local/lib/python3.10/site-packages/docker/api/client.py", line 220, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

@Bachibouzouk
Copy link
Collaborator Author

It seems to me that docker.from_env() uses env variable values that are specific to files on your laptop @pyrokar1993 or that are only defined on a file which is not on github (probably rightfully, but a template with values to be filled by user would be convenient)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant