Skip to content

Commit

Permalink
Add optimization state to step response
Browse files Browse the repository at this point in the history
  • Loading branch information
rutvijmehta-harness committed Feb 4, 2024
1 parent 306825e commit 8fd4c96
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 2 deletions.
2 changes: 1 addition & 1 deletion command/harness/dlite/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (t *VMExecuteTask) handleResponse(w http.ResponseWriter, resp *api.PollStep
// convert poll response to a Vm task execution response
func convert(r *api.PollStepResponse) VMTaskExecutionResponse {
if r.Error == "" {
return VMTaskExecutionResponse{CommandExecutionStatus: Success, OutputVars: r.Outputs, Artifact: r.Artifact, Outputs: r.OutputV2}
return VMTaskExecutionResponse{CommandExecutionStatus: Success, OutputVars: r.Outputs, Artifact: r.Artifact, Outputs: r.OutputV2, OptimizationState: r.OptimizationState}
}
return VMTaskExecutionResponse{CommandExecutionStatus: Failure, ErrorMessage: r.Error}
}
1 change: 1 addition & 0 deletions command/harness/dlite/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type VMTaskExecutionResponse struct {
Artifact []byte `json:"artifact,omitempty"`
PoolDriverUsed string `json:"pool_driver_used"`
Outputs []*api.OutputV2 `json:"outputs"`
OptimizationState string `json:"optimization_state"`
}

type DelegateMetaInfo struct {
Expand Down
34 changes: 33 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.0
github.com/google/wire v0.5.0
github.com/harness/lite-engine v0.5.59
github.com/harness/lite-engine v0.5.60-0.20240204202400-bb1a50088cb8
github.com/hashicorp/nomad/api v0.0.0-20230421025320-b4e6a70fe69b
github.com/jmoiron/sqlx v1.3.5
github.com/joho/godotenv v1.5.1
Expand Down Expand Up @@ -53,33 +53,65 @@ require (
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containerd/containerd v1.7.0 // indirect
github.com/corpix/uarand v0.2.0 // indirect
github.com/dgryski/go-lttb v0.0.0-20230207170358-f8fc36cdbff1 // indirect
github.com/docker/docker v23.0.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/s2a-go v0.1.2 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/harness/ti-client v0.0.0-20240201183942-da323b15a6d2 // indirect
github.com/hashicorp/cronexpr v1.1.1 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/icrowley/fake v0.0.0-20221112152111-d7b7e2276db2 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/linkedin/goavro/v2 v2.12.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-zglob v0.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mholt/archiver/v3 v3.5.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nwaples/rardecode v1.1.3 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/shirou/gopsutil/v3 v3.23.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shoenig/test v0.6.4 // indirect
github.com/t-tomalak/logrus-easy-formatter v0.0.0-20190827215021-c074f06c5816 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.10.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
)
Expand Down
Loading

0 comments on commit 8fd4c96

Please sign in to comment.