artfxdev / silex_client Goto Github PK
View Code? Open in Web Editor NEWPython library to execute silex actions
License: MIT License
Python library to execute silex actions
License: MIT License
When the commands
key is empty:
double:
steps:
init:
index: 0
label: "Logging"
commands:
Actual:
dacite.exceptions.WrongTypeError: wrong value type for field "steps.commands" -
should be "typing.Dict[str, silex_client.action.command_buffer.CommandBuffer]" instead of value "None" of type "NoneType"
Expected: Error: no commands given
If I have a double.yml
configuration file for an action in the config
folder with the following:
# double.yml
test:
steps:
init:
index: 0
label: "Logging"
commands:
log_first:
label: "First log"
path: "silex_client.commands.utils.Log"
parameters:
message: "Initialization..."
level: "info"
The root key is not equal to the filename.
Actual:
[action_query._initialize_buffer] Could not initialise the action: The resolved config is invalid (112)
Expected: Error: the top most key is not the same as the filename
When we have multiple commands with the same key name:
# double.yml
double:
steps:
init:
index: 0
label: "Logging"
commands:
log_first:
label: "First log"
path: "silex_client.commands.utils.Log"
parameters:
message: "First log..."
level: "info"
log_first:
label: "Second log"
path: "silex_client.commands.utils.Log"
parameters:
message: "Second log..."
level: "warn"
Actual (actionquery json):
{
"name": "double",
"uuid": "eee7388c26d411ecb599ab3705c91dc2",
"status": 2,
"steps": {
"init": {
"name": "init",
"index": 0,
"status": 2,
"label": "Logging",
"hide": false,
"tooltip": "",
"commands": {
"log_first": {
"path": "silex_client.commands.utils.Log",
"name": "log_first",
"label": "Second log",
"hide": false,
"tooltip": "",
"parameters": {
"message": {
"label": "Message",
"type": "str",
"value": "Second log..."
},
"level": {
"label": "Level",
"type": "str",
"value": "warn"
}
},
"uuid": "eee7388d26d411ecb599ab3705c91dc2",
"status": 2
}
},
"uuid": "eee7388f26d411ecb599ab3705c91dc2"
}
},
// ...
}
Expected: Warning: multiple command keys have the same name!
Agree on a protocol to communicate the query, progression, update of an action
Currently, all the conform configs are identical yamls with the conform type as only difference: https://github.com/ArtFXDev/silex_client/tree/dev/silex_client/config/conform
With action inheritance it would be better to avoid repeating ourselves.
On top of that, add video file formats for conform:
The current implementation of log redirection through websocket won't work when executing multiple actions asynchronously
Use rez for render jobs on the farm:
rez env vray fady -- vray.exe ....
When sending a clear
event on the /dcc/action
route (you can kill the action from the interface), it stops the running action but the session is not closed:
$ rez env silex_client-dev -- silex action tester -c dev
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7feb2a515250>
At some point we want to be able to cancel an action if something went wrong. For that we need to implement undo commands for file moves, publish...
I am running this action in the terminal:
$ rez env silex_client -- silex action tester
And pressing Ctrl+C to cancel the action is not being caught:
^CInterrupted by user
[SILEX] [211022 10:46:58] INFO | [websocket_namespace.on_disconnect] Disconected from ws://127.0.0.1:5118 on /dcc/action (46)
Traceback (most recent call last):
File "/home/josephhenry/packages/python/3.7.9/platform-linux/arch-x86_64/os-Pop-21.04/python/lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/josephhenry/packages/python/3.7.9/platform-linux/arch-x86_64/os-Pop-21.04/python/lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/josephhenry/Documents/artfx/pipeline/silex/git/silex_client/silex_client/cli/parser.py", line 118, in <module>
main()
File "/home/josephhenry/Documents/artfx/pipeline/silex/git/silex_client/silex_client/cli/parser.py", line 114, in main
HANDLERS_MAPPING[subcommand](**args)
File "/home/josephhenry/Documents/artfx/pipeline/silex/git/silex_client/silex_client/cli/handlers.py", line 77, in action_handler
futures.wait([silex_context.ws_connection.stop()], timeout=None)
File "/home/josephhenry/Documents/artfx/pipeline/silex/git/silex_client/silex_client/network/websocket.py", line 102, in stop
futures.wait([future])
File "/home/josephhenry/packages/python/3.7.9/platform-linux/arch-x86_64/os-Pop-21.04/python/lib/concurrent/futures/_base.py", line 301, in wait
waiter.event.wait(timeout)
File "/home/josephhenry/packages/python/3.7.9/platform-linux/arch-x86_64/os-Pop-21.04/python/lib/threading.py", line 552, in wait
signaled = self._cond.wait(timeout)
File "/home/josephhenry/packages/python/3.7.9/platform-linux/arch-x86_64/os-Pop-21.04/python/lib/threading.py", line 296, in wait
waiter.acquire()
File "/home/josephhenry/packages/python_engineio/4.2.1/88a70aca30cb79a278872594adf043dc6c40af99/python/engineio/client.py", line 36, in signal_handler
[SILEX] [211022 10:46:58] INFO | [websocket_namespace.on_disconnect] Disconected from ws://127.0.0.1:5118 on /dcc (46)
return original_signal_handler(sig, frame)
File "/home/josephhenry/packages/python_socketio/5.4.0/88a70aca30cb79a278872594adf043dc6c40af99/python/socketio/client.py", line 26, in signal_handler
return original_signal_handler(sig, frame)
KeyboardInterrupt
Task was destroyed but it is pending!
task: <Task pending coro=<ActionQuery.execute.<locals>.execute_commands() running at /home/josephhenry/Documents/artfx/pipeline/silex/git/silex_client/silex_client/action/action_query.py:84> wait_for=<Future pending cb=[ActionQuery.async_update_websocket.<locals>.apply_update() at /home/josephhenry/Documents/artfx/pipeline/silex/git/silex_client/silex_client/action/action_query.py:206, <TaskWakeupMethWrapper object at 0x7f03819bc750>()]> cb=[_chain_future.<locals>._call_set_state() at /home/josephhenry/packages/python/3.7.9/platform-linux/arch-x86_64/os-Pop-21.04/python/lib/asyncio/futures.py:358]>
Right now the environnement variables have différents names on the repos, WE should make them consistant
Etablish a connection between the silex client and the websocket server
If the Socket server is disconnected while actions are running, it loses them when reconnecting and so the front-end.
Between the UI and SSS we have: /ui/getRunningActions
which returns a dictionary of actions:
getRunningActions: WithCallback<
ServerResponseWithData<{ [uuid: string]: Action }>
>;
then when the UI starts up, it sends that query to get the current running actions. In this case the either silex_client should send the actions to the SSS when reconnecting (we can use the reconnection event) or the other way around?
I am trying to solve #96 and I want to get the current running actions in the context.
I am trying to use:
silex_client/silex_client/core/context.py
Line 48 in 921d1b0
But it's not used in any code, is it up to date?
When trying to execute an action without the -c
category argument:
$ rez env silex_client-dev -- silex action tester
[SILEX] [211222 15:40:15] ERROR | [config.resolve_config] Could not resolve the action tester: The action does not exists (106)
Traceback (most recent call last):
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/parser.py", line 140, in <module>
main()
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/parser.py", line 136, in main
HANDLERS_MAPPING[subcommand](**args)
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/handlers.py", line 48, in action_handler
if not action.commands:
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/action/action_query.py", line 314, in commands
return self.buffer.commands
AttributeError: 'ActionQuery' object has no attribute 'buffer'
Currently if we provide an incorrect log level (for logzero), there's an error:
$ SILEX_LOG_LEVEL="info" rez-env silex_client-dev -- silex action submit
Traceback (most recent call last):
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/parser.py", line 9, in <module>
from silex_client.cli import handlers
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/handlers.py", line 15, in <module>
from silex_client.utils.log import logger
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/utils/log.py", line 31, in <module>
logger.setLevel(log_level) # set default level
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/logging/__init__.py", line 1353, in setLevel
self.level = _checkLevel(level)
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/logging/__init__.py", line 195, in _checkLevel
raise TypeError("Level not an integer or a valid string: %r" % level)
TypeError: Level not an integer or a valid string: <function info at 0x7fde53894290>
We should either transform the variable to upper case or show a more descriptive error with logs.
Using Rez 2.100.0
and commit 1fc378b trying to install the package locally:
$ rez pip -i .
Everything is working well but I have the warnings:
21:49:20 WARNING Metadata: missing: ['Author'], warnings: []
21:49:20 WARNING Metadata: missing: ['Home-page', 'Author'], warnings: []
21:49:21 WARNING Ignoring extras requested on 'python-socketio[client]==5.4.0' - this is not yet supported
And this error:
Traceback (most recent call last):
File "/home/josephhenry/rez/bin/rez/rez", line 8, in <module>
sys.exit(run_rez())
File "/home/josephhenry/rez/lib/python3.7/site-packages/rez/cli/_entry_points.py", line 80, in run_rez
return run()
File "/home/josephhenry/rez/lib/python3.7/site-packages/rez/cli/_main.py", line 202, in run
returncode = run_cmd()
File "/home/josephhenry/rez/lib/python3.7/site-packages/rez/cli/_main.py", line 194, in run_cmd
return func(opts, opts.parser, extra_arg_groups)
File "/home/josephhenry/rez/lib/python3.7/site-packages/rez/cli/pip.py", line 84, in command
extra_args=opts.extra)
File "/home/josephhenry/rez/lib/python3.7/site-packages/rez/pip.py", line 357, in pip_install_package
name_casings=dist_names
File "/home/josephhenry/rez/lib/python3.7/site-packages/rez/utils/pip.py", line 396, in get_rez_requirements
is_pure_python = is_pure_python_package(installed_dist)
File "/home/josephhenry/rez/lib/python3.7/site-packages/rez/utils/pip.py", line 338, in is_pure_python_package
wheel_data = setuptools_dist.get_metadata('WHEEL')
AttributeError: 'NoneType' object has no attribute 'get_metadata'
The error might be due to the missing tractor
package but we need to make a package out of this.
Then if I try to run the env with silex_client
, I get the following:
$ rez env silex_client
21:57:30 ERROR PackageFamilyNotFoundError: package family not found: typing_extensions, was required by: aiohttp (searched: /home/josephhenry/packages; /home/josephhenry/.rez/packages/int; /home/josephhenry/.rez/packages/ext)
Finally trying to install typing_extensions
with rez-pip gives me an error:
=> Here is the related issue: AcademySoftwareFoundation/rez#1159 (comment)
I am running Python 3.7.9
on Linux pop-os 5.13.0-7620-generic
Send a clear message that the tractor in unreachable
Authentification token : /auth on token
Returned data :
{
"data":
}
I am running the following action on Linux with rez:
$ rez-env silex_client-dev -- silex action submit
and when I hit Ctrl+C in the terminal I get:
^CInterrupted by user
Traceback (most recent call last):
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/parser.py", line 140, in <module>
main()
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/parser.py", line 136, in main
HANDLERS_MAPPING[subcommand](**args)
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/cli/handlers.py", line 76, in action_handler
futures.wait([silex_context.ws_connection.stop()], timeout=None)
File "/home/josephhenry/rez_packages/silex/silex-rez/packages/silex/silex_client/dev.0.1.0/silex_client/network/websocket.py", line 91, in stop
futures.wait([future])
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/concurrent/futures/_base.py", line 301, in wait
waiter.event.wait(timeout)
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/threading.py", line 552, in wait
signaled = self._cond.wait(timeout)
File "/home/josephhenry/rez_packages/python/3.7.9/platform-linux/arch-64bit/os-Pop-21.10/python/lib/threading.py", line 296, in wait
waiter.acquire()
File "/home/josephhenry/rez_packages/python_engineio/4.3.0/88a70aca30cb79a278872594adf043dc6c40af99/python/engineio/client.py", line 36, in signal_handler
return original_signal_handler(sig, frame)
File "/home/josephhenry/rez_packages/python_socketio/5.4.0/88a70aca30cb79a278872594adf043dc6c40af99/python/socketio/client.py", line 26, in signal_handler
return original_signal_handler(sig, frame)
KeyboardInterrupt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.