-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for cloud re-runs and trigger from the UI (#265)
* Recreating the future graph * [MARK] Resolution working, edges not right * RERUN WORKS * Clean-up and refactor * Back to working state * Fixing dag view * mocking storages all around * Linting fixes * pre-commit passes, sending to tests * Aligning mocks * Fix ID label * Fix CloudResolver tests * Cloud tests * Cleanup and documentation * StateMachineResolver docstrings * PR comments * Making methods for testability. * PR comments * UI menus, centralized snackbars * Better ID copy buttons * Refactor top-level state management * Fix clone * Fix submission * UI fixes * Fix edges * Fix nesting bugs * Fixing merge errors * minor fixes * Fix cancelEnabled * last fixes * PR prep * Clone factories tests * Rerun resolution tests. * Mypy fixes * Fix build * Fix build * Apply suggestions from code review Co-authored-by: tscurtu <tudor@sematic.dev> * Apply suggestions from code review Co-authored-by: tscurtu <tudor@sematic.dev> * Cleanup and fixes * PR fixes * Note run id click * Note run id click * Clickable note root id * Fix build * PR comments * BETA chip * Apply suggestions from code review Co-authored-by: tscurtu <tudor@sematic.dev> * Fix RunTime * Revert pkg lock Co-authored-by: tscurtu <tudor@sematic.dev>
- Loading branch information
1 parent
c050ee3
commit 2a11e8d
Showing
39 changed files
with
1,069 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Standard Library | ||
from typing import Optional | ||
|
||
import flask | ||
|
||
# Third party | ||
import flask_socketio # type: ignore | ||
|
||
# Sematic | ||
from sematic.api.app import sematic_api | ||
from sematic.api.endpoints.auth import authenticate | ||
from sematic.db.models.user import User | ||
|
||
|
||
@sematic_api.route("/api/v1/events/<namespace>/<event>", methods=["POST"]) | ||
@authenticate | ||
def events(user: Optional[User], namespace: str, event: str) -> flask.Response: | ||
flask_socketio.emit( | ||
event, | ||
flask.request.json, | ||
namespace="/{}".format(namespace), | ||
broadcast=True, | ||
) | ||
return flask.jsonify({}) | ||
|
||
|
||
def broadcast_graph_update(root_id: str) -> None: | ||
flask_socketio.emit( | ||
"update", | ||
dict(run_id=root_id), | ||
namespace="/graph", | ||
broadcast=True, | ||
) | ||
|
||
|
||
def broadcast_resolution_cancel(root_id: str, calculator_path: str) -> None: | ||
flask_socketio.emit( | ||
"cancel", | ||
dict(resolution_id=root_id, calculator_path=calculator_path), | ||
namespace="/pipeline", | ||
broadcast=True, | ||
) | ||
|
||
|
||
def broadcast_pipeline_update(calculator_path: str) -> None: | ||
flask_socketio.emit( | ||
"update", | ||
dict(calculator_path=calculator_path), | ||
namespace="/pipeline", | ||
broadcast=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.