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

FIX/ENH: a few more fixes for cached/offline mode + plugin only mode #178

Merged
merged 12 commits into from
Oct 10, 2023

Conversation

klauer
Copy link
Contributor

@klauer klauer commented Sep 2, 2023

Description

  • Server logs visible on serverless mode
  • File viewing working on serverless mode
  • To potentially revert or make configurable: using hash mode in vue-router to avoid changes to our old web servers
  • Had issues with axios decompressing .json.gz on pswww (perhaps due to my own lack of knowledge); reverted to using a separate library for decompression which should work in all cases
  • Adds plugin-only mode, used in the current deployment

TODO:

  • Test that I didn't break viewing logs by way of the server store (logs.vue)

Motivation and Context

  • Conference is coming up
  • Test deployment of serverless "plugin-only" thing is on pswww for our team to use

How Has This Been Tested?

  • Interactively
  • Some in the test suite

Where Has This Been Documented?

PR

Screenshots (if appropriate):

image image

@klauer klauer changed the title FIX: a few more fixes for cached/offline mode FIX/ENH: a few more fixes for cached/offline mode + plugin only mode Sep 7, 2023
@klauer klauer linked an issue Sep 7, 2023 that may be closed by this pull request
@klauer
Copy link
Contributor Author

klauer commented Sep 28, 2023

  • This is being used currently for our local pswww
  • Additionally, I'm using it for auto-generating IOC docs via GHA (test wip is here)

@klauer klauer marked this pull request as ready for review October 9, 2023 15:10
@klauer klauer requested review from ZLLentz and tangkong October 9, 2023 15:11
@klauer
Copy link
Contributor Author

klauer commented Oct 9, 2023

I think this is pretty much ready to be merged, pending a review.
I may have some additional tweaks before my presentation on Thursday - we'll see...

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I don't see anything weird or unmotivated in the code here and the as-deployed serverless whatrecord has logs now 👍

Copy link
Member

Choose a reason for hiding this comment

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

The logs have some connection/setup error right now that I'm going to paste here:

aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8898 ssl:default [Connect call failed ('127.0.0.1', 8898)]
2023-10-09 16:00:27,639 - PID 28530            util.py: 91  run_script_with_json_output WARNING  Standard error output while running script ('"/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/bin/python" -m whatrecord.plugins.twincat_pytmc'):
    ! Traceback (most recent call last):
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    !     return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/asyncio/base_events.py", line 1065, in create_connection
    !     raise exceptions[0]
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/asyncio/base_events.py", line 1050, in create_connection
    !     sock = await self._connect_sock(
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/asyncio/base_events.py", line 961, in _connect_sock
    !     await self.sock_connect(sock, address)
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/asyncio/selector_events.py", line 500, in sock_connect
    !     return await fut
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/asyncio/selector_events.py", line 535, in _sock_connect_cb
    !     raise OSError(err, f'Connect call failed {address}')
    ! ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 8898)

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

    ! Traceback (most recent call last):
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    !     return _run_code(code, main_globals, None,
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/runpy.py", line 87, in _run_code
    !     exec(code, run_globals)
    !   File "/cds/home/k/klauer/Repos/whatrecord/whatrecord/plugins/twincat_pytmc.py", line 615, in <module>
    !     results = asyncio.run(_cli_main())
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/asyncio/runners.py", line 44, in run
    !     return loop.run_until_complete(main)
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    !     return future.result()
    !   File "/cds/home/k/klauer/Repos/whatrecord/whatrecord/plugins/twincat_pytmc.py", line 586, in _cli_main
    !     results = await main(**vars(args))
    !   File "/cds/home/k/klauer/Repos/whatrecord/whatrecord/plugins/twincat_pytmc.py", line 573, in main
    !     ioc_info = await client.get_iocs(server=server)
    !   File "/cds/home/k/klauer/Repos/whatrecord/whatrecord/client.py", line 38, in get_iocs
    !     response = await make_query(
    !   File "/cds/home/k/klauer/Repos/whatrecord/whatrecord/client.py", line 22, in make_query
    !     async with session.get(f"{server}{path}", params=params) as resp:
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    !     self._resp = await self._coro
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
    !     conn = await self._connector.connect(
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
    !     proto = await self._create_connection(req, traces, timeout)
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
    !     _, proto = await self._create_direct_connection(req, traces, timeout)
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    !     raise last_exc
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    !     transp, proto = await self._wrap_create_connection(
    !   File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.7.3/lib/python3.9/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
    !     raise client_error(req.connection_key, exc) from exc
    ! aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8898 ssl:default [Connect call failed ('127.0.0.1', 8898)]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - that's this error: #174
Basically during the offline dump process it says "server, what IOCs do you have? I want to find TwinCAT ads-ioc instances..." But the --dump mode doesn't even run a server, so it just fails.

@klauer klauer linked an issue Oct 10, 2023 that may be closed by this pull request
@klauer klauer merged commit 52d508d into pcdshub:master Oct 10, 2023
@klauer klauer deleted the fix_offline branch October 11, 2023 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants