使用fun local invoke查看内存使用时文件不存在
cgqdlh opened this issue · comments
cgqdlh commented
➜ ls
index.py template.yml
➜ cat index.py
# -*- coding: utf-8 -*-
import logging
# if you open the initializer feature, please implement the initializer function, as below:
# def initializer(context):
# logger = logging.getLogger()
# logger.info('initializing')
def handler(event, context):
logger = logging.getLogger()
logger.info('hello world')
return 'hello world'
➜ cat template.yml
ROSTemplateFormatVersion: '2015-09-01'
Transform: 'Aliyun::Serverless-2018-04-03'
Resources:
py-event:
Type: 'Aliyun::Serverless::Service'
Properties:
Description: 'helloworld'
py-event:
Type: 'Aliyun::Serverless::Function'
Properties:
Handler: index.handler
Runtime: python3
CodeUri: './'
➜ fun --version
3.6.21
➜ fun local invoke py-event/py-event
using template: template.yml
skip pulling image aliyunfc/runtime-python3.6:1.9.13...
cat: /sys/fs/cgroup/memory/memory.limit_in_bytes: No such file or directory
/var/fc/runtime/python3/mock: line 38: / 1024 / 1024: syntax error: operand expected (error token is "/ 1024 / 1024")
/var/fc/runtime/python3/mock: line 40: [: 15716: unary operator expected
FunctionCompute python3 runtime inited.
FC Invoke Start RequestId: e4a83191-3b10-44ef-ac86-4a3d860f084c
2021-04-16T13:54:48.098Z e4a83191-3b10-44ef-ac86-4a3d860f084c [INFO] hello world
FC Invoke End RequestId: e4a83191-3b10-44ef-ac86-4a3d860f084c
hello worldcat: /sys/fs/cgroup/memory/memory.usage_in_bytes: No such file or directory
/var/fc/runtime/python3/mock: line 132: / 1024 / 1024: syntax error: operand expected (error token is "/ 1024 / 1024")
RequestId: e4a83191-3b10-44ef-ac86-4a3d860f084c Billed Duration: 16 ms Memory Size: MB Max Memory Used: MB