Skip to content

Commit 8257bc5

Browse files
authored
Merge branch 'main' into 1687-provides-an-audio-processing-sample-app-that-can-run-on-maclinux
2 parents da73b6f + c4332ed commit 8257bc5

File tree

280 files changed

+2272
-1356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+2272
-1356
lines changed

.github/workflows/linux_arm64.yml

Lines changed: 159 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,8 @@ jobs:
111111
python3 tools/version/update_version_in_ten_framework.py
112112
python3 tools/version/check_version_in_ten_framework.py
113113
114-
- name: Update supports
114+
- name: Create out directory
115115
run: |
116-
UPDATE_SUPPORTS_SCRIPT=$(pwd)/tools/supports/update_supports_in_manifest_json.py
117-
118-
ARRAY=(
119-
"core/src/ten_runtime"
120-
"core/src/ten_runtime/binding/go"
121-
"core/src/ten_runtime/binding/python"
122-
"packages/core_addon_loaders/python_addon_loader"
123-
)
124-
125-
for item in "${ARRAY[@]}"; do
126-
python3 ${UPDATE_SUPPORTS_SCRIPT} --os-arch-pairs linux:arm64 --input-file ${item}/manifest.json --output-file ${item}/manifest.json --log-level 1
127-
cat ${item}/manifest.json
128-
done
129-
130116
# Due to the use of QEMU, running as root inside the Docker container
131117
# is required. However, outside the container, the user is not root.
132118
# This causes issues when trying to handle the contents of the out/
@@ -159,12 +145,40 @@ jobs:
159145
apt-get install -y nodejs && \
160146
rustup default nightly-2025-09-18 && \
161147
df -h . && \
162-
tgn gen linux arm64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} log_level=1 enable_serialized_actions=true ten_enable_tests=false ten_rust_enable_tests=false ten_manager_enable_tests=false ten_enable_libwebsockets=false ten_enable_cargo_clean=true ten_enable_rust_incremental_build=false ten_manager_enable_frontend=false ten_enable_integration_tests_prebuilt=false ten_enable_nodejs_binding=false && \
148+
tgn gen linux arm64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} log_level=1 enable_serialized_actions=true ten_enable_tests=false ten_rust_enable_tests=false ten_manager_enable_tests=false ten_enable_libwebsockets=false ten_enable_cargo_clean=true ten_enable_rust_incremental_build=false ten_manager_enable_frontend=false ten_enable_integration_tests_prebuilt=false && \
163149
tgn build linux arm64 ${{ matrix.build_type }} && \
164150
df -h . && \
165151
tree -I 'gen|obj' out \
166152
"
167153
154+
- name: Update supports before upload or publish
155+
continue-on-error: true
156+
run: |
157+
UPDATE_SUPPORTS_SCRIPT=$(pwd)/tools/supports/update_supports_in_manifest_json.py
158+
159+
cd out/linux/arm64/ten_packages
160+
ARRAY=(
161+
"system/ten_runtime"
162+
"system/ten_runtime_go"
163+
"system/ten_runtime_python"
164+
"system/ten_runtime_nodejs"
165+
"addon_loader/python_addon_loader"
166+
"addon_loader/nodejs_addon_loader"
167+
)
168+
169+
for item in "${ARRAY[@]}"; do
170+
echo "Processing item: $item"
171+
if python3 ${UPDATE_SUPPORTS_SCRIPT} --os-arch-pairs linux:arm64 --input-file ${item}/manifest.json --output-file ${item}/manifest.json --log-level 1; then
172+
echo "✓ Successfully updated supports for $item"
173+
cat ${item}/manifest.json
174+
else
175+
echo "✗ Failed to update supports for $item, continuing with next item..."
176+
fi
177+
done
178+
179+
df -h .
180+
shell: bash
181+
168182
- name: Upload tman
169183
uses: actions/upload-artifact@v4
170184
with:
@@ -187,54 +201,151 @@ jobs:
187201
188202
- name: Package assets
189203
if: github.event_name == 'release' || (github.ref != '' && startsWith(github.ref, 'refs/tags/'))
204+
continue-on-error: true
190205
run: |
191206
cd out/linux/arm64
192-
zip -vr tman-linux-arm64-${{ matrix.compiler }}-${{ matrix.build_type }}.zip ten_manager/bin/tman
193-
zip -vr ten_packages-linux-arm64-${{ matrix.compiler }}-${{ matrix.build_type }}.zip \
194-
ten_packages/system/ten_runtime \
195-
ten_packages/system/ten_runtime_go \
196-
ten_packages/system/ten_runtime_python \
197-
ten_packages/extension/default_extension_cpp \
198-
ten_packages/extension/default_extension_go \
199-
ten_packages/extension/default_extension_python \
200-
ten_packages/extension/default_async_extension_python \
201-
ten_packages/addon_loader/python_addon_loader
207+
208+
# Define array of platform-specific packages to package
209+
# (apps and extensions are platform-independent and handled in linux_ubuntu2204.yml)
210+
FILES_TO_PACKAGE=(
211+
"ten_packages/system/ten_runtime"
212+
"ten_packages/system/ten_runtime_go"
213+
"ten_packages/system/ten_runtime_python"
214+
"ten_packages/system/ten_runtime_nodejs"
215+
"ten_packages/addon_loader/python_addon_loader"
216+
"ten_packages/addon_loader/nodejs_addon_loader"
217+
)
218+
219+
# Create zip archive with existing files only
220+
EXISTING_FILES=()
221+
for file in "${FILES_TO_PACKAGE[@]}"; do
222+
if [ -e "$file" ]; then
223+
EXISTING_FILES+=("$file")
224+
echo "✓ Found: $file"
225+
else
226+
echo "✗ Missing: $file (will be skipped)"
227+
fi
228+
done
229+
230+
if [ ${#EXISTING_FILES[@]} -gt 0 ]; then
231+
echo "Creating zip archive with ${#EXISTING_FILES[@]} items..."
232+
zip -vr ten_packages-linux-arm64-${{ matrix.compiler }}-${{ matrix.build_type }}.zip "${EXISTING_FILES[@]}" || {
233+
echo "Warning: zip command failed, but continuing..."
234+
}
235+
else
236+
echo "Warning: No files found to package"
237+
fi
238+
239+
df -h .
240+
shell: bash
202241

203242
- name: Publish to release assets
204243
uses: softprops/action-gh-release@v2
205244
if: github.event_name == 'release' || (github.ref != '' && startsWith(github.ref, 'refs/tags/'))
206245
with:
207246
files: |
208-
out/linux/arm64/tman-linux-arm64-${{ matrix.compiler }}-${{ matrix.build_type }}.zip
209247
out/linux/arm64/ten_packages-linux-arm64-${{ matrix.compiler }}-${{ matrix.build_type }}.zip
210248
249+
- name: Clean up
250+
if: github.event_name == 'release' || (github.ref != '' && startsWith(github.ref, 'refs/tags/'))
251+
continue-on-error: true
252+
run: |
253+
rm -rf out/linux/arm64/ten_packages-linux-arm64-${{ matrix.compiler }}-${{ matrix.build_type }}.zip
254+
255+
df -h .
256+
211257
- name: Publish release to TEN cloud store
212258
if: ${{ (github.event_name == 'release' || (github.ref != '' && startsWith(github.ref, 'refs/tags/'))) && matrix.compiler == 'gcc' && matrix.build_type == 'release' }}
259+
continue-on-error: true
213260
run: |
214261
docker run --rm --platform linux/arm64 \
215262
-v $(pwd):/${{ github.workspace }} -w ${{ github.workspace }} --entrypoint /bin/bash \
216263
ghcr.io/ten-framework/ten_building_ubuntu2204 -c "\
217264
set -x && \
218-
cd out/linux/arm64/ten_packages && \
219-
cd system/ten_runtime && \
220-
identity=\$(../../../ten_manager/bin/tman package --get-identity) && \
221-
echo \$identity && \
222-
../../../ten_manager/bin/tman --verbose --admin-token ${{ secrets.TEN_CLOUD_STORE_ADMIN_TOKEN }} delete \$identity || true && \
223-
../../../ten_manager/bin/tman --verbose --user-token ${{ secrets.TEN_CLOUD_STORE }} publish && cd - && \
224-
cd system/ten_runtime_go && \
225-
identity=\$(../../../ten_manager/bin/tman package --get-identity) && \
226-
echo \$identity && \
227-
../../../ten_manager/bin/tman --verbose --admin-token ${{ secrets.TEN_CLOUD_STORE_ADMIN_TOKEN }} delete \$identity || true && \
228-
../../../ten_manager/bin/tman --verbose --user-token ${{ secrets.TEN_CLOUD_STORE }} publish && cd - && \
229-
cd system/ten_runtime_python && \
230-
identity=\$(../../../ten_manager/bin/tman package --get-identity) && \
231-
echo \$identity && \
232-
../../../ten_manager/bin/tman --verbose --admin-token ${{ secrets.TEN_CLOUD_STORE_ADMIN_TOKEN }} delete \$identity || true && \
233-
../../../ten_manager/bin/tman --verbose --user-token ${{ secrets.TEN_CLOUD_STORE }} publish && cd - && \
234-
cd addon_loader/python_addon_loader && \
235-
identity=\$(../../../ten_manager/bin/tman package --get-identity) && \
236-
echo \$identity && \
237-
../../../ten_manager/bin/tman --verbose --admin-token ${{ secrets.TEN_CLOUD_STORE_ADMIN_TOKEN }} delete \$identity || true && \
238-
../../../ten_manager/bin/tman --verbose --user-token ${{ secrets.TEN_CLOUD_STORE }} publish && cd - \
265+
TMAN_BIN=$(pwd)/out/linux/arm64/ten_manager/bin/tman && \
266+
cd out/linux/arm64 && \
267+
ARRAY=(
268+
\"ten_packages/system/ten_runtime\"
269+
\"ten_packages/system/ten_runtime_go\"
270+
\"ten_packages/system/ten_runtime_python\"
271+
\"ten_packages/system/ten_runtime_nodejs\"
272+
\"ten_packages/addon_loader/python_addon_loader\"
273+
\"ten_packages/addon_loader/nodejs_addon_loader\"
274+
) && \
275+
SUCCESSFUL_PUBLISHES=0 && \
276+
FAILED_PUBLISHES=0 && \
277+
for item in \"\${ARRAY[@]}\"; do
278+
echo \"Processing: \$item\" && \
279+
if [ ! -d \"\$item\" ]; then
280+
echo \"✗ Directory not found: \$item, skipping...\" && \
281+
FAILED_PUBLISHES=\$((FAILED_PUBLISHES + 1)) && \
282+
continue
283+
fi && \
284+
cd \"\$item\" || {
285+
echo \"✗ Failed to enter directory: \$item, skipping...\" && \
286+
FAILED_PUBLISHES=\$((FAILED_PUBLISHES + 1)) && \
287+
continue
288+
} && \
289+
if identity=\$(\\$TMAN_BIN package --get-identity 2>/dev/null); then
290+
echo \"Identity: \$identity\" && \
291+
echo \"Attempting to delete existing package...\" && \
292+
read -r pkg_type pkg_name pkg_version pkg_hash <<< \"\$identity\" && \
293+
\\$TMAN_BIN --verbose --admin-token ${{ secrets.TEN_CLOUD_STORE_ADMIN_TOKEN }} delete \"\$pkg_type\" \"\$pkg_name\" \"\$pkg_version\" \"\$pkg_hash\" || {
294+
echo \"Warning: Failed to delete existing package (this is normal if package doesn't exist)\"
295+
} && \
296+
echo \"Attempting to publish package...\" && \
297+
if \\$TMAN_BIN --verbose --user-token ${{ secrets.TEN_CLOUD_STORE }} publish; then
298+
echo \"✓ Successfully published: \$item\" && \
299+
SUCCESSFUL_PUBLISHES=\$((SUCCESSFUL_PUBLISHES + 1))
300+
else
301+
echo \"✗ Failed to publish: \$item\" && \
302+
FAILED_PUBLISHES=\$((FAILED_PUBLISHES + 1))
303+
fi
304+
else
305+
echo \"✗ Failed to get identity for: \$item\" && \
306+
FAILED_PUBLISHES=\$((FAILED_PUBLISHES + 1))
307+
fi && \
308+
cd - >/dev/null
309+
done && \
310+
echo \"Publication summary: \$SUCCESSFUL_PUBLISHES successful, \$FAILED_PUBLISHES failed\" && \
311+
df -h . \
312+
"
313+
shell: bash
314+
315+
- name: Clean up
316+
if: ${{ (github.event_name == 'release' || (github.ref != '' && startsWith(github.ref, 'refs/tags/'))) && matrix.compiler == 'gcc' && matrix.build_type == 'release' }}
317+
continue-on-error: true
318+
run: |
319+
docker run --rm --platform linux/arm64 \
320+
-v $(pwd):/${{ github.workspace }} -w ${{ github.workspace }} --entrypoint /bin/bash \
321+
ghcr.io/ten-framework/ten_building_ubuntu2204 -c "\
322+
cd out/linux/arm64 && \
323+
ARRAY=(
324+
\"ten_packages/system/ten_runtime\"
325+
\"ten_packages/system/ten_runtime_go\"
326+
\"ten_packages/system/ten_runtime_python\"
327+
\"ten_packages/system/ten_runtime_nodejs\"
328+
\"ten_packages/addon_loader/python_addon_loader\"
329+
\"ten_packages/addon_loader/nodejs_addon_loader\"
330+
) && \
331+
SUCCESSFUL_CLEANUPS=0 && \
332+
FAILED_CLEANUPS=0 && \
333+
for item in \"\${ARRAY[@]}\"; do
334+
echo \"Cleaning up: \$item\" && \
335+
if [ -e \"\$item\" ]; then
336+
if rm -rf \"\$item\"; then
337+
echo \"✓ Successfully removed: \$item\" && \
338+
SUCCESSFUL_CLEANUPS=\$((SUCCESSFUL_CLEANUPS + 1))
339+
else
340+
echo \"✗ Failed to remove: \$item\" && \
341+
FAILED_CLEANUPS=\$((FAILED_CLEANUPS + 1))
342+
fi
343+
else
344+
echo \"• Already absent: \$item\" && \
345+
SUCCESSFUL_CLEANUPS=\$((SUCCESSFUL_CLEANUPS + 1))
346+
fi
347+
done && \
348+
echo \"Cleanup summary: \$SUCCESSFUL_CLEANUPS successful, \$FAILED_CLEANUPS failed\" && \
349+
df -h . \
239350
"
240351
shell: bash

.github/workflows/linux_ubuntu2204.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ jobs:
184184
"system/ten_runtime_python"
185185
"system/ten_runtime_nodejs"
186186
"addon_loader/python_addon_loader"
187+
"addon_loader/nodejs_addon_loader"
187188
)
188189
189190
for item in "${ARRAY[@]}"; do

0 commit comments

Comments
 (0)