执行部署命令后不停的重复打包上传
- Dominant language
- JavaScript
- Stars
- 931
- Forks
- 128
- PR merge metrics
- No merged PRs in 30d
Description
因为包大小超过了 50M,部署时选择使用 NAS
第一次部署,命令行显示是成功的(调用函数报错说找不到 /code/boostrap,但这应该是别的问题了)
后面执行 fun build,再 fun deploy -y,就出现了重复打包上传的问题:
```
...
...
zipping /Users/chaijiaqi/todomato/user-service/target/lib
✔ upload done
unzipping file
✔ unzip done
✔ upload completed!
Fun has automatically uploaded your code dependency to NAS, then fun will use 'fun deploy todomato-user-service/user-function' to redeploy.
Waiting for service todomato-user-service to be deployed...
make sure role 'aliyunfcgeneratedrole-cn-beijing-todomato-user-service' is exist
role 'aliyunfcgeneratedrole-cn-beijing-todomato-user-service' is already exist
attaching police 'AliyunECSNetworkInterfaceManagementAccess' to role: aliyunfcgeneratedrole-cn-beijing-todomato-user-service
attached police 'AliyunECSNetworkInterfaceManagementAccess' to role: aliyunfcgeneratedrole-cn-beijing-todomato-user-service
using 'VpcConfig: Auto', Fun will try to generate related vpc resources automatically
vpc already generated, vpcId is: vpc-2zemuwbvjhwc7a4ptxaol
vswitch already generated, vswitchId is: vsw-2zesmh8og9q73uz4h9nc7
security group already generated, security group is: sg-2ze8mav2o3p0q0q3zeh7
generated auto VpcConfig done: {"vpcId":"vpc-2zemuwbvjhwc7a4ptxaol","vswitchIds":["vsw-2zesmh8og9q73uz4h9nc7"],"securityGroupId":"sg-2ze8mav2o3p0q0q3zeh7"}
using 'NasConfig: Auto', Fun will try to generate related nas file system automatically
nas file system already generated, fileSystemId is: 160df495cd
nas file system mount target is already created, mountTargetDomain is: 160df495cd-cuu21.cn-beijing.nas.aliyuncs.com
generated auto NasConfig done: {"UserId":10003,"GroupId":10003,"MountPoints":[{"ServerAddr":"160df495cd-cuu21.cn-beijing.nas.aliyuncs.com:/todomato-user-service","MountDir":"/mnt/auto"}]}
Checking if nas directories /todomato-user-service exists, if not, it will be created automatically
Checking nas directories done ["/todomato-user-service"]
Waiting for function user-function to be deployed...
Waiting for packaging function user-function code...
warning: funignore is not supported for your CodeUri: /Users/chaijiaqi/todomato/user-service
:zipping ███████[39[32m██████████████ 178/483 161 files/s, 36% 1.9s^C%
```
后面会不停的重复 zipping ... uploading ...
这是一个 Spring Boot 项目,先前使用 fun deploy -y 转换成函数计算
template.yml:
```yml
ROSTemplateFormatVersion: '2015-09-01'
Transform: 'Aliyun::Serverless-2018-04-03'
Resources:
todomato-user-service:
Type: 'Aliyun::Serverless::Service'
Properties:
Description: Hello SpringBoot On FC
NasConfig: Auto
user-function:
Type: 'Aliyun::Serverless::Function'
Properties:
Handler: index.handler
Runtime: custom
CodeUri: ./
InstanceConcurrency: 5
MemorySize: 1024
Timeout: 60
InitializationTimeout: 100
EnvironmentVariables:
CLASSPATH: /mnt/auto/java/*
Events:
http:
Type: HTTP
Properties:
AuthType: ANONYMOUS
Methods:
- GET
- POST
- PUT
Domain:
Type: 'Aliyun::Serverless::CustomDomain'
Properties:
DomainName: todomato.lightmoov.com
Protocol: 'HTTP,HTTPS'
CertConfig:
CertName: TodomatoCertificate
PrivateKey: ./certificates/3951242_todomato.lightmoov.com.key.pem
Certificate: ./certificates/3951242_todomato.lightmoov.com.pem
RouteConfig:
Routes:
/users/*:
ServiceName: todomato-user-service
FunctionName: user-function
/admins/*:
ServiceName: todomato-user-service
FunctionName: user-function
/users:
ServiceName: todomato-user-service
FunctionName: user-function
/admins:
ServiceName: todomato-user-service
FunctionName: user-function
/user-operations:
ServiceName: todomato-user-service
FunctionName: user-function
/token:
ServiceName: todomato-user-service
FunctionName: user-function
/login:
ServiceName: todomato-user-service
FunctionName: user-function
/login/*:
ServiceName: todomato-user-service
FunctionName: user-function
```
boostrap:
```sh
#!/usr/bin/env bash
export PORT=9000
export CLASSPATH="$CLASSPATH:./target/user-service-1.0.jar"
java -Dserver.port=$PORT org.springframework.boot.loader.PropertiesLauncher
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with template.yml, especially CodeUri, NasConfig, and the generated user-function, then reproduce the sequence with fun build followed by fun deploy -y. Trace the packaging and NAS upload flow shown in the deployment output and compare it with the bootstrap entry point. Done means one deployment packages and uploads the code once instead of repeatedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript, shell, spring-boot
- Domain
- backend, cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100