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

Replace Worker with Runner #1233

Draft
wants to merge 35 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
07cf3de
start new runner implementation
joschahenningsen Oct 2, 2023
7ed30f7
First Push of the Runner:
DawinYurtseven Dec 1, 2023
ecc8147
a slight push of progress before switchi
DawinYurtseven Dec 7, 2023
220c689
added some communication with tumlive and runner and working on selfs…
DawinYurtseven Dec 28, 2023
c3aa753
cmd.yaml update to original
DawinYurtseven Jan 2, 2024
ce36468
merge runner with dev
DawinYurtseven Jan 2, 2024
6960938
Changed transcode command for quality
DawinYurtseven Jan 2, 2024
64e5e8c
Updated runner dependencies
SebiWrn Feb 1, 2024
1a9323a
Fixed cycle import
SebiWrn Feb 1, 2024
87781af
Import cycle broken for server communications
DawinYurtseven Feb 5, 2024
0fefc7f
Merge remote-tracking branch 'origin/enh/runner' into enh/runner
DawinYurtseven Feb 5, 2024
8a05062
Import cycle broken for server communications
DawinYurtseven Feb 5, 2024
ca5cb70
Deleted unnecessary files
DawinYurtseven Feb 5, 2024
fec8e45
fixed reference errors and Sentry.TranscriptName error
DawinYurtseven Feb 5, 2024
679983a
functional streams are now possible with runner. Added two new models…
DawinYurtseven Mar 22, 2024
80e0bb1
Add action silence detect (#1338)
YiranDuan721 Apr 23, 2024
9eecbae
Enh/runner audio normalization (#1329)
YiranDuan721 May 13, 2024
6ff1b26
little progress
DawinYurtseven Mar 26, 2024
3aca47c
temporary changes with runner Job creation not done yet
DawinYurtseven May 22, 2024
25ede51
temporary changes with runner Job creation not done yet. created the …
DawinYurtseven Sep 2, 2024
ac23542
temporarily push to see full progress
DawinYurtseven Sep 18, 2024
4b68ac5
progress of making the Job/Action system of the TUM-Live side.
DawinYurtseven Oct 22, 2024
15662c3
Merge remote-tracking branch 'origin/dev' into enh/runner
DawinYurtseven Oct 23, 2024
5770259
merge and update from dev branch
DawinYurtseven Oct 23, 2024
fb70635
stream running without IngestServer
DawinYurtseven Oct 28, 2024
048d1e1
lint fix
DawinYurtseven Oct 28, 2024
aeaafdb
also mock
DawinYurtseven Oct 28, 2024
108fb8a
Aktualisieren von stream.go
DawinYurtseven Oct 29, 2024
7e66a67
adjusted the hls access from edge server and made the proxy work. adj…
DawinYurtseven Nov 12, 2024
6c20c8b
Merge remote-tracking branch 'origin/enh/runner' into enh/runner
DawinYurtseven Nov 13, 2024
e76637d
did some work for the admin runner page
DawinYurtseven Nov 19, 2024
7ff1898
added edge to cfg for the streams
DawinYurtseven Nov 25, 2024
fe262c2
Merge branch 'dev' into enh/runner
DawinYurtseven Nov 25, 2024
e197fb9
some small adjustments
DawinYurtseven Nov 29, 2024
a7b9013
Merge remote-tracking branch 'origin/enh/runner' into enh/runner
DawinYurtseven Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
# uses a compiled language

#- run: |
# make all
# make all
# make release

- name: Perform CodeQL Analysis
Expand Down
4 changes: 3 additions & 1 deletion .idea/TUM-Live-Backend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/runConfigurations/clean.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/sqldialects.xml

This file was deleted.

54 changes: 54 additions & 0 deletions api/action.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package api

import (
"context"
"github.com/TUM-Dev/gocast/dao"
"github.com/TUM-Dev/gocast/tools"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"net/http"
)

func configActionRouter(r *gin.Engine, wrapper dao.DaoWrapper) {
g := r.Group("/api/Actions")
g.Use(tools.Admin)

routes := actionRoutes{dao: wrapper.ActionDao}

g.GET("/failed", routes.getFailedActions)
g.GET("/:id", routes.getActionById)
}

type actionRoutes struct {
dao dao.ActionDao
}

func (a actionRoutes) getFailedActions(c *gin.Context) {
log.Info("Getting failed actions")
ctx := context.Background()
models, err := a.dao.GetAllFailedActions(ctx)
if err != nil {
_ = c.Error(tools.RequestError{
Status: http.StatusInternalServerError,
CustomMessage: "Can't fetch failed actions",
Err: err,
})
return
}
res := make([]gin.H, len(models))
c.JSON(http.StatusOK, res)
}

func (a actionRoutes) getActionById(c *gin.Context) {
ctx := context.Background()
model, err := a.dao.GetActionByID(ctx, c.Param("id"))
if err != nil {
_ = c.Error(tools.RequestError{
Status: http.StatusNotFound,
CustomMessage: "Action not found",
Err: err,
})
return
}
c.JSON(http.StatusOK, model)
}
2 changes: 2 additions & 0 deletions api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ func ConfigGinRouter(router *gin.Engine) {
configServerNotificationsRoutes(router, daoWrapper)
configTokenRouter(router, daoWrapper)
configWorkerRouter(router, daoWrapper)
configRunnerRouter(router, daoWrapper)
configNotificationsRouter(router, daoWrapper)
configInfoPageRouter(router, daoWrapper)
configGinSearchRouter(router, daoWrapper)
configAuditRouter(router, daoWrapper)
configGinBookmarksRouter(router, daoWrapper)
configMaintenanceRouter(router, daoWrapper)
configSemestersRouter(router, daoWrapper)
configActionRouter(router, daoWrapper)
}
39 changes: 39 additions & 0 deletions api/runner.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package api

import (
"context"
"github.com/TUM-Dev/gocast/dao"
"github.com/TUM-Dev/gocast/tools"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"net/http"
)

func configRunnerRouter(r *gin.Engine, daoWrapper dao.DaoWrapper) {
g := r.Group("/api/runners")
g.Use(tools.Admin)

routes := runnerRoutes{dao: daoWrapper.RunnerDao}

g.DELETE("/:HostName", routes.deleteRunner)
}

type runnerRoutes struct {
dao dao.RunnerDao
}

func (r runnerRoutes) deleteRunner(c *gin.Context) {
log.Info("delete runner with hostname: ", c.Param("Hostname"))
ctx := context.Background()
err := r.dao.Delete(ctx, c.Param("Hostname"))
if err != nil {
//logging for later

Check failure on line 30 in api/runner.go

View workflow job for this annotation

GitHub Actions / lint (./worker)

commentFormatting: put a space between `//` and comment text (gocritic)

Check failure on line 30 in api/runner.go

View workflow job for this annotation

GitHub Actions / lint (./worker/edge)

commentFormatting: put a space between `//` and comment text (gocritic)
_ = c.Error(tools.RequestError{
Status: http.StatusInternalServerError,
CustomMessage: "can not delete runner",
Err: err,
})
return
}

}
Loading
Loading