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 external deployment ID #3213

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

jjk2673
Copy link

@jjk2673 jjk2673 commented Sep 23, 2020

In zipdeploy/wardeploy, check incoming headers for a fixed deployment ID, and use it if present.

@dnfadmin
Copy link

dnfadmin commented Sep 23, 2020

CLA assistant check
All CLA requirements met.

@@ -183,6 +183,20 @@ public void Delete(string id)
}
}

if (!string.IsNullOrEmpty(deploymentInfo.FixedDeploymentId))
{
changeSet = new ChangeSet(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not create the original ChangeSet with the appropriate Deployment ID instead of a GUID?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(let's continue this conversation on the kudulite thread)

Comment on lines 71 to 78
string deploymentId = null;
IEnumerable<string> idValues;

if (Request.Headers.TryGetValues(Constants.ScmDeploymentIdHeader, out idValues) && idValues.Count() > 0)
{
deploymentId = idValues.ElementAt(0);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have a helper method for doing this like the StatusCode400() method in this class.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken care of.

{
// Since build is success we need to force restart on windows
// Directly set this instead of Constants.BuildSuccessful
updateStatusObj.DeploymentStatus = Constants.PostBuildRestartRequired;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do this from RestartMainSiteIfNeeded() by substituting old logic. But because Windows flow is not fully implemented, hide it behind an app setting for now.

Requesting a restart here has two problems. 1. We will end up doing a restart even if restart is disabled using /api/publish?restart=false. 2. RestartMainSiteIfNeeded() will do a restart once and we will end up doing another restart here.

@jvano @JasonFreeberg - FYI

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes from 10/12 meeting concerning the above:

  • Adjust the hook to check for the custom deployment ID for code apps. If the custom deployment ID exists, then we don't do the restart callback
  • In that case we know that the client is using the new deployment flow, and the restart will be handled at controller

if (string.IsNullOrEmpty(deploymentInfo.DeploymentId))
{
await RestartMainSiteIfNeeded(tracer, logger, deploymentInfo);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to add this check for DeploymentId along with other checks inside RestartmainSiteIfNeeded. That way RestartmainSiteIfNeeded can be called unconditionally and as the name says - the site will be restarted only if needed.

Also, you may want to consider posting the restart operation to the FE from within RestartMainSiteIfNeeded. RestartmainSiteIfNeeded already has 2 ways of requesting a restart. One way is using a filesystem based notification. Second is using the /api/restart API. The new one being introduced is the third way and unless there is a good reason it would be good to do it from within RestartMainSiteIfNeeded. That way callers can call RestartMainSiteIfNeeded without having to worry about the details. Also - this keeps it consistent with KuduLite.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, make sure that:

  1. /api/publish?restart=false does not trigger a restart (neither the old way nor new way of restarting)
  2. The new restart behavior is enabled only after the controller changes for Windows are live in PROD. Until then, all deployment flows should use the old restart behavior.

@jvano @JasonFreeberg FYI

@suwatch suwatch force-pushed the master branch 2 times, most recently from 39d07e9 to 186dc01 Compare October 21, 2020 16:28
@suwatch suwatch force-pushed the master branch 3 times, most recently from 4b7eb01 to 05c0261 Compare November 16, 2020 04:23
@suwatch suwatch force-pushed the master branch 4 times, most recently from 75ccbe8 to 9c865c3 Compare November 16, 2020 19:29
…ploystatus

Fail silently if call to update deployment status fails
purva-vasudeo and others added 4 commits November 23, 2020 10:10
Return bool to indicate success or failure on db operation through FE
Move first BuildRequestReceived from FE to Kudu
Full proof check if we need to fallback to next restart method throug…
@suwatch
Copy link
Member

suwatch commented Jan 22, 2021

Please squash to one commit and rebase with latest master - let me know when done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants