2022-07-25:xiu是用rust语言编写的流媒体服务器软件项目。k8s安装xiu,drone文件如何写?
2022-07-25:xiu是用rust语言编写的流媒体服务器软件项目。k8s安装xiu,drone文件如何写?
答案2022-07-25:
云原生环境不可能完全一样,只能做参考。
我采用的是drone,重点是rust编译环境。
drone文件内容如下:
kind: pipeline
type: docker
name: dev
#取消git clone代码
clone:
disable: true
steps:
- name: clone
image: drone/git
pull: if-not-exists
volumes:
- name: cache
path: /etc/hosts
commands:
- git clone http://git.dsy.com/dsygroup/compile-xiu.git .
- git clone https://gitee.com/moonfdd/xiu.git
#- git checkout $DRONE_COMMIT
- name: build
image: rust:latest
pull: if-not-exists
environment:
RUSTUP_DIST_SERVER: https://mirrors.ustc.edu.cn/rust-static
RUSTUP_UPDATE_ROOT: https://mirrors.ustc.edu.cn/rust-static/rustup
volumes:
- name: cache
path: /etc/hosts
commands:
- sed -i "s/【DRONE_COMMIT:0:8】/${DRONE_COMMIT:0:8}/g" .helm/dev/values.yaml
- cp config /usr/local/cargo/config
- cd xiu/application/xiu
- echo $RUSTUP_DIST_SERVER
- echo $RUSTUP_UPDATE_ROOT
- echo $CARGO_HOME
- rustup target add x86_64-unknown-linux-musl
- cargo build --release --target=x86_64-unknown-linux-musl
- cd ../..
- ldd target/x86_64-unknown-linux-musl/release/xiu
- strip -s target/x86_64-unknown-linux-musl/release/xiu
- name: image
image: plugins/docker
pull: if-not-exists
volumes:
- name: cache
path: /etc/hosts
- name: d
path: /var/run/docker.sock
commands:
- docker version
- docker build -f ./MyDockerfile -t dockergit.dsy.com/dsygroup/compile-xiu:${DRONE_COMMIT:0:8} ./xiu
- docker push dockergit.dsy.com/dsygroup/compile-xiu:${DRONE_COMMIT:0:8}
- name: deploy
image: "pelotech/drone-helm3"
pull: if-not-exists
volumes:
- name: cache
path: /etc/hosts
- name: d
path: /var/run/docker.sock
settings:
mode: upgrade
chart: ./.helm/dev
vaules_yaml: ./.helm/dev/values.yaml
release: xiu
namespace: maoaoandemoname
kube_api_server: "https://git.dsy.com:6443"
kube_token:
from_secret: kube_token
skip_tls_verify: true
values:
- image.tag=${DRONE_COMMIT:0:8}
trigger:
branch:
- master
- aaa
volumes:
- name: cache
host:
path: /etc/hosts
- name: d
host:
path: /var/run/docker.sock
dockerfile文件内容如下:
FROM scratch
COPY application/xiu/src/config/config_rtmp.toml /conf/config_rtmp.toml
COPY target/x86_64-unknown-linux-musl/release/xiu /bin/xiu
config文件是设置cargo的国内镜像源,内容如下:
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
helm的内容就不贴在这里了,具体见 码云地址
k8s里暴露的端口如下:
推送视频到k8s里,命令如下:
ffmpeg -i 俄罗斯.mp4 -rtsp_transport tcp -vcodec h264 -acodec aac -f flv rtmp://172.16.11.111:42308/live/test1
运行结果如下:
2022-07-25:xiu是用rust语言编写的流媒体服务器软件项目。k8s安装xiu,drone文件如何写?的更多相关文章
- 2022.07.25 TypeScript基础类型介绍
基础类型: 字符串(string)(String) let first: string = 'niu' // 直接赋值 let fourth: string = `niu` // 模板字符串 let ...
- C语言编写静态链接库及其使用
本篇讲述使用C语言编写静态链接库,而且使用C和C++的方式来调用等. 一.静态库程序:执行时不独立存在,链接到可执行文件或者动态库中,目标程序的归档. 1.用C编写静态库步骤 a.建立项目(Win32 ...
- Rust语言:安全地并发
http://www.csdn.net/article/2014-02-26/2818556-Rust http://www.zhihu.com/question/20032903 Rust是近两年M ...
- Rust语言之HelloWorld Web版
Rust语言之HelloWorld Web版 下面这篇文章值得仔细研读: http://arthurtw.github.io/2014/12/21/rust-anti-sloppy-programmi ...
- Rust语言之HelloWorld
Rust语言之HelloWorld 参考文档: http://doc.crates.io/guide.html 1 什么是Cargo 相当于maven/ant之于java, automake之于c, ...
- Rust语言
Rust语言 https://doc.rust-lang.org/stable/book/ http://www.phperz.com/article/15/0717/141560.html Rust ...
- 【转】对 Rust 语言的分析
对 Rust 语言的分析 Rust 是一门最近比较热的语言,有很多人问过我对 Rust 的看法.由于我本人是一个语言专家,实现过几乎所有的语言特性,所以我不认为任何一种语言是新的.任何“新语言”对我来 ...
- 半个月使用rust语言的体验
从第一次下载rust语言的编译器到今天刚好第14天. 简单说一下对这个语言的感觉吧. 一.性能 把以前用java写的一个中文地址切分的算法,用rust重新实现了一下(https://github.co ...
- Atitit.rust语言特性 attilax 总结
Atitit.rust语言特性 attilax 总结 1. 创建这个新语言的目的是为了解决一个顽疾:软件的演进速度大大低于硬件的演进,软件在语言级别上无法真正利用多核计算带来的性能提升.1 2. 不会 ...
- Rust语言——无虚拟机、无垃圾收集器、无运行时、无空指针/野指针/内存越界/缓冲区溢出/段错误、无数据竞争
2006年,编程语言工程师Graydon Hoare利用业余时间启动了Rust语言项目.该项目充分借鉴了C/C++/Java/Python等语言的经验,试图在保持良好性能的同时,克服以往编程语言所存在 ...
随机推荐
- redis保存数据
转载: https://blog.csdn.net/y510662669/article/details/106677717
- nginx配置反向代理服务器,实现在https网站中请求http资源
网站使用nginx作为服务器,协议从http升级为https的注意事项. 具体升级步骤请点击搜索 1.首先,修改宝塔面板配置 选择配置文件,http请求重定向为https.所有80端口请求都重定向为h ...
- Python爬虫采集商品评价信息--京东
1.数据采集逻辑 在进行数据采集之前,明确哪些数据为所需,制定数据Schema为爬取工作做出要求,并根据数据Schema制定出有针对性的爬取方案和采集逻辑. 2.数据Schema 3.数据爬取 抓取京 ...
- 页面div垂直内容超出后,edge浏览器右侧没有自动出现滚动条
搜索网上解决办法,是给父元素添加样式 overflow-y:scroll; height:100vh; 但此举只是给该父元素侧边添加滚动条,而且不好配合回到顶部这一效果 最后发现是在父组件的包裹元素中 ...
- vue环境安装与配置
https://www.jb51.net/article/251371.htmhttps://www.yht7.com/news/193355 一.下载和安装Vue: https://nodejs.o ...
- proprety详解
property() 函数和@property修饰符. 第一种方法,使用property() 函数: class Person: def __init__(self): self.__name= No ...
- [SpringBoot/JavaEE]SpringBoot启动与停用的4种方式
SpringBoot版本: 2.1.6.RELEASE 1 启动 方式1 – IntelliJ IDEA - Windows 右键启动类SpringBootSampleApplication.java ...
- 补五月四号java基础知识
1.在JDK5中新增了自动包装和自动解包功能:当编译器发现程序再应该使用包装类对象的地方却使用基本数据类型的数据时,编译器将自动把该数据包装为该基本数据对应的包装类的对象,这个过程成为自动包装.如类型 ...
- ILLA Cloud: 调用 Hugging Face Inference Endpoints,开启大模型世界之门
一个月前,我们 宣布了与 ILLA Cloud 与达成的合作,ILLA Cloud 正式支持集成 Hugging Face Hub 上的 AI 模型库和其他相关功能. 今天,我们为大家带来 ILLA ...
- 基于Java实现数据脱敏
用法 Jdk版本 大于等于1.8 maven依赖 <dependency> <groupId>red.zyc</groupId> <artifactId> ...