Commit Graph

24 Commits (c74ac2faac412c76add41b9654577cf1ebda71a8)

Author SHA1 Message Date
Lingxian Kong c74ac2faac Add scale up ability for function execution
Provide an API to do scale up operation, leave the container
monitoring to orchestrator underlay, although k8s already supports
HPA, but we should not rely on specific container orchestrator
capability for general purpose.

Partially implements: blueprint qingling-autoscaling
Change-Id: Iff1ff646a6df263b2770b8cebc74e80ab18c7613
6 years ago
Jenkins 55a06cfb77 Fix delete function with running job associated
User should not delete a function with running jobs associated.

Change-Id: I627ac7ef057768e7c2d99f56e17da9eacbf4ad76
6 years ago
Lingxian Kong 089f41de2b Support function execution log query
After execution is finished, Qinling provides API to query execution
log for audit, debug or other purposes.

Implements: blueprint qinling-logs
Change-Id: Ie92619bf238c8e72e15c350c65bfbbb88a065f97
6 years ago
Lingxian Kong 13e2d13195 Fix getting update params
Change-Id: I0724417cfe974c23813117cf3733de89f8f5f1c5
6 years ago
Lingxian Kong 16876649e5 Add job update api
By using update api, users could pause/cancel/resume jobs, or change
job execution pattern.

Change-Id: I05103316a91ad79c4d0593c4a02a400aac45a762
6 years ago
Lingxian Kong 30c8e7dd60 Log improvement
Change-Id: Ia7e0dee3820179c22fb8281c62d0a8241b72b718
6 years ago
Lingxian Kong d23551c465 Fully support sync/async execution
Change-Id: I008025f710f8d61eb6f8a4998fe6990abdbc7203
6 years ago
Lingxian Kong 997c78131e Implement periodic task for jobs
Change-Id: I9093333cc9b1a64b5e386af87db80df5aa4dfb4b
6 years ago
Lingxian Kong 5baa3f1e45 Add jobs api
This is part-1 of jobs support in Qinling.

With job API, users can create a job with an existing function
that can be ran in cron job's fashion, but the job definition
has more capabilities than cron.

Change-Id: I0cb885dd6005ba024e3816bae9b79b0d3f35d335
6 years ago
Lingxian Kong 0f7520b88c Python runtime improvement
Change-Id: I8a77324df07c2d98773c20aa04eb81cc54152be3
6 years ago
Lingxian Kong 00885b42ff Add UT for runtime API operation
Partially implements: blueprint add-unit-tests
Change-Id: I2bf92b36e4bee273171bd626638a61e313377a44
6 years ago
Lingxian Kong 992c90e044 Support update runtime
If update image, will send asynchronous request to engine. If some
error happened during update, engine will rollback runtime
automatically.

Change-Id: I1598b1c04427dfdb7d573bbff8dc017f113c2fd2
6 years ago
Lingxian Kong 13f1e6f41e Support function update
Change-Id: Ib184236b28a4aa3684970654f2788c9e3677f822
6 years ago
Lingxian Kong 5587f947f6 Fix function deletion
When deleting function, we should remove all the allocated resources
in the orchestrator, no matter what kind of source the function is
using.

Change-Id: I7ee3d1bb1e6b417194a1b86606f8fcd64cb598cf
6 years ago
Lingxian Kong fa10083c3b Support to sepcify module.function for python function
Currenty, the function entry is hard-coded to be 'main.main' which is
not flexible. This patch adds support for specifying module name and
function name in the code package.

Change-Id: I92ea36f668073f380a4aef4526a6fad321d8cc95
6 years ago
Lingxian Kong 0d3ba2f7c8 Support python function input
For example:
http POST http://127.0.0.1:7070/v1/executions function_id=<FUNCTION_ID> input:='{"param1": "value1"}' X-Auth-Token:<TOKEN>

Change-Id: I04ead79c22ead5720eaab58f456568a7ed9b23b4
6 years ago
Lingxian Kong 75efc2b1ad Add expiry handler for function service
When a package function is executed, a service url is cached so it's
faster when function is executed again. But this will lead to problem
if function is never executed for a long time.

This patch add an expiry machanism which will release resources in
orchestration platform.

Change-Id: I754ebe314d87f6d7c194d9b9c061316f7ba74245
6 years ago
Lingxian Kong d80f3acf35 Support sync/async execution
Invoke a function in sync way means the command will wait until the
execution finish. On the contrary, 'sync=false' means user will get
a response before the function is actually invoked. User could get
execution status using execution ID in the response.

Change-Id: I605ea8414f49d44899e0bc8c36b89e48e335d284
6 years ago
Lingxian Kong 14789ab0c8 Support docker image as function code
Allow user to create function using her own docker image including
all the code and dependencies inside. The image needs to have an
script running as entry point, expecting user's input as params.

This allow users to execute functions written in any language.
6 years ago
Lingxian Kong b79b2791b8 Add swift object support for function creation
With this patch, users can create function using swift object:

http POST http://127.0.0.1:7070/v1/functions name=swift_function \
  runtime_id=xxx \
  code='{"source": "swift", "swift": {"container": "container_name", "object": "object_name"}}'

Implements: blueprint support-swift-object-as-code
6 years ago
Lingxian Kong df32a9f412 Complete basic workflow(Finally!)
- Create runtime
- Create function
- Invoke function(i.e. create execution)
6 years ago
Lingxian Kong 7b6deac2c1 Add runtimes rest api
- Add db layer and db migration support
- Add orchestrator layer, currently only kubernetes supported.
- Now, create/get/delete runtime work fine
6 years ago
Lingxian Kong de9c3e2f7c Add engine service and rpc layer 6 years ago
Lingxian Kong 9492a02bab Initial API code structure 6 years ago