Skip to content

Commit

Permalink
Merge branch 'main' into jingyuan/gpu_optimizer
Browse files Browse the repository at this point in the history
Reset benchmark as in main.
  • Loading branch information
Jingyuan Zhang committed Jan 24, 2025
2 parents ca0f020 + 409d87b commit e697adc
Show file tree
Hide file tree
Showing 72 changed files with 4,241 additions and 2,363 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/installation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
docker save aibrix/${{ matrix.image }}:${{ github.sha }} > ${{ matrix.image }}.tar
- name: Upload image artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.image }}-image
path: ${{ matrix.image }}.tar
Expand All @@ -62,7 +62,7 @@ jobs:
uses: actions/checkout@v4

- name: Download all image artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: Install kind
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
jobs:
image-release:
runs-on: ubuntu-latest
needs: [cut-github-release]
permissions:
packages: write
contents: read
steps:
# Checkout the repository
- name: Checkout code
Expand Down Expand Up @@ -122,7 +126,7 @@ jobs:

cut-github-release:
runs-on: ubuntu-latest
needs: [artifact-release]
needs: [python-wheel-release, artifact-release]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
Expand Down
9 changes: 9 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,13 @@ resources:
kind: RayClusterFleet
path: github.com/aibrix/aibrix/api/orchestration/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: aibrix.ai
group: orchestration
kind: KVCache
path: github.com/aibrix/aibrix/api/orchestration/v1alpha1
version: v1alpha1
version: "3"
167 changes: 167 additions & 0 deletions api/orchestration/v1alpha1/kvcache_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/*
Copyright 2024 The Aibrix Team.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// ServiceConfig holds all service configuration about KvCache public facing service
type ServiceConfig struct {
// Type defines the type of service (e.g., ClusterIP, NodePort, LoadBalancer).
// +kubebuilder:validation:Optional
// +kubebuilder:default:="ClusterIP"
Type corev1.ServiceType `json:"type,omitempty"`

// service port
// +kubebuilder:validation:Optional
// +kubebuilder:default:=9600
Port int32 `json:"port,omitempty"`

// NodePort specifies the port on each node on which this service is exposed when using NodePort type.
// +kubebuilder:validation:Optional
NodePort int32 `json:"nodePort,omitempty"`
}

// MetadataConfig holds the configuration about the kv cache metadata service
type MetadataConfig struct {
Redis RedisConfig `json:"redis,omitempty"`
Etcd EtcdConfig `json:"etcd,omitempty"`
}

// RedisConfig provides the configuration fields for deploying Redis.
type RedisConfig struct {
Image string `json:"image"`
Replicas int32 `json:"replicas"`
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
Storage MetadataStorage `json:"storage"`
}

// EtcdConfig provides the configuration fields for deploying etcd.
type EtcdConfig struct {
Image string `json:"image"`
// +kubebuilder:validation:Optional
// +kubebuilder:default:=1
Replicas int32 `json:"replicas"`
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
Storage MetadataStorage `json:"storage"`
}

// MetadataStorage configures the persistent storage used by the metadata service.
type MetadataStorage struct {
Size string `json:"size"`
}

type CacheSpec struct {
// Replicas is the number of kvcache pods to deploy
// +kubebuilder:validation:Required
// +kubebuilder:default:=3
Replicas int `json:"replicas,omitempty"`

// represent the kvcache's image
// +kubebuilder:validation:Optional
// +kubebuilder:default:="aibrix/kvcache:20241120"
Image string `json:"image,omitempty"`

// the policy about pulling image
// +kubebuilder:validation:Optional
// +kubebuilder:default:="IfNotPresent"
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`

// shared memory size for kvcach
// +kubebuilder:validation:Optional
// +kubebuilder:default:=""
SharedMemorySize string `json:"sharedMemorySize,omitempty"`

// kvcache environment configuration
// +kubebuilder:validation:Optional
// +kubebuilder:default:={}
Env []corev1.EnvVar `json:"env,omitempty"`

// the memory resources of kvcache container
// +kubebuilder:validation:Optional
// +kubebuilder:default:="2"
Memory string `json:"memory,omitempty"`

// the cpu resources of kvcache container
// +kubebuilder:validation:Optional
// +kubebuilder:default:="1"
CPU string `json:"cpu,omitempty"`
}

// KVCacheSpec defines the desired state of KVCache
type KVCacheSpec struct {
// Replicas is the number of kv cache pods to deploy
// +kubebuilder:validation:Required
// +kubebuilder:default:=1
Replicas int32 `json:"replicas,omitempty"`

// EtcdReplicas describe the etcd replicas
// +kubebuilder:validation:Optional
// +kubebuilder:default:=1
EtcdReplicas int32 `json:"etcdReplicas,omitempty"`

// Metadata configuration for kv cache service
// +kubebuilder:validation:Optional
// +kubebuilder:default:={etcd: {image: "", replicas: 1, storage: {size: "10Gi"}}}
Metadata MetadataConfig `json:"metadata,omitempty"`

// kvcache dataplane container configuration
// +kubebuilder:validation:Optional
//nolint: lll
// +kubebuilder:default:={image: "aibrix/kvcache:20241120", imagePullPolicy: "IfNotPresent"}
Cache CacheSpec `json:"cacheSpec,omitempty"`

// cache's service
// +kubebuilder:validation:Optional
// +kubebuilder:default:={type: "ClusterIP", port: 9600}
Service ServiceConfig `json:"service,omitempty"`
}

// KVCacheStatus defines the observed state of KVCache
type KVCacheStatus struct {
// Total replicas of current running kv cache instances.
ReadyReplicas int32 `json:"current,omitempty"`
// Represents the kv cache deployment's current state.
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// KVCache is the Schema for the kvcaches API
type KVCache struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec KVCacheSpec `json:"spec,omitempty"`
Status KVCacheStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// KVCacheList contains a list of KVCache
type KVCacheList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []KVCache `json:"items"`
}

func init() {
SchemeBuilder.Register(&KVCache{}, &KVCacheList{})
}
Loading

0 comments on commit e697adc

Please sign in to comment.