Skip to content

Commit

Permalink
merge coin
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 committed Dec 3, 2024
2 parents b472108 + 3b7316b commit 62e34a7
Show file tree
Hide file tree
Showing 495 changed files with 31,928 additions and 1,276 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
strategy:
matrix:
## TODO: add more modules
module: [database, pay, account, minio, launchpad, exceptionmonitor]
module: [database, pay, account, minio, launchpad, exceptionmonitor, aiproxy]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
strategy:
matrix:
## TODO: add more modules
module: [database, pay, account, minio, launchpad, exceptionmonitor]
module: [database, pay, account, minio, launchpad, exceptionmonitor, aiproxy]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
51 changes: 35 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,49 @@ Sealos['siːləs] is a cloud operating system distribution based on the Kubernet

<img width="916" alt="image" src="https://github.com/labring/sealos/assets/8912557/9e8c1d76-718e-4910-a9ab-94f220a61a9c">

## Create any development environment in sealos with one click

## 🚀 Deploy your app on Sealos
1. [Login in](https://cloud.sealos.run) , open sealos Devbox.

<img width="656" alt="image" src="https://github.com/user-attachments/assets/79692f6c-315f-4363-9426-b41f541f9a55">

2. Create a development env, any language, any framework.

<img width="1147" alt="image" src="https://github.com/user-attachments/assets/6075bbb0-4765-4786-9154-3adaa139900c">

3. Use vscode or cursor access to the Env.

<img width="864" alt="image" src="https://github.com/user-attachments/assets/e5f9dcdc-5149-4e43-aa13-6c17507fbe9f">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/9a985280-6ff2-48dc-83b9-9abd8f93af17">

[Quick Start](https://cloud.sealos.io)
## Create any database on sealos

* [Easily Deploy Nginx in 30 Seconds on Sealos](https://sealos.io/docs/quick-start/use-app-launchpad)
* [Start a mysql/pgsql/mongo highly available database in 30 seconds on Sealos](https://sealos.io/docs/quick-start/use-database)
* [Running WordPress on Sealos](https://sealos.io/docs/examples/blog-platform/install-wordpress)
* [Running the Uptime Kuma dial test system on Sealos](https://docs.sealos.io/docs/examples/dial-testing-system/install-uptime-kuma)
* [Running a low-code platform on Sealos](https://docs.sealos.io/docs/category/low-code-platform)
1. [Login in](https://cloud.sealos.run) , open sealos database.

<img width="567" alt="image" src="https://github.com/user-attachments/assets/74ca3ce9-6ef8-4396-b9c2-7c1940bb7e0c">

![](/docs/4.0/img/sealos-desktop.webp)
2. Create Database.

🔍 Some Screen Shots of Sealos:
<img width="874" alt="image" src="https://github.com/user-attachments/assets/4cc88a54-70e6-458f-9766-4578774e7f81">

<div align="center">
3. Access your database.

| Templates | App Launchpad |
| :---: | :---: |
| ![](/docs/4.0/img/templates.jpg) | ![](/docs/4.0/img/app-launchpad-1.jpg) |
| Database | Serverless |
| ![](/docs/4.0/img/database.jpg) | ![](/docs/4.0/img/laf.jpg) |
<img width="1430" alt="image" src="https://github.com/user-attachments/assets/bcf54218-f4f4-4c89-a107-0bbde6f92d67">

</div>
## Deploy any docker image on sealos

1. [Login in](https://cloud.sealos.run) , open sealos App launchpad.

<img width="567" alt="image" src="https://github.com/user-attachments/assets/5f6481c0-05c6-4892-a096-94b613cee73c">

2. Deploy a docker image, ingress, deployment...

<img width="971" alt="image" src="https://github.com/user-attachments/assets/a291571f-d9fe-42e5-812e-3d8f274a97ca">

3. Access your service.

<img width="1016" alt="image" src="https://github.com/user-attachments/assets/a54884cf-a1e8-4178-88af-655234ec7eef">

## Install

Expand Down
5 changes: 3 additions & 2 deletions controllers/account/api/v1/account_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ type (
const (
// Consumption 消费
Consumption common.Type = iota
// Recharge 充值
Recharge
//Subconsumption 子消费
SubConsumption

TransferIn
TransferOut
ActivityGiving
Expand Down
35 changes: 23 additions & 12 deletions controllers/app/api/v1/template_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type I18nData struct {
Title string `json:"title,omitempty"`
URL string `json:"url,omitempty"`
GitRepo string `json:"gitRepo,omitempty"`
Description string `json:"description,omitempty"`
Readme string `json:"readme,omitempty"`
Icon string `json:"icon,omitempty"`
}

type TemplateType string

const (
Expand Down Expand Up @@ -57,18 +66,20 @@ type InputData struct {
type Inputs map[string]InputData

type TemplateData struct {
Title string `json:"title"`
URL string `json:"url,omitempty"`
GitRepo string `json:"gitRepo,omitempty"`
Author string `json:"author,omitempty"`
Description string `json:"description,omitempty"`
Readme string `json:"readme,omitempty"`
Icon string `json:"icon,omitempty"`
TemplateType TemplateType `json:"templateType"`
Draft bool `json:"draft,omitempty"`
Categories []string `json:"categories,omitempty"`
Defaults Defaults `json:"defaults,omitempty"`
Inputs Inputs `json:"inputs,omitempty"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
GitRepo string `json:"gitRepo,omitempty"`
Author string `json:"author,omitempty"`
Description string `json:"description,omitempty"`
Readme string `json:"readme,omitempty"`
Icon string `json:"icon,omitempty"`
TemplateType TemplateType `json:"templateType"`
Locale string `json:"locale,omitempty"`
I18n map[string]I18nData `json:"i18n,omitempty"`
Draft bool `json:"draft,omitempty"`
Categories []string `json:"categories,omitempty"`
Defaults Defaults `json:"defaults,omitempty"`
Inputs Inputs `json:"inputs,omitempty"`
}

// TemplateSpec defines the desired state of Template
Expand Down
22 changes: 22 additions & 0 deletions controllers/app/api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion controllers/app/config/crd/bases/app.sealos.io_instances.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2023 sealos.
# Copyright © 2024 sealos.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -72,6 +72,23 @@ spec:
type: boolean
gitRepo:
type: string
i18n:
additionalProperties:
properties:
description:
type: string
gitRepo:
type: string
icon:
type: string
readme:
type: string
title:
type: string
url:
type: string
type: object
type: object
icon:
type: string
inputs:
Expand All @@ -89,6 +106,8 @@ spec:
- type
type: object
type: object
locale:
type: string
readme:
type: string
templateType:
Expand Down
21 changes: 20 additions & 1 deletion controllers/app/config/crd/bases/app.sealos.io_templates.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2023 sealos.
# Copyright © 2024 sealos.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -72,6 +72,23 @@ spec:
type: boolean
gitRepo:
type: string
i18n:
additionalProperties:
properties:
description:
type: string
gitRepo:
type: string
icon:
type: string
readme:
type: string
title:
type: string
url:
type: string
type: object
type: object
icon:
type: string
inputs:
Expand All @@ -89,6 +106,8 @@ spec:
- type
type: object
type: object
locale:
type: string
readme:
type: string
templateType:
Expand Down
28 changes: 19 additions & 9 deletions controllers/devbox/internal/controller/helper/devbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ func GenerateDevboxPhase(devbox *devboxv1alpha1.Devbox, podList corev1.PodList)
case corev1.PodPending:
return devboxv1alpha1.DevboxPhasePending
case corev1.PodRunning:
return devboxv1alpha1.DevboxPhaseRunning
if podList.Items[0].Status.ContainerStatuses[0].Ready && podList.Items[0].Status.ContainerStatuses[0].ContainerID != "" {
return devboxv1alpha1.DevboxPhaseRunning
}
return devboxv1alpha1.DevboxPhasePending
}
case devboxv1alpha1.DevboxStateStopped:
if len(podList.Items) == 0 {
Expand Down Expand Up @@ -144,7 +147,7 @@ func GenerateSSHKeyPair() ([]byte, []byte, error) {
func UpdatePredicatedCommitStatus(devbox *devboxv1alpha1.Devbox, pod *corev1.Pod) {
for i, c := range devbox.Status.CommitHistory {
if c.Pod == pod.Name {
devbox.Status.CommitHistory[i].PredicatedStatus = PodPhaseToCommitStatus(pod.Status.Phase)
devbox.Status.CommitHistory[i].PredicatedStatus = PredicateCommitStatus(pod)
break
}
}
Expand Down Expand Up @@ -178,7 +181,7 @@ func UpdateCommitHistory(devbox *devboxv1alpha1.Devbox, pod *corev1.Pod, updateS
if !found {
newCommitHistory := &devboxv1alpha1.CommitHistory{
Pod: pod.Name,
PredicatedStatus: PodPhaseToCommitStatus(pod.Status.Phase),
PredicatedStatus: PredicateCommitStatus(pod),
}
if len(pod.Status.ContainerStatuses) > 0 {
newCommitHistory.ContainerID = pod.Status.ContainerStatuses[0].ContainerID
Expand All @@ -191,14 +194,21 @@ func UpdateCommitHistory(devbox *devboxv1alpha1.Devbox, pod *corev1.Pod, updateS
}
}

func PodPhaseToCommitStatus(podPhase corev1.PodPhase) devboxv1alpha1.CommitStatus {
switch podPhase {
case corev1.PodPending:
func podContainerID(pod *corev1.Pod) string {
if len(pod.Status.ContainerStatuses) > 0 {
return pod.Status.ContainerStatuses[0].ContainerID
}
return ""
}

// PredicateCommitStatus returns the commit status of the pod
// if the pod container id is empty, it means the pod is pending or has't started, we can assume the image has not been committed
// otherwise, it means the pod has been started, we can assume the image has been committed
func PredicateCommitStatus(pod *corev1.Pod) devboxv1alpha1.CommitStatus {
if podContainerID(pod) == "" {
return devboxv1alpha1.CommitStatusPending
case corev1.PodRunning, corev1.PodFailed, corev1.PodSucceeded:
return devboxv1alpha1.CommitStatusSuccess
}
return devboxv1alpha1.CommitStatusUnknown
return devboxv1alpha1.CommitStatusSuccess
}

func PodMatchExpectations(expectPod *corev1.Pod, pod *corev1.Pod) bool {
Expand Down
Loading

0 comments on commit 62e34a7

Please sign in to comment.