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

feat: Helm async deploy Devtron Apps #4045

Merged
merged 58 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a8b50fd
wip: refactored deployment code
Ash-exp Oct 9, 2023
091f113
feat: helm async install for devtron apps
Ash-exp Oct 9, 2023
e7802ee
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 9, 2023
6fbe666
updated: pubsub lib version
Ash-exp Oct 9, 2023
9786c0f
removed unnecessary comments
Ash-exp Oct 9, 2023
61968e9
removed: unnecessary code
Ash-exp Oct 10, 2023
2a76b77
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 10, 2023
0ba51de
feat: deployment cron updated
Ash-exp Oct 10, 2023
a88b62c
updated: review comments
Ash-exp Oct 10, 2023
11157af
refactored: deployment status cron job logic
Ash-exp Oct 11, 2023
bffcbb0
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 11, 2023
f1a9c55
updated: runner states for deployment
Ash-exp Oct 11, 2023
d9bb5d8
fixed: unable to update cdWorkflowRunner
Ash-exp Oct 11, 2023
63d9923
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 12, 2023
3023319
chore: main merge
Ash-exp Oct 12, 2023
9d06bfe
updated: cdWfr for gitops deployment
Ash-exp Oct 13, 2023
5217ce3
fixed: cdWfr skipped status list
Ash-exp Oct 13, 2023
cd88d1d
fixed: test file arguments
Ash-exp Oct 13, 2023
c433178
fixed: handled for event redelivery case
Ash-exp Oct 13, 2023
d8ebf23
used the constant
Ash-exp Oct 13, 2023
c3a46ba
handling for context deadline exceeded
Ash-exp Oct 13, 2023
0401195
updated: context deadline error expression
Ash-exp Oct 13, 2023
b59543b
handled: error in unmarshalling
Ash-exp Oct 13, 2023
a53ac2c
fixed: context deadline error in cdWfr
Ash-exp Oct 13, 2023
8c68538
handled: pending-install state
Ash-exp Oct 16, 2023
fed6eeb
chore: main merge
Ash-exp Oct 19, 2023
f69e92e
feat: helm install/upgrade with ctx
Ash-exp Oct 20, 2023
51c48c0
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 20, 2023
97d6c50
handling: nil pointer
Ash-exp Oct 20, 2023
b8f2b1a
updated: error handling
Ash-exp Oct 20, 2023
f83c55e
updated: error message
Ash-exp Oct 20, 2023
940ad76
fixed: updatePreviousDeploymentStatus handling
Ash-exp Oct 20, 2023
5e3ff18
fixed: updatePreviousDeploymentStatus handling
Ash-exp Oct 20, 2023
ea3af2d
feat: refactored
Ash-exp Oct 20, 2023
acfa3ec
chore: main merge
Ash-exp Oct 23, 2023
17fb50f
chore: main merge
Ash-exp Oct 25, 2023
8f74652
updated variable name
Ash-exp Oct 25, 2023
81b15ae
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 26, 2023
9dc6e25
updated default value for env
Ash-exp Oct 26, 2023
6cff43a
updated GetValuesOverrideForTrigger
Ash-exp Oct 26, 2023
2f7b842
updated GetValuesOverrideForTrigger
Ash-exp Oct 26, 2023
88018fd
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 26, 2023
5df6382
code review comments
kripanshdevtron Oct 30, 2023
ad53ee0
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 30, 2023
243ac2e
incorporated review suggestions
Ash-exp Oct 31, 2023
25f72d4
chore: main merge
Ash-exp Oct 31, 2023
aaad742
Merge branch 'main' into feat-async-install-devtron
Ash-exp Oct 31, 2023
f94a3fa
chore: removed unnecessary env flag
Ash-exp Oct 31, 2023
27c377b
handled: context deadline error
Ash-exp Oct 31, 2023
06f2256
fixed: migration
Ash-exp Oct 31, 2023
fc67c41
fixed: update status in progress
Ash-exp Oct 31, 2023
12560d0
fine-tuned and refactoring
Ash-exp Nov 1, 2023
93aacf9
chore: main merge
Ash-exp Nov 1, 2023
6ff5310
handling for hibernate app
Ash-exp Nov 1, 2023
5b81688
chore: main merge
Ash-exp Nov 16, 2023
0ec86ae
chore: main merge
Ash-exp Nov 16, 2023
add60a9
Merge branch 'main' into feat-async-install-devtron
Ash-exp Nov 20, 2023
115c62a
chore: main merge
Ash-exp Nov 21, 2023
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
9 changes: 8 additions & 1 deletion api/bean/ValuesOverrideRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ type ValuesOverrideRequest struct {
CdWorkflowType WorkflowType `json:"cdWorkflowType,notnull"`
WfrId int `json:"wfrId,notnull"`
CdWorkflowId int `json:"cdWorkflowId"`
PipelineOverrideId int `json:"pipelineOverrideId"` //required for async install/upgrade event;
DeploymentType models.DeploymentType `json:"deploymentType"` //required for async install/upgrade handling; previously if was used internally
UserId int32 `json:"-"`
DeploymentType models.DeploymentType `json:"-"`
EnvId int `json:"-"`
EnvName string `json:"-"`
ClusterId int `json:"-"`
Expand All @@ -80,6 +81,12 @@ type BulkCdDeployEvent struct {
UserId int32 `json:"userId"`
}

type AsyncCdDeployEvent struct {
ValuesOverrideRequest *ValuesOverrideRequest `json:"valuesOverrideRequest"`
TriggeredAt time.Time `json:"triggeredAt"`
TriggeredBy int32 `json:"triggeredBy"`
}

type ReleaseStatusUpdateRequest struct {
RequestId string `json:"requestId"`
NewStatus models.ChartStatus `json:"newStatus"`
Expand Down
16 changes: 7 additions & 9 deletions api/helm-app/HelmAppService.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
type HelmAppService interface {
ListHelmApplications(ctx context.Context, clusterIds []int, w http.ResponseWriter, token string, helmAuth func(token string, object string) bool)
GetApplicationDetail(ctx context.Context, app *AppIdentifier) (*AppDetail, error)
GetApplicationStatus(ctx context.Context, app *AppIdentifier) (string, error)
GetApplicationAndReleaseStatus(ctx context.Context, app *AppIdentifier) (*AppStatus, error)
GetApplicationDetailWithFilter(ctx context.Context, app *AppIdentifier, resourceTreeFilter *ResourceTreeFilter) (*AppDetail, error)
HibernateApplication(ctx context.Context, app *AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)
UnHibernateApplication(ctx context.Context, app *AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)
Expand Down Expand Up @@ -286,8 +286,8 @@ func (impl *HelmAppServiceImpl) GetApplicationDetail(ctx context.Context, app *A
return impl.getApplicationDetail(ctx, app, nil)
}

func (impl *HelmAppServiceImpl) GetApplicationStatus(ctx context.Context, app *AppIdentifier) (string, error) {
return impl.getApplicationStatus(ctx, app)
func (impl *HelmAppServiceImpl) GetApplicationAndReleaseStatus(ctx context.Context, app *AppIdentifier) (*AppStatus, error) {
return impl.getApplicationAndReleaseStatus(ctx, app)
}

func (impl *HelmAppServiceImpl) GetApplicationDetailWithFilter(ctx context.Context, app *AppIdentifier, resourceTreeFilter *ResourceTreeFilter) (*AppDetail, error) {
Expand Down Expand Up @@ -330,12 +330,11 @@ func (impl *HelmAppServiceImpl) getApplicationDetail(ctx context.Context, app *A
return appdetail, err
}

func (impl *HelmAppServiceImpl) getApplicationStatus(ctx context.Context, app *AppIdentifier) (string, error) {
applicationStatus := ""
func (impl *HelmAppServiceImpl) getApplicationAndReleaseStatus(ctx context.Context, app *AppIdentifier) (*AppStatus, error) {
config, err := impl.GetClusterConf(app.ClusterId)
if err != nil {
impl.logger.Errorw("error in fetching cluster detail", "err", err)
return applicationStatus, err
return nil, err
}
req := &AppDetailRequest{
ClusterConfig: config,
Expand All @@ -345,10 +344,9 @@ func (impl *HelmAppServiceImpl) getApplicationStatus(ctx context.Context, app *A
appStatus, err := impl.helmAppClient.GetAppStatus(ctx, req)
if err != nil {
impl.logger.Errorw("error in fetching app status", "err", err)
return applicationStatus, err
return nil, err
}
applicationStatus = appStatus.ApplicationStatus
return applicationStatus, err
return appStatus, err
}

func (impl *HelmAppServiceImpl) GetDeploymentHistory(ctx context.Context, app *AppIdentifier) (*HelmAppDeploymentHistory, error) {
Expand Down
1,087 changes: 570 additions & 517 deletions api/helm-app/applist.pb.go

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions api/helm-app/applist.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ message AppDetail{

message AppStatus{
string applicationStatus = 1;
string ReleaseStatus = 2;
string Description = 3;
google.protobuf.Timestamp LastDeployed = 4;
}

message ReleaseStatus {
Expand Down Expand Up @@ -237,6 +240,7 @@ message UpgradeReleaseRequest {
string valuesYaml = 2;
int32 historyMax = 3;
ChartContent chartContent = 4;
bool RunInCtx = 5;
}

message UpgradeReleaseResponse {
Expand Down Expand Up @@ -295,6 +299,7 @@ message HelmInstallCustomRequest {
string valuesYaml = 1;
ChartContent chartContent = 2;
ReleaseIdentifier releaseIdentifier = 3;
bool RunInCtx = 4;
}

message HelmInstallCustomResponse {
Expand Down
Loading
Loading