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

Add optimization state to step response #418

Merged
merged 1 commit into from
Feb 5, 2024
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
2 changes: 1 addition & 1 deletion command/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ type EnvConfig struct {
PluginBinaryURI string `envconfig:"DRONE_PLUGIN_BINARY_URI" default:"https://github.com/drone/plugin/releases/download/v0.3.5-beta"`
}
LiteEngine struct {
Path string `envconfig:"DRONE_LITE_ENGINE_PATH" default:"https://github.com/harness/lite-engine/releases/download/v0.5.59/"`
Path string `envconfig:"DRONE_LITE_ENGINE_PATH" default:"https://github.com/harness/lite-engine/releases/download/v0.5.60/"`
EnableMock bool `envconfig:"DRONE_LITE_ENGINE_ENABLE_MOCK"`
MockStepTimeoutSecs int `envconfig:"DRONE_LITE_ENGINE_MOCK_STEP_TIMEOUT_SECS" default:"120"`
}
Expand Down
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
2 changes: 1 addition & 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
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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/harness/lite-engine v0.5.59 h1:/GB2bULaM87GSopTdx4PbNgqv7pduE+hBjc3uAmQSr4=
github.com/harness/lite-engine v0.5.59/go.mod h1:fh48l8VQvTz1RbxQBZ6JbMvqSngaMBJaAmPNXScJGEU=
github.com/harness/lite-engine v0.5.60 h1:XeoqQ1Z0UyICd9TAViBfFkFl3qoO/Za3TSDOBljs2E0=
github.com/harness/lite-engine v0.5.60/go.mod h1:OcY2p9RxEhnj/JeBYQ674ubQrZ2EJW4Qh3dkCowJ97E=
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c=
Expand Down