Skip to content

Commit 6aecbe7

Browse files
committed
Update DevOps
1 parent df1b6bb commit 6aecbe7

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

openshift/kustomize/tekton/base/tasks/build-all.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ spec:
242242
[dockerfile]="/tools/elastic/migration/Dockerfile"
243243
)
244244
245+
declare -A COMPONENT21=(
246+
[id]="auto-clipper"
247+
[image]="auto-clipper-service"
248+
[context]=""
249+
[dockerfile]="/services/net/auto-clipper/Dockerfile"
250+
)
251+
245252
declare -n component;
246253
247254
# Loop through each component and build if required.

openshift/kustomize/tekton/base/tasks/deploy-all-deployment.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ spec:
3232
- name: TIMEOUT
3333
description: The timeout before it will stop waiting for the pod to become available.
3434
type: string
35-
default: '600s'
35+
default: "600s"
3636

3737
- name: DEPLOY
3838
description: Whether to deploy a component, or all [*|all|[name]].
39-
default: '*'
39+
default: "*"
4040

4141
- name: WAIT
4242
description: Whether to wait for each service pod to scale back up [yes|no].
43-
default: 'no'
43+
default: "no"
4444
workspaces:
4545
- name: conditions
4646
mountPath: /data
@@ -270,6 +270,16 @@ spec:
270270
[env]="dev test prod"
271271
)
272272
273+
declare -A COMPONENT20=(
274+
[id]="auto-clipper"
275+
[name]="auto-clipper-service"
276+
[type]="deployment"
277+
[replicas]="1"
278+
[action]="stop"
279+
[build]="yes"
280+
[env]="dev test prod"
281+
)
282+
273283
declare -n component;
274284
275285
# ***************************************************

services/net/auto-clipper/AutoClipperManager.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class AutoClipperManager : ServiceManager<AutoClipperOptions>
3737
private readonly WorkOrderStatus[] _ignoreWorkOrders = new WorkOrderStatus[] { WorkOrderStatus.Completed, WorkOrderStatus.Cancelled };
3838
private int _retries = 0;
3939
private string? _etag = null;
40+
private API.Areas.Editor.Models.Tag.TagModel[]? _tags = [];
4041
#endregion
4142

4243
#region Properties
@@ -317,13 +318,13 @@ private async Task<string> DownloadS3File(string? s3Path)
317318
using (var fileStream = new FileStream(tmpFilePath, FileMode.Create, FileAccess.Write))
318319
{
319320
s3FileStream.CopyTo(fileStream);
320-
this.Logger.LogDebug($"S3 file {s3Path} is downloaded to: {tmpFilePath}");
321+
this.Logger.LogDebug("S3 file {path} is downloaded to: {file}", s3Path, tmpFilePath);
321322
return tmpFilePath;
322323
}
323324
}
324325
else
325326
{
326-
this.Logger.LogError($"Cannot download file {s3Path} from S3");
327+
this.Logger.LogError("Cannot download file {file} from S3", s3Path);
327328
}
328329
}
329330
else
@@ -450,6 +451,14 @@ private async Task ProcessClipRequestAsync(ClipRequestModel request, ContentMode
450451
await this.Api.UpdateContentAsync(content);
451452
this.Logger.LogInformation("Primary transcript updated. Content ID: {Id}", requestContentId);
452453

454+
// Fetch tags once for all clips from the API.
455+
var tagsResponse = await this.Api.GetTagsResponseWithEtagAsync(_etag ?? "");
456+
if (tagsResponse != null && tagsResponse.StatusCode == System.Net.HttpStatusCode.OK)
457+
{
458+
_tags = await this.Api.GetResponseDataAsync<API.Areas.Editor.Models.Tag.TagModel[]>(tagsResponse);
459+
_etag = this.Api.GetResponseEtag(tagsResponse);
460+
}
461+
453462
var clipIndex = 1;
454463
foreach (var definition in clipDefinitions)
455464
{
@@ -573,10 +582,7 @@ private async Task<ContentModel> BuildClipContentModelAsync(ContentModel sourceC
573582
? $"Clip covering {FormatTimestamp(definition.Start)} to {FormatTimestamp(definition.End)}"
574583
: definition.Summary;
575584

576-
var tagsResponse = await this.Api.GetTagsResponseWithEtagAsync(_etag ?? "");
577-
var allTags = await this.Api.GetResponseDataAsync<API.Areas.Editor.Models.Tag.TagModel[]>(tagsResponse);
578-
_etag = this.Api.GetResponseEtag(tagsResponse);
579-
var autoTags = allTags?.Where(t => this.Options.ApplyTags.Contains(t.Code));
585+
var autoTags = _tags?.Where(t => this.Options.ApplyTags.Contains(t.Code));
580586
var tags = autoTags != null ? sourceContent.Tags.AppendRange(autoTags.Select(at => new ContentTagModel(at.Id, at.Code, at.Name))) : sourceContent.Tags;
581587

582588
return new ContentModel

0 commit comments

Comments
 (0)