Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gzg http bug #5300

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6737b72
fix: bug
mlhiter Dec 9, 2024
34468c5
feat: cannot open
mlhiter Dec 9, 2024
503b0ee
feat: only open can refresh
mlhiter Dec 9, 2024
c4b639a
chore: add version info
mlhiter Dec 9, 2024
eb10660
fix: bug (#5272)
mlhiter Dec 6, 2024
4bd6462
Add monitor info (#5267)
wallyxjh Dec 6, 2024
bd98693
fix: document typo error (#5270)
liangzhaoliang95 Dec 6, 2024
9bbed8b
Update Quick installation of Java Apps.md (#5265)
Raxcl Dec 6, 2024
30b0978
optimize limitrange ephemeral storage (#5260)
bxy4543 Dec 6, 2024
41b3184
feat: support backup selection during database creation (#5252)
zjy365 Dec 9, 2024
1ba0b21
feat: add GPU horizontal pod autoscaling for launchpad (#5277)
zjy365 Dec 10, 2024
cdd8f83
fix: devbox detail icon show bug (#5273)
mlhiter Dec 10, 2024
a3ce023
fix: install remote-ssh manually to unify windsurf and cursor (#5264)
mlhiter Dec 10, 2024
0894cb7
feat: desktop add two beginner tasks (#5279)
zjy365 Dec 10, 2024
dad33d2
feat: cronjob history limit from env (#5249)
zijiren233 Dec 11, 2024
7e67921
fix: reward for real name authentication (#5282)
zjy365 Dec 11, 2024
e71b886
feat: aiproxy v2 (#5269)
zijiren233 Dec 11, 2024
a634e59
fix: version refresh bug (#5284)
mlhiter Dec 12, 2024
3bc13e2
feat: doubao tts (#5285)
zijiren233 Dec 12, 2024
d792259
feat:support ratio 0 (#5286)
xudaotutou Dec 13, 2024
3c5ce84
feat: aiproxy baidu ernie v2 (#5287)
zijiren233 Dec 13, 2024
4c19035
feat: aiproxy ali opensource models (#5288)
zijiren233 Dec 14, 2024
8e5eb28
fix monitor info (#5278)
wallyxjh Dec 16, 2024
3aeb237
update clusterrole (#5292)
nowinkeyy Dec 18, 2024
3453bce
fix: bug
mlhiter Dec 20, 2024
9c25acb
chore: changelog
mlhiter Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions controllers/account/controllers/account_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (

"k8s.io/client-go/rest"

corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/kubernetes"

"github.com/go-logr/logr"
Expand Down Expand Up @@ -117,9 +116,9 @@ func (r *AccountReconciler) syncAccount(ctx context.Context, owner string, userN
if err := r.syncResourceQuotaAndLimitRange(ctx, userNamespace); err != nil {
r.Logger.Error(err, "sync resource resourceQuota and limitRange failed")
}
if err := r.adaptEphemeralStorageLimitRange(ctx, userNamespace); err != nil {
r.Logger.Error(err, "adapt ephemeral storage limitRange failed")
}
//if err := r.adaptEphemeralStorageLimitRange(ctx, userNamespace); err != nil {
// r.Logger.Error(err, "adapt ephemeral storage limitRange failed")
//}
if getUsername(userNamespace) != owner {
return nil, nil
}
Expand All @@ -146,22 +145,22 @@ func (r *AccountReconciler) syncResourceQuotaAndLimitRange(ctx context.Context,
return nil
}

func (r *AccountReconciler) adaptEphemeralStorageLimitRange(ctx context.Context, nsName string) error {
limit := resources.GetDefaultLimitRange(nsName, nsName)
return retry.Retry(10, 1*time.Second, func() error {
_, err := controllerutil.CreateOrUpdate(ctx, r.Client, limit, func() error {
if len(limit.Spec.Limits) == 0 {
limit = resources.GetDefaultLimitRange(nsName, nsName)
}
limit.Spec.Limits[0].DefaultRequest[corev1.ResourceEphemeralStorage] = resources.LimitRangeDefault[corev1.ResourceEphemeralStorage]
limit.Spec.Limits[0].Default[corev1.ResourceEphemeralStorage] = resources.LimitRangeDefault[corev1.ResourceEphemeralStorage]
//if _, ok := limit.Spec.Limits[0].Default[corev1.ResourceEphemeralStorage]; !ok {
//}
return nil
})
return err
})
}
//func (r *AccountReconciler) adaptEphemeralStorageLimitRange(ctx context.Context, nsName string) error {
// limit := resources.GetDefaultLimitRange(nsName, nsName)
// return retry.Retry(10, 1*time.Second, func() error {
// _, err := controllerutil.CreateOrUpdate(ctx, r.Client, limit, func() error {
// if len(limit.Spec.Limits) == 0 {
// limit = resources.GetDefaultLimitRange(nsName, nsName)
// }
// limit.Spec.Limits[0].DefaultRequest[corev1.ResourceEphemeralStorage] = resources.LimitRangeDefault[corev1.ResourceEphemeralStorage]
// limit.Spec.Limits[0].Default[corev1.ResourceEphemeralStorage] = resources.LimitRangeDefault[corev1.ResourceEphemeralStorage]
// //if _, ok := limit.Spec.Limits[0].Default[corev1.ResourceEphemeralStorage]; !ok {
// //}
// return nil
// })
// return err
// })
//}

// SetupWithManager sets up the controller with the Manager.
func (r *AccountReconciler) SetupWithManager(mgr ctrl.Manager, rateOpts controller.Options) error {
Expand Down
25 changes: 25 additions & 0 deletions controllers/objectstorage/deploy/manifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,31 @@ rules:
- get
- patch
- update
- apiGroups:
- ''
resources:
- resourcequotas
verbs:
- get
- patch
- update
- create
- delete
- watch
- list
- apiGroups:
- ''
resources:
- resourcequotas/status
verbs:
- get
- patch
- update
- create
- delete
- watch
- list

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
46 changes: 40 additions & 6 deletions controllers/pkg/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,14 @@ const (
QuotaLimitsNodePorts = "QUOTA_LIMITS_NODE_PORTS"
QuotaObjectStorageSize = "QUOTA_OBJECT_STORAGE_SIZE"
QuotaObjectStorageBucket = "QUOTA_OBJECT_STORAGE_BUCKET"

LimitRangeCPU = "LIMIT_RANGE_CPU"
LimitRangeMemory = "LIMIT_RANGE_MEMORY"
LimitRangeEphemeralStorage = "LIMIT_RANGE_EPHEMERAL_STORAGE"

LimitRangeRepCPU = "LIMIT_RANGE_REP_CPU"
LimitRangeRepMemory = "LIMIT_RANGE_REP_MEMORY"
LimitRangeRepEphemeralStorage = "LIMIT_RANGE_REP_EPHEMERAL_STORAGE"
)

const (
Expand Down Expand Up @@ -436,14 +444,40 @@ func DefaultLimitRangeLimits() []corev1.LimitRangeItem {
return []corev1.LimitRangeItem{
{
Type: corev1.LimitTypeContainer,
Default: LimitRangeDefault,
DefaultRequest: LimitRangeDefault,
Default: defaultLimitRange,
DefaultRequest: defaultLimitRangeReq,
},
}
}

var LimitRangeDefault = corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("50m"),
corev1.ResourceMemory: resource.MustParse("64Mi"),
corev1.ResourceEphemeralStorage: resource.MustParse("100Mi"),
var defaultLimitRange, defaultLimitRangeReq = getLimitRangeDefault(), getLimitRangeReq()

func getLimitRangeDefault() corev1.ResourceList {
rcList := corev1.ResourceList{}
cpu, memory, ephemeralStorage := resource.MustParse(env.GetEnvWithDefault(LimitRangeCPU, "50m")), resource.MustParse(env.GetEnvWithDefault(LimitRangeMemory, "64Mi")), resource.MustParse(env.GetEnvWithDefault(LimitRangeEphemeralStorage, "100Mi"))
if !cpu.IsZero() {
rcList[corev1.ResourceCPU] = cpu
}
if !memory.IsZero() {
rcList[corev1.ResourceMemory] = memory
}
if !ephemeralStorage.IsZero() {
rcList[corev1.ResourceEphemeralStorage] = ephemeralStorage
}
return rcList
}

func getLimitRangeReq() corev1.ResourceList {
rcList := corev1.ResourceList{}
cpu, memory, ephemeralStorage := resource.MustParse(env.GetEnvWithDefault(LimitRangeRepCPU, "50m")), resource.MustParse(env.GetEnvWithDefault(LimitRangeRepMemory, "64Mi")), resource.MustParse(env.GetEnvWithDefault(LimitRangeRepEphemeralStorage, "100Mi"))
if !cpu.IsZero() {
rcList[corev1.ResourceCPU] = cpu
}
if !memory.IsZero() {
rcList[corev1.ResourceMemory] = memory
}
if !ephemeralStorage.IsZero() {
rcList[corev1.ResourceEphemeralStorage] = ephemeralStorage
}
return rcList
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ description: 了解Sealos系统应用的基本原理与实现,包括Kubernetes

组成:前端系统+Kubernetes API

用户管理 Kbernetes 原生 CronJob 资源,逻辑与应用管理基本相同。
用户管理 Kubernetes 原生 CronJob 资源,逻辑与应用管理基本相同。

## 数据库

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ docker build -t java-demo .
将 `your-dockerhub-username`、`your-repo-name` 和 `your-tag` 替换为实际的值。例如:

```
docker push damager6666/java-demo:v2
docker push damager6666/demo:v2
```

## 步骤7:登陆 Sealos
Expand Down Expand Up @@ -277,4 +277,4 @@ https://tmgkflgdlstl.cloud.sealos.io/getPersons

![](images/java-example-13.png)

- 页面上显示之间插入到数据库的数据 ,表示你的 Java 应用程序已经在 Sealos 上运行
- 页面上显示之间插入到数据库的数据 ,表示你的 Java 应用程序已经在 Sealos 上运行
8 changes: 8 additions & 0 deletions extensions/ide/vscode/devbox/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## [Unreleased]

## [1.3.0] - 2024-12-20

## [1.2.2] - 2024-12-9

### Fixed

- Fix the refresh bug of devbox list view.

## [1.2.1] - 2024-12-4

### Fixed
Expand Down
11 changes: 8 additions & 3 deletions extensions/ide/vscode/devbox/l10n/bundle.l10n.zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Copy Password": "复制密码",
"Copy Connection String": "复制连接串",
"Connection string copied to clipboard!": "连接串已复制到剪贴板!",
"Please select a region,RegionList are added by your each connection.": "请选择一个可用区,可用区来自于您的每个连接。",
"Please select a region,every region are from your each connection.": "请选择一个可用区,可用区来自于您的每个连接。",
"Only Devbox can be opened.": "只能打开 Devbox。",
"Are you sure to delete?": "确定删除Devbox?",
"This action will only delete the devbox ssh config in the local environment.": "此操作只会删除本地环境中的 Devbox SSH 配置。",
Expand All @@ -19,6 +19,11 @@
"Open in Browser": "在浏览器中打开",
"Preview in Editor": "在编辑器中预览",
"Open Database Web Terminal": "打开数据库 Web 终端",
"Cursor's Devbox is often not the latest. If there are any issues, please manually install the [plugin](https://marketplace.visualstudio.com/items?itemName=labring.devbox-aio&ssr=false#overview) referenced this [URI](https://www.cursor.com/how-to-install-extension).": "Cursor 的 Devbox 通常不是最新的。如果有任何问题,请手动安装 [插件](https://marketplace.visualstudio.com/items?itemName=labring.devbox-aio&ssr=false#overview) 参考此 [URI](https://www.cursor.com/how-to-install-extension).",
"SSH Port is not correct,maybe your devbox's nodeport is over the limit": "SSH 端口不正确,可能您的 Devbox 的 nodeport 超过了限制"
"The Devbox of Cursor is usually not the latest. If there are any issues, please manually install the [plugin](https://marketplace.visualstudio.com/items?itemName=labring.devbox-aio&ssr=false#overview) referring to this [URI](https://www.cursor.com/how-to-install-extension).": "Cursor 的 Devbox 通常不是最新的。如果有任何问题,请手动安装 [插件](https://marketplace.visualstudio.com/items?itemName=labring.devbox-aio&ssr=false#overview) 参考此 [URI](https://www.cursor.com/how-to-install-extension).",
"SSH Port is not correct,maybe your devbox's nodeport is over the limit": "SSH 端口不正确,可能您的 Devbox 的 nodeport 超过了限制",
"Failed to write SSH configuration": "写入 SSH 配置失败",
"Failed to write SSH private key": "写入 SSH 私钥失败",
"Please install \"Remote - SSH\" extension to connect to a devbox workspace.": "请安装 \"Remote - SSH\" 扩展以连接到 Devbox 工作区。",
"Install": "安装",
"Cancel": "取消"
}
5 changes: 1 addition & 4 deletions extensions/ide/vscode/devbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "devbox-aio",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.2.1",
"version": "1.3.0",
"keywords": [
"devbox",
"remote development",
Expand Down Expand Up @@ -206,9 +206,6 @@
]
}
},
"extensionDependencies": [
"ms-vscode-remote.remote-ssh"
],
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "webpack",
Expand Down
26 changes: 16 additions & 10 deletions extensions/ide/vscode/devbox/src/commands/remoteConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ import { GlobalStateManager } from '../utils/globalStateManager'
import { ensureFileAccessPermission, ensureFileExists } from '../utils/file'
import { modifiedRemoteSSHConfig } from '../utils/remoteSSHConfig'

const message = {
FailedToWriteSSHConfig: vscode.l10n.t('Failed to write SSH configuration'),
FailedToWriteSSHPrivateKey: vscode.l10n.t('Failed to write SSH private key'),
PleaseInstallRemoteSSH: vscode.l10n.t(
'Please install "Remote - SSH" extension to connect to a devbox workspace.'
),
Install: vscode.l10n.t('Install'),
Cancel: vscode.l10n.t('Cancel'),
}

export class RemoteSSHConnector extends Disposable {
constructor(context: vscode.ExtensionContext) {
super()
Expand Down Expand Up @@ -126,7 +136,7 @@ export class RemoteSSHConnector extends Disposable {
}) {
Logger.info(`Connecting to remote SSH: ${args.sshHostLabel}`)

this.ensureRemoteSSHExtInstalled()
await this.ensureRemoteSSHExtInstalled()

const { sshDomain, sshPort, base64PrivateKey, sshHostLabel, workingDir } =
args
Expand Down Expand Up @@ -203,7 +213,7 @@ export class RemoteSSHConnector extends Disposable {
} catch (error) {
Logger.error(`Failed to write SSH configuration: ${error}`)
vscode.window.showErrorMessage(
`Failed to write SSH configuration: ${error}`
`${message.FailedToWriteSSHConfig}: ${error}`
)
}

Expand All @@ -217,7 +227,7 @@ export class RemoteSSHConnector extends Disposable {
} catch (error) {
Logger.error(`Failed to write SSH private key: ${error}`)
vscode.window.showErrorMessage(
`Failed to write SSH private key: ${error}`
`${message.FailedToWriteSSHPrivateKey}: ${error}`
)
}

Expand Down Expand Up @@ -257,11 +267,11 @@ export class RemoteSSHConnector extends Disposable {
return true
}

const install = 'Install'
const cancel = 'Cancel'
const install = message.Install
const cancel = message.Cancel

const action = await vscode.window.showInformationMessage(
'Please install "Remote - SSH" extension to connect to a Gitpod workspace.',
message.PleaseInstallRemoteSSH,
{ modal: true },
install,
cancel
Expand All @@ -271,10 +281,6 @@ export class RemoteSSHConnector extends Disposable {
return false
}

vscode.window.showInformationMessage(
'Installing "ms-vscode-remote.remote-ssh" extension'
)

await vscode.commands.executeCommand(
'extension.open',
'ms-vscode-remote.remote-ssh'
Expand Down
2 changes: 1 addition & 1 deletion extensions/ide/vscode/devbox/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function activate(context: vscode.ExtensionContext) {
const remoteUri = workspaceFolder.uri.authority
const devboxId = remoteUri.replace(/^ssh-remote\+/, '') // devbox = sshHostLabel
const region = GlobalStateManager.getRegion(devboxId)
updateBaseUrl(`http://devbox.${region}`)
updateBaseUrl(`https://devbox.${region}`)
}

// network view
Expand Down
Loading
Loading