Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Folders relative to the root of the repository for each service:
| Runner | runner |
| LogCollector | logcollector |

## Examples
## Function Examples

### Router

Expand Down Expand Up @@ -74,6 +74,10 @@ Folders relative to the root of the repository for each service:
- `runner/component/service.go` implements runner component to trigger deploy process by call knative api.
- `docker/spaces/builder/Dockerfile*` are Dockerfile that builds the space image.

### Cluster

- `component/cluster.go` is a component that deals with cluster-related business logic.

## Code Style & Conventions:

- Each layer's interface should only expose data structures defined within its own layer or common type definitions from the common.types package. For example, interfaces in the Component layer (such as UserComponent) should not return data structures from the underlying database layer (such as database.User structure), as the database layer is considered lower-level than the component layer.
Expand Down
1 change: 1 addition & 0 deletions common/types/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type DeployRes struct {
Status string `json:"status"`
TotalTimeInMin int `json:"total_time_in_min"`
TotalFeeInCents int `json:"total_fee_in_cents"`
SvcName string `json:"svc_name"` // service name of the deployment, used for inference endpoint
}

type NodeResourceInfo struct {
Expand Down
1 change: 1 addition & 0 deletions component/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func (c *clusterComponentImpl) GetDeploys(ctx context.Context, req types.DeployR
Resource: deploy.Hardware,
TotalTimeInMin: totalTime,
TotalFeeInCents: totalFee,
SvcName: deploy.SvcName,
})
}
return res, total, nil
Expand Down
1 change: 1 addition & 0 deletions component/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func TestClusterComponent_GetDeploys(t *testing.T) {
require.Equal(t, "cpu=2,memory=4Gi", res[0].Resource)
require.Equal(t, 200, res[0].TotalTimeInMin)
require.Equal(t, 123, res[0].TotalFeeInCents)
require.Equal(t, "service-1", res[0].SvcName)
}

func TestClusterComponent_GetClusterByID(t *testing.T) {
Expand Down
Loading