Comments (2)
Building from dockerfile is a nice feature and it can provide more flexibility to users.
The current build from source is not so optimized. I tried to build the same hello world
program, one is from source
and another is from dockerfile
. For image built from dockerfile, the image size is about 1.9MB. For image built from source, the size is about 260MB. Hopefully, it can be optimized in the future.
A side topic, I want to check if OpenFunction can support customized run image
. The target here is to reduce the image size so that can reduce the cool start time.
Usecase:
for machine learning use cases, there are usually a lot of dependencies like tensorflow, pytorch, opencv etc. The size of these kinds of libraries are quite big (up to 1-2 GB usually) and the actual code is about 1-2 MB (not including the models). If the base libraries can be separated and cached in the host machine, I think that will help to reduce the cool start time.
A similar result is shown in this post for your reference.
An example function yaml:
apiVersion: core.openfunction.io/v1alpha2
kind: Function
metadata:
name: iris-python
spec:
version: "v1.0.0"
image: "lizzzcai/iris-python-func:v0.4.0"
imageCredentials:
name: push-secret
port: 8080
runImage: tensorflow/tensorflow:2.2.3-py3 # dependencies to run the python code
build:
builder: openfunction/builder:v1
env:
FUNC_NAME: "predict"
FUNC_TYPE: "http"
FUNC_SRC: "main.py"
srcRepo:
url: "https://github.com/lizzzcai/openfunction-samples.git"
sourceSubPath: "iris-python"
serving:
runtime: Knative
I can create a feature request for this if needed. Thanks.
from openfunction.
@lizzzcai Thanks for the suggestion!
I think there're two problems here:
- Optimize the image created by cloud-native buildpacks approach to reduce image size
- A method to preload the run image to nodes to reduce the cold start time
You're welcome to create an issue for this!
from openfunction.
Related Issues (20)
- Integration with Apache EventMesh HOT 2
- Delete service when function is deleted HOT 2
- Unable to add annotations to knative service through function
- Implementing Controlled Canary Releases for Function Deployments HOT 8
- cloud-native serverless workflow in openfunction HOT 1
- OpenFunction 1.20 install fail HOT 2
- OpenFunction 1.2.0 imageCredentials pull private images fail HOT 2
- images pull failed HOT 2
- When the function is published, there will be a brief service unavailability HOT 1
- The version of the function is wrong when publishing with the specified function tag. HOT 7
- Adjust the conditions of gateway default listener HOT 2
- 关于 openfunction 异步任务的一些问题 HOT 2
- Failed to install using Helm on EKS HOT 5
- Is OpenFunction compatible with ARM architectures? Like Mac M1s? HOT 4
- How to install openfunction v1.0.0 ? HOT 2
- Build multiarch images
- In dapr standalone mode, keda scaling doesn't work
- Allow Dapr to use http protocol for functions HOT 1
- Consider the use of Dapr Shared for Dapr in standalone mode HOT 2
- Gateway Domain HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfunction.