Parisson / TimeSide

scalable audio processing framework and server written in Python
https://timeside.ircam.fr/docs/
GNU Affero General Public License v3.0
367 stars 60 forks source link

Feature/websockets #246

Closed brotobot closed 3 years ago

brotobot commented 3 years ago

add /timeside/api/users/ GET alias : "me" username determine user with token value TODO : remove possibility to create new user with username "me" (not trivial because a custom User Model is needed)

Minimal websockets implementation with messages for events :

Websockets authentification use Django REST Framework token

Completion is triggered in decoder aubio or file (not tested with file) with COMPLETION_INTERVAL Django setting which determine the number of block between each message

For testing in dev mode : go to localhost:13000, enter token and see messages in dev console when you trigger analysis or experiences

Just tested with /timeside/api/analysis_tracks/ POST request Need to be tested in all situations

yomguy commented 3 years ago

Wonderfull job @clementgerard1 thanks! I will start a short review.

yomguy commented 3 years ago

hi @clementgerard1 the django and the node parts are OK but the core part should not include any links to them. The related usecase is that someone should be able to run a process through a python shell without any worry about the server side. Sorry if this was not clear and detailed in the request.

Maybe we could rather try to retrieve the state of the decoder injecting a callback into the pipe.run method and use the task.run one to push the value into the socket. This will ensure that the decoder can run without knowing the server and let the backend do the web notification job.

cc/ @rherbelleau @gnuletik

gnuletik commented 3 years ago

Also, if we are extending JS usage in the team, would you like to choose one JS coding standard like :

brotobot commented 3 years ago

hi @clementgerard1 the django and the node parts are OK but the core part should not include any links to them. The related usecase is that someone should be able to run a process through a python shell without any worry about the server side. Sorry if this was not clear and detailed in the request.

Maybe we could rather try to retrieve the state of the decoder injecting a callback into the pipe.run method and use the task.run one to push the value into the socket. This will ensure that the decoder can run without knowing the server and let the backend do the web notification job.

cc/ @rherbelleau @gnuletik

Done with progress_callback function defined in run method of Item model in server/models.py

brotobot commented 3 years ago

Also, if we are extending JS usage in the team, would you like to choose one JS coding standard like :

Yes, what did you use in other js POW projects ?

brotobot commented 3 years ago

Could you serve the index.html page in dev only ?

index.ejs page is only served when DEBUG setting is on

brotobot commented 3 years ago

Also, if we are extending JS usage in the team, would you like to choose one JS coding standard like :

Yes, what did you use in other js POW projects ?

I add standard config and rewrite for linter acceptation (https://github.com/standard/eslint-config-standard)

yomguy commented 3 years ago

Wonderful job @clementgerard1 ! We will just need to fix the user running nodejs.