Skip to content

Commit

Permalink
change multimedia-process-flow-v3 to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
rsonghuster committed Aug 22, 2024
1 parent 214b560 commit 333aa66
Show file tree
Hide file tree
Showing 16 changed files with 505 additions and 321 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/registry-publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
name: publish package to serverless-hub
name: auto try publish all

on:
release:
types: [created]
push:
branches:
- V3
env:
REGISTRY_TOKEN: ${{secrets.ALIBABA_REGISTRY_V3_PUBLISH_TOKEN}}

jobs:
deploy:
auto-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/setup-node@v2
with:
python-version: '3.x'
- uses: actions/setup-node@v1
node-version: 16
registry-url: https://registry.npmjs.org/
- uses: actions/setup-python@v5
with:
node-version: 12
- name: Install dependencies
python-version: '3.10'
- name: install s
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install requests
- name: Publish package
env:
publish_token: ${{ secrets.alibaba_registry_publish_token }}
npm i @serverless-devs/s -g
- name: publish
run: |
ls
python publish.py
python auto-publish.py
37 changes: 37 additions & 0 deletions auto-publish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding=utf-8

import os
import subprocess

os.system("s registry login --token {}".format(os.environ["REGISTRY_TOKEN"]))


def search_publish_yaml(directory):
succ_app_list = []
for root, dirs, files in os.walk(directory):
if "publish.yaml" in files:
d = os.path.join(os.getcwd(), root)
d = d.replace("/./", "/")
cmd = ["s", "registry", "publish"]
result = subprocess.run(
cmd, cwd=d, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
exit_code = result.returncode
print("publish {}; =====> ExitCode={}".format(d, exit_code))

if exit_code != 0:
errMsg = ""
errMsg += result.stdout
errMsg += result.stderr
if "当前版本号应当大于前一次版本号" not in errMsg:
print(errMsg)
else:
succ_app_list.append(d)

print("\n\npublish success app list:\n")
for item in succ_app_list:
print("{} published success".format(item))


# 在当前目录递归搜索
search_publish_yaml(".")
3 changes: 0 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@
- GetSprites: 功能强大雪碧图制作函数 ([案例代码](./ffmpeg-app/src/functions/get_sprites))
- VideoWatermark: 功能强大的视频添加水印功能 ([案例代码](./ffmpeg-app/src/functions/video_watermark))
- [基于 FFmpeg 实现音视频转码](./transcode/src): `s init video-transcode`
- [基于 FFmpeg 实现 HTTP 触发器触发音视频转码](./http-transcode/src): `s init http-video-transcode`
- [基于 FC + Serverless Workflow + OSS + NAS + FFmpeg 实现的弹性高可用、并行处理的视频转码服务](./video-process-flow/src): `s init video-process-flow`
- [对直播视频流截图的应用](./rtmp-snapshot/src): `s init rtmp-snapshot`
- [一个对浏览器全景录制](./headless-ffmpeg/src): `s init headless-ffmpeg`
1 change: 0 additions & 1 deletion update.list

This file was deleted.

15 changes: 6 additions & 9 deletions video-process-flow/hook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@ async function preInit(inputObj) {
}

async function postInit(inputObj) {
console.log(`\n _______ _______ __ __ _______ _______ _______
console.log(`\n _______ _______ __ __ _______ _______ _______
| || || |_| || || || |
| ___|| ___|| || _ || ___|| ___|
| |___ | |___ | || |_| || |___ | | __
| |___ | |___ | || |_| || |___ | | __
| ___|| ___|| || ___|| ___|| || |
| | | | | ||_|| || | | |___ | |_| |
|___| |___| |_| |_||___| |_______||_______|
`)
console.log(`\n Welcome to the ffmpeg-app application
This application requires to open these services:
console.log(`\n Welcome to the multimedia-process-flow-v3 application
This application requires to open these services:
FC : https://fc.console.aliyun.com/
This application can help you quickly deploy the ffmpeg-app project.
The application uses FC component:https://github.com/devsapp/fc
The application homepage: https://github.com/devsapp/start-ffmpeg\n`)
This application can help you quickly deploy the ffmpeg project.
The application uses FC component:https://docs.serverless-devs.com/user-guide/aliyun/#fc3\n`)

const { artTemplate } = inputObj;
artTemplate("code/flows/video-processing-fc.yml");
}

module.exports = {
Expand Down
75 changes: 35 additions & 40 deletions video-process-flow/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Type: Application
Name: video-process-flow
Version: 0.1.6
Edition: 3.0.0
Type: Project
Name: multimedia-process-flow-v3
Version: 0.0.3
Provider:
- 阿里云
Description: 基于 FC + Serverless Workflow + OSS + NAS + FFmpeg 实现的弹性高可用、并行处理的视频转码服务
HomePage: https://github.com/devsapp/start-ffmpeg/tree/master/video-process-flow
HomePage: https://github.com/devsapp/start-ffmpeg/tree/master/multimedia-process-flow
Effective: Public
Tags:
- flow
- ffmpeg
Expand All @@ -18,19 +20,16 @@ Service:
- AliyunFCFullAccess
硬盘挂载:
Authorities:
- AliyunNASFullAccess
VPC:
- AliyunFCServerlessDevsRolePolicy
专有网络:
Authorities:
- AliyunVPCFullAccess
OSS:
- AliyunFCServerlessDevsRolePolicy
对象存储:
Authorities:
- AliyunOSSFullAccess
工作流:
- AliyunFCServerlessDevsRolePolicy
云工作流:
Authorities:
- AliyunFnFFullAccess
其它:
Authorities:
- AliyunECSFullAccess
Parameters:
type: object
additionalProperties: false # 不允许增加其他属性
Expand All @@ -57,14 +56,29 @@ Parameters:
- cn-shenzhen
- ap-southeast-1
- us-west-1
serviceName:
title: 服务名

flowName:
title: 工作流程名称
type: string
default: multimedia-process-flow-${default-suffix}
description: Serverless 工作流流程名称

fnfRoleArn:
title: 工作流 RAM角色ARN
type: string
default: video-process-flow-${default-suffix}
pattern: "^[a-zA-Z_][a-zA-Z0-9-_]{0,127}$"
description: 应用所属的函数计算服务
serviceRoleArn:
title: 函数计算Service RAM角色ARN
default: ""
pattern: "^acs:ram::[0-9]*:role/.*$"
description: 应用所属的工作流需要的 role, 请提前创建好对应的 role, 授信工作流服务, 并配置好 AliyunFCInvocationAccess 和 AliyunFnFFullAccess policy。
required: true
x-role:
name: fnf-execution-default-role
service: FNF
authorities:
- AliyunFCInvocationAccess
- AliyunFnFFullAccess

functionRoleArn:
title: 函数角色
type: string
default: ""
pattern: "^acs:ram::[0-9]*:role/.*$"
Expand All @@ -79,6 +93,7 @@ Parameters:
- AliyunOSSFullAccess
- AliyunFCDefaultRolePolicy
- AliyunFnFFullAccess

ossBucket:
title: 对象存储存储桶名
type: string
Expand Down Expand Up @@ -124,23 +139,3 @@ Parameters:
type: string
default: mp4, flv, avi
description: 转码后的视频格式,如果有需要输出多种格式, 使用逗号分隔

flowName:
title: 工作流程名称
type: string
default: video-process-flow
description: Serverless 工作流流程名称

fnfRoleArn:
title: 工作流 RAM角色ARN
type: string
default: ""
pattern: "^acs:ram::[0-9]*:role/.*$"
description: 应用所属的工作流需要的 role, 请提前创建好对应的 role, 授信工作流服务, 并配置好 AliyunFCInvocationAccess 和 AliyunFnFFullAccess policy。
required: true
x-role:
name: fnf-execution-default-role
service: FNF
authorities:
- AliyunFCInvocationAccess
- AliyunFnFFullAccess
126 changes: 125 additions & 1 deletion video-process-flow/readme.md
7 changes: 0 additions & 7 deletions video-process-flow/src/code/flows/input-fc.json

This file was deleted.

Loading

0 comments on commit 333aa66

Please sign in to comment.