devsapp / sae Goto Github PK
View Code? Open in Web Editor NEW阿里云SAE组件
License: MIT License
阿里云SAE组件
License: MIT License
region: cn-hangzhou
namespace: ## 命名空间相关,或者为: auto ## service
config: # auto 或者 一个Object
id: cn-hangzhou:test
name: test-name
description: namespace desc
vpcConfig: # 选填
vpcId: vpc-bxxxxc7pobl
vSwitchId: vsw-bp17xxxxpfg9zr
securityGroupId: sg-bp1xxxxxpzx4db
applications: ## 应用 ## function
- name: test
decription: This is a test description.
code:
packageType: PhpZip # 必填
packageVersion: 0.0.1
packageUrl: test.war # 文件路径
ossConfig: bucket4sae
cpu: 500 # 选填
memory: 1024 # 选填
replicas: 1 # 选填
slb: ## 非必填
Internet: [{ "port": 80, "targetPort": 8080, "protocol": "HTTP" }]
namespace
必须存在,可能为 Object对象或者 auto
autoConfig: auto
id
必须存在 ,需要校验region: cn-hangzhou
name: test
description: This is a test description
namespace: # 选填
id: cn-beijing:test
name: name
description: namespace desc
vpcConfig: # 选填
vpcId: xx
vSwitchId: xx
securityGroupId: xxx
package:
javaWar/javaJar/javaImage
phpZip/phpImage
image
cpu: 500(默认)
memory: 1024(默认)
replicas: 1
slb:
type: Intranet
id: lb-bp1tg0k6d9nqaw7l1****
config:
- port: 80
targetPort: 8080
protocol: TCP
type: FatJar
version: 0.0.1
url: xxxx
jdk: xxx
0.1. 要明确的事情:
检查服务是否开通,没有开通的话调用开通的接口
初步考虑了一个Yaml格式:
edition: 1.0.0
name: hello-world-app
access: "default"
services:
helloworld: # 业务名称/模块名称
component: sae
# actions: # 自定义执行逻辑
# pre-deploy: # 在deploy之前运行
# - run: s build --use-docker --dockerfile ./code/Dockerfile # 要运行的命令行
# path: ./ # 命令行运行的路径
# post-deploy: # 在deploy之后运行
# - run: s versions # 要运行的命令行
# path: ./ # 命令行运行的路径
props: # 组件的属性值
Region: cn-hangzhou
Namespace:
Id: cn-beijing:test
Name: name
Description: desc
Vpc:
Id: vpc-2ze0i263cnn311nvj****
VSwitchId: vsw-bp12mw1f8k3jgygk9****
SecurityGroupId: sg-wz969ngg2e49q5i4****
Ingress:
- Description: desc
SlbId: lb-uf6hucc7inlqrtcq5****
ListenerPort: 80
CertId: 188077086902****_176993d****_181437****_108724****
DefaultRule:
appId: 395b60e4-0550-458d-9c54-a265d036****
containerPort: 8080
Rules:
- appId: 395b60e4-0550-458d-9c54-a265d036****
containerPort: 8080
domain: www.sae.site
path: /path1
Application:
AutoConfig: false
AppName: test
Description: desc
Package:
Type: FatJar
Version: 1.0.0
Url: http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/sae-test.jar
Jdk: Open JDK 8
WebContainer: apache-tomcat-7.0.91
Cpu: 1000
Memory: 1024
Replicas: 1
Command: sleep
CommandArgs: 1d
Envs:
- name: envtmp
value: 0
CustomHostAlias:
- hostName: samplehost
ip: 127.0.0.1
JarStart:
Options: -Xms4G -Xmx4G
Args: custom-args
Liveness:
exec:
command: ["sh","-c","cat /home/admin/start.sh"]
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 2
Readiness:
exec:
command: ["sh","-c","cat /home/admin/start.sh"]
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 2
EdasContainerVersion: 3.5.3
Timezone: Asia/Shanghai
SlsConfigs:
- logDir: /root/logs/hsf.log
PreStop:
exec:
command:
- ["cat","/etc/group"]
PostStart:
exec:
command:
- ["cat","/etc/group"]
WarStartOptions: CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run
ConfigMapMountDesc:
- configMapId: 16
key: test
mountPath: /tmp
TerminationGracePeriodSeconds: 30
PHPConfig:
ArmsConfigLocation: /usr/local/etc/php/conf.d/arms.ini
ConfigLocation: /usr/local/etc/php/php.ini
Config: k1=v1
TomcatConfig:
"port":8080
"contextPath":"/"
"maxThreads":400
"uriEncoding":"ISO-8859-1"
"useBodyEncodingForUri":true}
OSS:
MountDescs:
- "bucketName": "oss-bucket"
"bucketPath": "data/user.data"
"mountPath": "/usr/data/user.data"
"readOnly": true}]
AkId: xxxxxx
OssAkSecret: xxxxxx
Nas:
Id: KSAK****
MountHost: example.com
MountDesc:
- mountPath: /tmp
nasPath: /
AcrAssumeRoleArn: acs:ram::123456789012****:role/adminrole
AssociateEip: true
SLB:
Type: Intranet
SlbId: lb-bp1tg0k6d9nqaw7l1****
Config:
- port: 80
targetPort: 8080
protocol: TCP
这个要和sae的同学一起研究探讨一下
sae 主要的部署分为应用部署以及 slb的部署
但是SLB部署一般不会改动,这里可否将SLB的信息缓存到本地,部署的时候进行对比,再次部署的时候进行skip
edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: sae-app # 项目名称
access: aliyun-release # 秘钥别名
services:
sae-test: # 服务名称
component: devsapp/sae
props:
region: cn-shenzhen
appName: dankun-sae
appDescription: saedemo
code:
imageUrl: registry-vpc.cn-shenzhen.aliyuncs.com/sae-demo-image/consumer:1.0
path: 可以是.jar, war
image: xxx /指定本地镜像
replicas: 1
cpu: 500
memory: 1024
port: 80
targetPort: 8080
关于docker image push到acr,可以参考:https://github.com/devsapp/fc-deploy/blob/e52ce40dcaf2e44f0ab14433272aa7fcc4beafbf/src/lib/fc/function.ts#L291
services:
sae-test: # 服务名称
component: devsapp/sae
props:
application:
region: cn-beijing
port: 8080
slbConfig: auto
logger.output({
})
namespace:
id: cn-hangzhou
name: China East 1 (Hangzhou)
application:
appId: cd58f167-ebda-491f-b0e0-6771c294cb1d
name: test-1
slb:
InternetIp: 121.41.49.27
console: https://sae.console.aliyun.com/#/AppList/AppDetail?appId=cd58f167-ebda-491f-b0e0-6771c294cb1d®ionId=cn-hangzhou&namespaceId=cn-hangzhou
SAE是按照时长收费的,一键启停是非常重要的能力。
一键停止
s stop -y/n
https://next.api.aliyun.com/api/sae/2019-05-06/StopApplication?params={}
一键启动
s start -y/n
https://next.api.aliyun.com/api/sae/2019-05-06/StartApplication?params={}
${regionid}_${namespace}_${appName}.zip
请问是否有完整的Yaml说明
目前的版本像是不支持,请支持下,我这边调用提示如下错误,
s deploy [2024-03-08 22:43:59] [ERROR] - InvalidImageUrl.MissingAcrInstanceIdError: code: 400, The specified domain of ImageUrl is from ACREE, but you are not specified AcrInstanceId.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.