A cloud-native computing framework for serverless query processing.
Requires Go version 1.22.7 or higher.
For example, start MySQL with Docker, and then create the spike
database:
# Download the mysql:8.0.31 image
docker pull mysql:8.0.31
# Start the MySQL instance
docker run --name spike-mysql -e MYSQL_ROOT_PASSWORD=spikepassword -p 3306:3306 -d mysql:8.0.31
# After the MySQL instance starts, enter the MySQL container
docker exec -it mysql-spike mysql -uroot -pspikepassword -e "CREATE DATABASE spike;"
This project uses Git submodules. You need to initialize and update them:
# Initialize submodules
git submodule init
# Update submodules to their latest commits
git submodule update
sh build.sh
To use AWS computing resources, you need to configure AWS credentials. You can use either environment variables or credential files.
Edit spike.yaml
, mainly modify the aws_config
section to match your AWS cluster configuration.
Parameter description:
aws_cluster
: AWS ECS cluster nameaws_subnets
: List of AWS VPC subnet IDs for deploying function instancesaws_security_groups
: List of AWS security group IDs for controlling network access permissionstask_role
: AWS IAM role name for granting function instances access to AWS resourcesec2_provider
: AWS EC2 capacity provider name for providing EC2 instance resources
aws_config:
aws_cluster: spike_cluster_mini
aws_subnets:
- subnet-01930cb57dbc12f7e
- subnet-0c77aae8c226d039c
- subnet-02bd39d1f8b337c22
aws_security_groups:
- sg-02221dbcd555d5277
task_role: PixelsFaaSRole
ec2_provider: Infra-ECS-Cluster-spikeclustermini-d985e674-EC2CapacityProvider-FufGynLGFE0q
cd build
./spike-server -f spike.yaml
Parameter description:
function_name
: Function name, used to uniquely identify a functionimage_url
: Container image URL for the functionresources
: List of function resource configurations, multiple specifications can be configuredcpu
: CPU resource size in millicores (1 core = 1000 millicores)memory
: Memory resource size in MBmin_replica
: Minimum number of replicas, i.e., minimum number of function instancesmax_replica
: Maximum number of replicas, i.e., maximum number of function instances
curl --location 'http://127.0.0.1:8080/v1/create_function' \
--header 'Content-Type: application/json' \
--data '{
"function_name": "test",
"image_url": "013072238852.dkr.ecr.cn-north-1.amazonaws.com.cn/agentguo/test:1.1",
"resources": [
{
"cpu": 8192,
"memory": 32768,
"min_replica": 1,
"max_replica": 5
},
{
"cpu": 4096,
"memory": 16384,
"min_replica": 1,
"max_replica": 5
}
]
}'
Parameter description:
function_name
: Name of the function to callpayload
: Function input parameters, here representing sleep secondscpu
: Required CPU resource size in millicores (1 core = 1000 millicores)memory
: Required memory resource size in MB, set to 0 for default value
curl --location 'http://127.0.0.1:8080/v1/call_function' \
--header 'Content-Type: application/json' \
--data '{
"function_name": "test",
"payload": "3",
"cpu": 8192,
"memory": 0
}'