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

[MM-53555] Implement env override for job service image registry #607

Merged
merged 3 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/gorilla/websocket v1.5.1
github.com/jmoiron/sqlx v1.3.5
github.com/mattermost/calls-offloader v0.5.0
github.com/mattermost/calls-offloader v0.6.0
github.com/mattermost/calls-recorder v0.6.2
github.com/mattermost/calls-transcriber v0.1.8
github.com/mattermost/logr/v2 v2.0.21
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattermost/calls-offloader v0.5.0 h1:3No8IdCiHDamNVvUTlnmKJlAxoWJiXMGu3WU8DBC034=
github.com/mattermost/calls-offloader v0.5.0/go.mod h1:/xyDQiBZ0XNKNC/ALGp7pkGNApfC6v94CD7tPWGcFvM=
github.com/mattermost/calls-offloader v0.6.0 h1:0DlkX9gR9Eiw7Dv3Z+W7DuBzOgMD9aBEnGkAVIOKS74=
github.com/mattermost/calls-offloader v0.6.0/go.mod h1:/xyDQiBZ0XNKNC/ALGp7pkGNApfC6v94CD7tPWGcFvM=
github.com/mattermost/calls-recorder v0.6.2 h1:tTEoSkXJ9UEfoW7Lr9YQW3YtsHoQ0ycGeStyQrm/5aw=
github.com/mattermost/calls-recorder v0.6.2/go.mod h1:v/52mE+wIXGJE7ZflpAkoyGd56hbVgC9ZuEBBaRd8KU=
github.com/mattermost/calls-transcriber v0.1.8 h1:vwmxHxRHuuuo4wyf+ZfvDj5n2TNpebQO43Qy6u+BAQY=
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
},
"props": {
"min_rtcd_version": "v0.12.0",
"min_offloader_version": "v0.5.0",
"min_offloader_version": "v0.6.0",
"calls_recorder_version": "v0.6.3",
"calls_transcriber_version": "v0.1.8"
}
Expand Down
10 changes: 8 additions & 2 deletions server/job_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,24 @@ func (p *Plugin) jobServiceVersionCheck(client *offloader.Client) error {

func (p *Plugin) initJobService() error {
p.LogDebug("initializing job service")

registry := job.ImageRegistryDefault
if val := os.Getenv("MM_CALLS_JOB_SERVICE_IMAGE_REGISTRY"); val != "" {
registry = val
}

recorderVersion, ok := manifest.Props["calls_recorder_version"].(string)
if !ok {
return fmt.Errorf("failed to get recorder version from manifest")
}
recorderJobRunner = "mattermost/calls-recorder:" + recorderVersion
recorderJobRunner = fmt.Sprintf("%s/%s:%s", registry, job.RecordingJobPrefix, recorderVersion)
runners := []string{recorderJobRunner}

transcriberVersion, ok := manifest.Props["calls_transcriber_version"].(string)
if !ok {
return fmt.Errorf("failed to get transcriber version from manifest")
}
transcriberJobRunner = "mattermost/calls-transcriber:" + transcriberVersion
transcriberJobRunner = fmt.Sprintf("%s/%s:%s", registry, job.TranscribingJobPrefix, transcriberVersion)

// We only initialize the transcriber runner (image prefetch) if transcriptions are enabled.
// We still need to set the runner above in case they are enabled at a later point.
Expand Down