Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
5ddc7f7d
Commit
5ddc7f7d
authored
Mar 04, 2025
by
Maksim Khadkevich
Committed by
GitHub
Mar 04, 2025
Browse files
feat: moved compoundAI operator, APIserver, and examples (#10)
parent
14ce7e03
Changes
239
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
850 additions
and
0 deletions
+850
-0
deploy/compoundai/operator/api/compoundai/schemasv1/deployment_target.go
...ai/operator/api/compoundai/schemasv1/deployment_target.go
+46
-0
deploy/compoundai/operator/api/compoundai/schemasv1/event.go
deploy/compoundai/operator/api/compoundai/schemasv1/event.go
+41
-0
deploy/compoundai/operator/api/compoundai/schemasv1/kube_pod.go
.../compoundai/operator/api/compoundai/schemasv1/kube_pod.go
+49
-0
deploy/compoundai/operator/api/compoundai/schemasv1/kube_resource.go
...oundai/operator/api/compoundai/schemasv1/kube_resource.go
+26
-0
deploy/compoundai/operator/api/compoundai/schemasv1/label.go
deploy/compoundai/operator/api/compoundai/schemasv1/label.go
+49
-0
deploy/compoundai/operator/api/compoundai/schemasv1/list.go
deploy/compoundai/operator/api/compoundai/schemasv1/list.go
+31
-0
deploy/compoundai/operator/api/compoundai/schemasv1/member.go
...oy/compoundai/operator/api/compoundai/schemasv1/member.go
+29
-0
deploy/compoundai/operator/api/compoundai/schemasv1/model.go
deploy/compoundai/operator/api/compoundai/schemasv1/model.go
+84
-0
deploy/compoundai/operator/api/compoundai/schemasv1/model_repository.go
...dai/operator/api/compoundai/schemasv1/model_repository.go
+44
-0
deploy/compoundai/operator/api/compoundai/schemasv1/msg.go
deploy/compoundai/operator/api/compoundai/schemasv1/msg.go
+27
-0
deploy/compoundai/operator/api/compoundai/schemasv1/organization.go
...poundai/operator/api/compoundai/schemasv1/organization.go
+47
-0
deploy/compoundai/operator/api/compoundai/schemasv1/organization_member.go
.../operator/api/compoundai/schemasv1/organization_member.go
+28
-0
deploy/compoundai/operator/api/compoundai/schemasv1/q.go
deploy/compoundai/operator/api/compoundai/schemasv1/q.go
+66
-0
deploy/compoundai/operator/api/compoundai/schemasv1/resource.go
.../compoundai/operator/api/compoundai/schemasv1/resource.go
+44
-0
deploy/compoundai/operator/api/compoundai/schemasv1/subscription.go
...poundai/operator/api/compoundai/schemasv1/subscription.go
+41
-0
deploy/compoundai/operator/api/compoundai/schemasv1/terminal_record.go
...ndai/operator/api/compoundai/schemasv1/terminal_record.go
+34
-0
deploy/compoundai/operator/api/compoundai/schemasv1/upload.go
...oy/compoundai/operator/api/compoundai/schemasv1/upload.go
+33
-0
deploy/compoundai/operator/api/compoundai/schemasv1/user.go
deploy/compoundai/operator/api/compoundai/schemasv1/user.go
+64
-0
deploy/compoundai/operator/api/compoundai/schemasv1/version.go
...y/compoundai/operator/api/compoundai/schemasv1/version.go
+24
-0
deploy/compoundai/operator/api/compoundai/schemasv1/websocket.go
...compoundai/operator/api/compoundai/schemasv1/websocket.go
+43
-0
No files found.
deploy/compoundai/operator/api/compoundai/schemasv1/deployment_target.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
DeploymentTargetTypeSchema
struct
{
Type
modelschemas
.
DeploymentTargetType
`json:"type" enum:"stable,canary"`
}
type
DeploymentTargetSchema
struct
{
ResourceSchema
DeploymentTargetTypeSchema
Creator
*
UserSchema
`json:"creator"`
Bento
*
BentoFullSchema
`json:"bento"`
CanaryRules
*
modelschemas
.
DeploymentTargetCanaryRules
`json:"canary_rules"`
Config
*
modelschemas
.
DeploymentTargetConfig
`json:"config"`
}
type
DeploymentTargetListSchema
struct
{
BaseListSchema
Items
[]
*
DeploymentTargetSchema
`json:"items"`
}
type
CreateDeploymentTargetSchema
struct
{
DeploymentTargetTypeSchema
BentoRepository
string
`json:"bento_repository"`
Bento
string
`json:"bento"`
CanaryRules
*
modelschemas
.
DeploymentTargetCanaryRules
`json:"canary_rules"`
Config
*
modelschemas
.
DeploymentTargetConfig
`json:"config"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/event.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
(
"time"
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
)
type
EventSchema
struct
{
BaseSchema
Resource
interface
{}
`json:"resource,omitempty"`
Name
string
`json:"name,omitempty"`
Status
modelschemas
.
EventStatus
`json:"status,omitempty"`
OperationName
string
`json:"operation_name,omitempty"`
ApiTokenName
string
`json:"api_token_name,omitempty"`
Creator
*
UserSchema
`json:"creator,omitempty"`
CreatedAt
time
.
Time
`json:"created_at,omitempty"`
ResourceDeleted
bool
`json:"resource_deleted,omitempty"`
}
type
EventListSchema
struct
{
BaseListSchema
Items
[]
*
EventSchema
`json:"items"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/kube_pod.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
(
apiv1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
)
type
KubePodStatusSchema
struct
{
Phase
apiv1
.
PodPhase
`json:"phase"`
Ready
bool
`json:"ready"`
StartTime
*
metav1
.
Time
`json:"start_time"`
IsOld
bool
`json:"is_old"`
IsCanary
bool
`json:"is_canary"`
HostIp
string
`json:"host_ip"`
}
type
KubePodSchema
struct
{
Name
string
`json:"name"`
Namespace
string
`json:"namespace"`
Annotations
map
[
string
]
string
`json:"annotations"`
Labels
map
[
string
]
string
`json:"labels"`
NodeName
string
`json:"node_name"`
RunnerName
*
string
`json:"runner_name"`
DeploymentTarget
*
DeploymentTargetSchema
`json:"deployment_target"`
CommitId
string
`json:"commit_id"`
Status
KubePodStatusSchema
`json:"status"`
RawStatus
apiv1
.
PodStatus
`json:"raw_status"`
PodStatus
modelschemas
.
KubePodStatus
`json:"pod_status"`
Warnings
[]
apiv1
.
Event
`json:"warnings"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/kube_resource.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
type
KubeResourceSchema
struct
{
APIVersion
string
`json:"api_version"`
Kind
string
`json:"kind"`
Name
string
`json:"name"`
Namespace
string
`json:"namespace"`
MatchLabels
map
[
string
]
string
`json:"match_labels"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/label.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
LabelSchema
struct
{
ResourceSchema
Organization
*
OrganizationSchema
`json:"organization"`
Creator
*
UserSchema
`json:"creator"`
ResourceType
modelschemas
.
ResourceType
`json:"resource_type"`
ResourceUid
string
`json:"resource_uid"`
Key
string
`json:"key"`
Value
string
`json:"value"`
}
type
LabelListSchema
struct
{
BaseListSchema
Items
[]
*
LabelSchema
`json:"labels"`
}
type
LabelWithValuesSchema
struct
{
Key
string
`json:"key"`
Values
[]
string
`json:"values"`
}
type
CreateLabelSchema
struct
{
Key
string
`json:"key"`
Value
string
`json:"value"`
}
type
UpdateLabelSchema
struct
{
Value
string
`json:"value"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/list.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
type
BaseListSchema
struct
{
Total
uint
`json:"total"`
Start
uint
`json:"start"`
Count
uint
`json:"count"`
}
type
ListQuerySchema
struct
{
Start
uint
`query:"start"`
Count
uint
`query:"count"`
Search
*
string
`query:"search"`
Q
Q
`query:"q"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/member.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
CreateMembersSchema
struct
{
Usernames
[]
string
`json:"usernames"`
Role
modelschemas
.
MemberRole
`json:"role" enum:"guest,developer,admin"`
}
type
DeleteMemberSchema
struct
{
Username
string
`json:"username"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/model.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
(
"time"
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
)
type
ModelSchema
struct
{
ResourceSchema
ModelUid
string
`json:"model_uid"`
Creator
*
UserSchema
`json:"creator"`
Version
string
`json:"version"`
Description
string
`json:"description"`
ImageBuildStatus
modelschemas
.
ImageBuildStatus
`json:"image_build_status"`
UploadStatus
modelschemas
.
ModelUploadStatus
`json:"upload_status"`
UploadStartedAt
*
time
.
Time
`json:"upload_started_at"`
UploadFinishedAt
*
time
.
Time
`json:"upload_finished_at"`
UploadFinishedReason
string
`json:"upload_finished_reason"`
PresignedUploadUrl
string
`json:"presigned_upload_url"`
PresignedDownloadUrl
string
`json:"presigned_download_url"`
PresignedUrlsDeprecated
bool
`json:"presigned_urls_deprecated"`
TransmissionStrategy
*
modelschemas
.
TransmissionStrategy
`json:"transmission_strategy"`
UploadId
string
`json:"upload_id"`
Manifest
*
modelschemas
.
ModelManifestSchema
`json:"manifest"`
BuildAt
time
.
Time
`json:"build_at"`
}
type
ModelListSchema
struct
{
BaseListSchema
Items
[]
*
ModelSchema
`json:"items"`
}
type
ModelWithRepositorySchema
struct
{
ModelSchema
Repository
*
ModelRepositorySchema
`json:"repository"`
}
type
ModelWithRepositoryListSchema
struct
{
BaseListSchema
Items
[]
*
ModelWithRepositorySchema
`json:"items"`
}
type
ModelFullSchema
struct
{
ModelWithRepositorySchema
Bentos
[]
*
BentoSchema
`json:"bentos"`
}
type
CreateModelSchema
struct
{
Version
string
`json:"version"`
Description
string
`json:"description"`
Manifest
*
modelschemas
.
ModelManifestSchema
`json:"manifest"`
BuildAt
string
`json:"build_at"`
Labels
modelschemas
.
LabelItemsSchema
`json:"labels"`
}
type
UpdateModelSchema
struct
{
Description
string
`json:"description,omitempty"`
Manifest
*
modelschemas
.
ModelManifestSchema
`json:"manifest"`
BuildAt
string
`json:"build_at"`
Labels
*
modelschemas
.
LabelItemsSchema
`json:"labels,omitempty"`
}
type
FinishUploadModelSchema
struct
{
Status
*
modelschemas
.
ModelUploadStatus
`json:"status"`
Reason
*
string
`json:"reason"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/model_repository.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
ModelRepositorySchema
struct
{
ResourceSchema
Creator
*
UserSchema
`json:"creator"`
Organization
*
OrganizationSchema
`json:"organization"`
LatestModel
*
ModelSchema
`json:"latest_model"`
Description
string
`json:"description"`
}
type
ModelRepositoryListSchema
struct
{
BaseListSchema
Items
[]
*
ModelRepositorySchema
`json:"items"`
}
type
CreateModelRepositorySchema
struct
{
Name
string
`json:"name"`
Description
string
`json:"description"`
Labels
modelschemas
.
LabelItemsSchema
`json:"labels"`
}
type
UpdateModelRepositorySchema
struct
{
Description
*
string
`json:"description"`
Labels
*
modelschemas
.
LabelItemsSchema
`json:"labels,omitempty"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/msg.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
type
MsgSchema
struct
{
Message
string
`json:"message"`
}
type
WsMsgSchema
struct
{
Type
string
`json:"type"`
Message
string
`json:"message"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/organization.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
OrganizationSchema
struct
{
ResourceSchema
Creator
*
UserSchema
`json:"creator"`
Description
string
`json:"description"`
}
type
OrganizationFullSchema
struct
{
OrganizationSchema
Config
**
modelschemas
.
OrganizationConfigSchema
`json:"config"`
}
type
OrganizationListSchema
struct
{
BaseListSchema
Items
[]
*
OrganizationSchema
`json:"items"`
}
type
UpdateOrganizationSchema
struct
{
Description
*
string
`json:"description"`
Config
**
modelschemas
.
OrganizationConfigSchema
`json:"config"`
}
type
CreateOrganizationSchema
struct
{
Name
string
`json:"name"`
Description
string
`json:"description"`
Config
*
modelschemas
.
OrganizationConfigSchema
`json:"config"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/organization_member.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
OrganizationMemberSchema
struct
{
BaseSchema
Role
modelschemas
.
MemberRole
`json:"role"`
Creator
*
UserSchema
`json:"creator"`
User
UserSchema
`json:"user"`
Organization
OrganizationSchema
`json:"organization"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/q.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
(
"strings"
"github.com/huandu/xstrings"
)
const
ValueQMe
=
"@me"
const
KeyQKeywords
=
"__keywords"
const
KeyQIn
=
"in"
type
Q
string
func
(
q
Q
)
ToMap
()
map
[
string
]
interface
{}
{
res
:=
map
[
string
]
interface
{}{}
for
_
,
piece
:=
range
strings
.
Split
(
string
(
q
),
" "
)
{
piece
=
strings
.
TrimSpace
(
piece
)
if
piece
==
""
{
continue
}
var
k
string
var
v
string
if
!
strings
.
Contains
(
piece
,
":"
)
{
k
=
KeyQKeywords
v
=
piece
}
else
{
k
,
_
,
v
=
xstrings
.
Partition
(
piece
,
":"
)
if
v
==
""
{
continue
}
if
k
==
"is"
{
res
[
v
]
=
true
continue
}
if
k
==
"not"
{
res
[
v
]
=
false
continue
}
}
v_
,
ok
:=
res
[
k
]
if
!
ok
{
v_
=
make
([]
string
,
0
)
}
v_
=
append
(
v_
.
([]
string
),
v
)
res
[
k
]
=
v_
}
return
res
}
deploy/compoundai/operator/api/compoundai/schemasv1/resource.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
IResourceSchema
interface
{
GetType
()
modelschemas
.
ResourceType
GetName
()
string
}
type
ResourceSchema
struct
{
BaseSchema
Name
string
`json:"name"`
ResourceType
modelschemas
.
ResourceType
`json:"resource_type" enum:"user,organization,cluster,bento_repository,bento,deployment,deployment_revision,model_repository,model,api_token"`
Labels
modelschemas
.
LabelItemsSchema
`json:"labels"`
}
func
(
r
ResourceSchema
)
GetType
()
modelschemas
.
ResourceType
{
return
r
.
ResourceType
}
func
(
r
ResourceSchema
)
GetName
()
string
{
return
r
.
Name
}
func
(
s
*
ResourceSchema
)
TypeName
()
string
{
return
string
(
s
.
ResourceType
)
}
deploy/compoundai/operator/api/compoundai/schemasv1/subscription.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
SubscriptionAction
string
const
(
SubscriptionActionSubscribe
SubscriptionAction
=
"subscribe"
SubscriptionActionUnsubscribe
SubscriptionAction
=
"unsubscribe"
)
type
SubscriptionRespSchema
struct
{
ResourceType
modelschemas
.
ResourceType
`json:"resource_type"`
Payload
interface
{}
`json:"payload"`
}
type
SubscriptionReqSchema
struct
{
WsReqSchema
Payload
*
struct
{
Action
SubscriptionAction
`json:"action"`
ResourceType
modelschemas
.
ResourceType
`json:"resource_type"`
ResourceUids
[]
string
`json:"resource_uids"`
}
`json:"payload"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/terminal_record.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
type
TerminalRecordSchema
struct
{
ResourceSchema
Creator
*
UserSchema
`json:"creator"`
Organization
*
OrganizationSchema
`json:"organization"`
Cluster
*
ClusterSchema
`json:"cluster"`
Deployment
*
DeploymentSchema
`json:"deployment"`
Resource
*
ResourceSchema
`json:"resource"`
PodName
string
`json:"pod_name"`
ContainerName
string
`json:"container_name"`
}
type
TerminalRecordListSchema
struct
{
BaseListSchema
Items
[]
*
TerminalRecordSchema
`json:"items"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/upload.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
type
CompletePartSchema
struct
{
PartNumber
int
`json:"part_number" binding:"required"`
ETag
string
`json:"etag" binding:"required"`
}
type
PreSignMultipartUploadSchema
struct
{
UploadId
string
`json:"upload_id" binding:"required"`
PartNumber
int
`json:"part_number" binding:"required"`
}
type
CompleteMultipartUploadSchema
struct
{
UploadId
string
`json:"upload_id" binding:"required"`
Parts
[]
CompletePartSchema
`json:"parts" binding:"required"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/user.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
import
"github.com/dynemo-ai/dynemo/deploy/compoundai/operator/api/compoundai/modelschemas"
type
UserSchema
struct
{
ResourceSchema
FirstName
string
`json:"first_name"`
LastName
string
`json:"last_name"`
Email
string
`json:"email"`
AvatarUrl
string
`json:"avatar_url"`
IsSuperAdmin
bool
`json:"is_super_admin"`
}
type
UserListSchema
struct
{
BaseListSchema
Items
[]
*
UserSchema
`json:"items"`
}
type
RegisterUserSchema
struct
{
Name
string
`json:"name" validate:"required"`
FirstName
string
`json:"first_name"`
LastName
string
`json:"last_name"`
Email
string
`json:"email" validate:"required"`
Password
string
`json:"password" validate:"required"`
}
type
LoginUserSchema
struct
{
NameOrEmail
string
`json:"name_or_email" validate:"required"`
Password
string
`json:"password" validate:"required"`
}
type
UpdateUserSchema
struct
{
FirstName
string
`json:"first_name" validate:"required"`
LastName
string
`json:"last_name" validate:"required"`
}
type
ResetPasswordSchema
struct
{
CurrentPassword
string
`json:"current_password"`
NewPassword
string
`json:"new_password"`
}
type
CreateUserSchema
struct
{
Name
string
`json:"name" validate:"required"`
Email
string
`json:"email" validate:"required"`
Password
string
`json:"password" validate:"required"`
Role
modelschemas
.
MemberRole
`json:"role" enum:"guest,developer,admin"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/version.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
type
VersionSchema
struct
{
Version
string
`json:"version"`
GitCommit
string
`json:"git_commit"`
BuildDate
string
`json:"build_date"`
}
deploy/compoundai/operator/api/compoundai/schemasv1/websocket.go
0 → 100644
View file @
5ddc7f7d
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
schemasv1
type
WsReqType
string
const
(
WsReqTypeData
WsReqType
=
"data"
WsReqTypeHeartbeat
WsReqType
=
"heartbeat"
)
type
WsReqSchema
struct
{
Type
WsReqType
`json:"type"`
Payload
interface
{}
`json:"payload"`
}
type
WsRespType
string
const
(
WsRespTypeSuccess
WsRespType
=
"success"
WsRespTypeError
WsRespType
=
"error"
)
type
WsRespSchema
struct
{
Type
WsRespType
`json:"type"`
Message
string
`json:"message"`
Payload
interface
{}
`json:"payload"`
}
Prev
1
…
4
5
6
7
8
9
10
11
12
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment