forked from open-edge-platform/scenescape
-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (160 loc) · 8.71 KB
/
update-dlstreamer.yml
File metadata and controls
191 lines (160 loc) · 8.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
---
# SPDX-FileCopyrightText: (C) 2025 - 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: "[Update] DLStreamer Pipeline Server"
run-name: "[Update] DLStreamer Pipeline Server"
on:
schedule:
# Run every Thursday at 10:00 AM UTC
- cron: "0 10 * * 4"
workflow_dispatch: {}
permissions:
contents: read
jobs:
check-and-update:
name: "Check and Update DLStreamer Pipeline Server Version"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Get latest DLStreamer version from DockerHub"
id: dockerhub
run: |
# Get all tags with timestamps
ALL_TAGS=$(curl -s "https://registry.hub.docker.com/v2/repositories/intel/dlstreamer-pipeline-server/tags?page_size=100")
# Get latest stable version (format: YYYY.X.X-ubuntu24) with timestamp
LATEST_STABLE=$(echo "$ALL_TAGS" | jq -r '.results[] | select(.name | test("^[0-9]{4}\\.[0-9]+\\.[0-9]+-ubuntu24$")) | "\(.last_updated)|\(.name)"' | sort -r | head -1)
STABLE_VERSION=$(echo "$LATEST_STABLE" | cut -d'|' -f2)
STABLE_DATE=$(echo "$LATEST_STABLE" | cut -d'|' -f1)
# Get latest weekly version (supports both old and new formats)
# New format: YYYY.X.X-YYYYMMDD-weekly-ubuntu24
# Old format: weekly-YYYY.X-YYYYMMDD-ubuntu24
LATEST_WEEKLY=$(echo "$ALL_TAGS" | jq -r '.results[] | select(.name | test("^(weekly-[0-9]{4}\\.[0-9]+-[0-9]{8}-ubuntu24|[0-9]{4}\\.[0-9]+\\.[0-9]+-[0-9]{8}-weekly-ubuntu24)$")) | "\(.last_updated)|\(.name)"' | sort -r | head -1)
WEEKLY_VERSION=$(echo "$LATEST_WEEKLY" | cut -d'|' -f2)
WEEKLY_DATE=$(echo "$LATEST_WEEKLY" | cut -d'|' -f1)
# Get latest RC version (format: YYYY.X.X-ubuntu24-rcX)
LATEST_RC=$(echo "$ALL_TAGS" | jq -r '.results[] | select(.name | test("^[0-9]{4}\\.[0-9]+\\.[0-9]+-ubuntu24-rc[0-9]+$")) | "\(.last_updated)|\(.name)"' | sort -r | head -1)
RC_VERSION=$(echo "$LATEST_RC" | cut -d'|' -f2)
RC_DATE=$(echo "$LATEST_RC" | cut -d'|' -f1)
echo "latest_stable=${STABLE_VERSION}" >> $GITHUB_OUTPUT
echo "latest_weekly=${WEEKLY_VERSION}" >> $GITHUB_OUTPUT
echo "latest_rc=${RC_VERSION}" >> $GITHUB_OUTPUT
echo "stable_date=${STABLE_DATE}" >> $GITHUB_OUTPUT
echo "weekly_date=${WEEKLY_DATE}" >> $GITHUB_OUTPUT
echo "rc_date=${RC_DATE}" >> $GITHUB_OUTPUT
echo "Latest stable version: ${STABLE_VERSION} (published: ${STABLE_DATE})"
echo "Latest weekly version: ${WEEKLY_VERSION} (published: ${WEEKLY_DATE})"
echo "Latest RC version: ${RC_VERSION} (published: ${RC_DATE})"
# Compare dates and choose the newest among stable, weekly, and RC
SELECTED_VERSION="$STABLE_VERSION"
SELECTED_TYPE="stable"
SELECTED_DATE="$STABLE_DATE"
if [[ -n "$WEEKLY_VERSION" && "$WEEKLY_DATE" > "$SELECTED_DATE" ]]; then
SELECTED_VERSION="$WEEKLY_VERSION"
SELECTED_TYPE="weekly"
SELECTED_DATE="$WEEKLY_DATE"
fi
if [[ -n "$RC_VERSION" && "$RC_DATE" > "$SELECTED_DATE" ]]; then
SELECTED_VERSION="$RC_VERSION"
SELECTED_TYPE="rc"
SELECTED_DATE="$RC_DATE"
fi
echo "Selected: ${SELECTED_TYPE} build (newest)"
if [[ -z "$SELECTED_VERSION" ]]; then
echo "Error: No valid DLStreamer tag found from DockerHub; aborting update." >&2
exit 1
fi
echo "latest_version=${SELECTED_VERSION}" >> $GITHUB_OUTPUT
echo "selected_type=${SELECTED_TYPE}" >> $GITHUB_OUTPUT
- name: "Get current version from repository"
id: current
run: |
# Get version from helm values.yaml
CURRENT_VERSION=$(grep -A 2 "image: intel/dlstreamer-pipeline-server" kubernetes/scenescape-chart/values.yaml | grep "tag:" | head -1 | sed 's/.*tag: "\(.*\)"/\1/')
echo "current_version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
echo "Current version in repo: ${CURRENT_VERSION}"
- name: "Compare versions"
id: compare
run: |
LATEST="${{ steps.dockerhub.outputs.latest_version }}"
CURRENT="${{ steps.current.outputs.current_version }}"
if [ "${LATEST}" != "${CURRENT}" ]; then
echo "update_needed=true" >> $GITHUB_OUTPUT
echo "Update needed: ${CURRENT} -> ${LATEST}"
else
echo "update_needed=false" >> $GITHUB_OUTPUT
echo "No update needed. Already on latest version: ${CURRENT}"
fi
- name: "Update all files"
id: update
if: steps.compare.outputs.update_needed == 'true'
run: |
OLD_VERSION="${{ steps.current.outputs.current_version }}"
NEW_VERSION="${{ steps.dockerhub.outputs.latest_version }}"
echo "Updating from ${OLD_VERSION} to ${NEW_VERSION}"
# Update docker-compose files
find sample_data tests/compose tests/perf_tests/compose tools/ppl_runner \( -name "*.yml" -o -name "*.yaml" \) | while read file; do
if grep -q "intel/dlstreamer-pipeline-server:${OLD_VERSION}" "$file"; then
echo "Updating $file"
sed -i "s|intel/dlstreamer-pipeline-server:${OLD_VERSION}|intel/dlstreamer-pipeline-server:${NEW_VERSION}|g" "$file"
fi
done
# Update Helm values.yaml
if grep -q "${OLD_VERSION}" kubernetes/scenescape-chart/values.yaml; then
echo "Updating kubernetes/scenescape-chart/values.yaml"
sed -i "s|${OLD_VERSION}|${NEW_VERSION}|g" kubernetes/scenescape-chart/values.yaml
fi
# Count files changed
CHANGED_FILES=$(git diff --name-only | wc -l)
echo "changed_files=${CHANGED_FILES}" >> $GITHUB_OUTPUT
echo "Files changed: ${CHANGED_FILES}"
if [ "${CHANGED_FILES}" -gt 0 ]; then
echo "success=true" >> $GITHUB_OUTPUT
echo "Update successful: ${CHANGED_FILES} files modified"
else
echo "success=false" >> $GITHUB_OUTPUT
echo "Warning: No files were changed"
exit 1
fi
- name: "Create Pull Request"
if: |
steps.compare.outputs.update_needed == 'true' &&
steps.update.outputs.success == 'true' &&
steps.update.outputs.changed_files > 0
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GH_PAT }}
commit-message: "DLStreamer: Update intel/dlstreamer-pipeline-server to ${{ steps.dockerhub.outputs.latest_version }}"
title: "[DLStreamer] Update to ${{ steps.dockerhub.outputs.latest_version }}"
body: |
## DLStreamer Pipeline Server Update
This PR updates `intel/dlstreamer-pipeline-server` from `${{ steps.current.outputs.current_version }}` to `${{ steps.dockerhub.outputs.latest_version }}`.
### Available Versions
- **Latest Stable**: `${{ steps.dockerhub.outputs.latest_stable }}` (published: `${{ steps.dockerhub.outputs.stable_date }}`)
- **Latest Weekly**: `${{ steps.dockerhub.outputs.latest_weekly }}` (published: `${{ steps.dockerhub.outputs.weekly_date }}`)
- **Latest RC**: `${{ steps.dockerhub.outputs.latest_rc }}` (published: `${{ steps.dockerhub.outputs.rc_date }}`)
- **Selected**: `${{ steps.dockerhub.outputs.latest_version }}` (${{ steps.dockerhub.outputs.selected_type }} - chosen as the newest available)
### Changes
- Docker Compose files updated
- Helm chart values.yaml updated
### Files Updated
- `sample_data/docker-compose-*.yml`
- `tests/compose/dlstreamer/*.yml`
- `tests/perf_tests/compose/*.yml`
- `tools/ppl_runner/docker-compose-ppl.yaml`
- `kubernetes/scenescape-chart/values.yaml`
### DockerHub Reference
- [Release Notes](https://hub.docker.com/r/intel/dlstreamer-pipeline-server/tags)
- [Image: intel/dlstreamer-pipeline-server:${{ steps.dockerhub.outputs.latest_version }}](https://hub.docker.com/layers/intel/dlstreamer-pipeline-server/${{ steps.dockerhub.outputs.latest_version }}/images)
---
*This PR was automatically created by the DLStreamer update workflow.*
base: ${{ github.ref_name }}
branch: dlstreamer-update-${{ steps.dockerhub.outputs.latest_version }}
delete-branch: true
labels: |
dlstreamer
dependencies
reviewers: |
saratpoluri
dmytroye
tdorauintc