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

Problems in the interaction between Manager and Monitor #36

Open
BartChris opened this issue Aug 15, 2023 · 1 comment
Open

Problems in the interaction between Manager and Monitor #36

BartChris opened this issue Aug 15, 2023 · 1 comment

Comments

@BartChris
Copy link

BartChris commented Aug 15, 2023

Hi,

Thanks a lot for all the enhancements, which i am testing atm. I am right now using the OCR-D-Manager and the OCR-D-Monitor as seperate Docker applications and not as part of a meta repository and i am struggling with some things in the current Master.

  1. The current version of the manager is using the Mongo Database which is started by the compose-file of the Monitor container.
    I had the Monitor to join the Docker network of the Manager in order to be able to communicate between the two. Right now it is therefor not possible to use the Manager standalone since it is depending on an running Monitor.

2) It seems like the Shell Script in the Manager is storing Jobs inside the Mongo collection OcrdJobs

but the Monitor is getting the job data from the collection MongoOcrdJobs.

The monitor can therefor not find OcrdJobs which are stored in a different collection.

3. I changed the OCR-D-Manager to store jobs to the MongoOcrdJob collection as well. I then get data in the job overview, but there seems to be another problem as i get a lot of errors which crash the application. The code in /ocrd-monitor/ocrdmonitor/server/jobs.py and the Jinja template try to access a property ocrd_job on the OcrdJob dataclass, but this property does not seem to exist in the class. Maybe i am missing something

  1. I have not yet tested the retrieval of data from the controller in the job overview so i commented out those checks. What happens if the controller is not reachable: is it still possible to list the jobs (without current statuses from the controller of course) or would the overview fail?
@BartChris
Copy link
Author

BartChris commented Sep 1, 2023

In the latest master point 2 and 3 already seem to be adressed. Regarding 4.: The job overview might fail if the ssh request for the pid returns an empty string:

pid = await self._remote.read_file(f"/data/{ocrd_job.remotedir}/ocrd.pid")
process_statuses = await self._remote.process_status(int(pid))
.

This could happen in sshremote.py and leads to an exception because the value '' (empty string) for pid cannot be casted to an int.

async def read_file(self, path: str) -> str:
result = await asyncio.create_subprocess_shell(
_ssh(self._config, f"cat {path}"),
stdout=asyncio.subprocess.PIPE,
)
await result.wait()
if not result.stdout:
return ""

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