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

[functionapp] Enable server side build in OryxBuilder #45

Merged
merged 8 commits into from
Jun 14, 2019

Conversation

Hazhzeng
Copy link
Contributor

Overview

  1. Allow Oryx Builder to distinguish Linux Consumption Functionapp Build by "SCM_RUN_FROM_PACKAGE" environment variable.
  2. Default the optimization flag of Linux Consumption Functionapp Build to UseExpressBuild.
  3. Allow Linux Consumption Functionapp Build to upload the built content to a customer's storage account. The package will be uploaded from /home/data/SitePackages/<zip_file> to SCM_RUN_FROM_PACKAGE SAS Uri. (refer to UploadBuiltContent() function)
  4. Allow Linux Consumption Functionapp Build to reset all Service Fabric Mesh container workers. (refer to RemoveAllWorkers() function)

CR Request

@ankitkumarr @maiqbal11 @sanchitmehta

return Task.CompletedTask;
// Detect if package upload is necessary for server side build
if (artifactPath != null)
{
Copy link
Contributor

@ankitkumarr ankitkumarr May 24, 2019

Choose a reason for hiding this comment

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

Please correct me if I am wrong, but looks like artifactPath will never actually be null for any function app. So, this path will always be hit, whether it's consumption or dedicated. We probably only want to hit this condition if we are in Consumption I think. Should we do a check for FunctionAppHelper.HasScmRunFromPackage() here?

Copy link
Contributor

@ankitkumarr ankitkumarr left a comment

Choose a reason for hiding this comment

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

Added a few comments. Looks good overall.

/* TODO: Hazhzeng, uncomment this when "RemoveAllStandardWorker" is out in ANT 83
* string baseUrl = $"http://{websiteHostname}/operations/removeworker/{sitename}/allStandard?token={authTokenEncoded}";
*/
string baseUrl = $"http://{websiteHostname}/operations/removeworker/{sitename}/all?token={authTokenEncoded}";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe https?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The internal call only accepts http protocol. Tried with https, failed to create SSL channel :(

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair


//
// Run express build setups if needed
if (args.Flags == BuildOptimizationsFlags.UseExpressBuild)
{
if (FunctionAppHelper.LooksLikeFunctionApp())
{
SetupFunctionAppExpressArtifacts(context);
artifactPath = SetupFunctionAppExpressArtifacts(context);
Copy link
Contributor

Choose a reason for hiding this comment

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

SetupFunctionAppExpressArtifacts sets packaname.txt and packagepath.txt as well. We probably don't need that for consumption. Maybe we just do the packaging for Consumption, and not use BUILD_FLAGS.

Copy link
Contributor

@ankitkumarr ankitkumarr left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -37,7 +37,7 @@ public LinuxConsumptionInstanceAdminController(ILinuxConsumptionInstanceManager
/// </summary>
/// <returns>Expect 200 when current service is up and running</returns>
[HttpGet]
[Authorize(Policy = AuthPolicyNames.AdminAuthLevel)]
//[Authorize(Policy = AuthPolicyNames.AdminAuthLevel)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to disable the auth here?

Hanzhang Zeng (Roger) added 7 commits June 13, 2019 11:38
Fix using directives
Add TODO to remove all standard workers
Address issues in comment
Rename Linux consumption functionapp related function
Internal call does not require https
Update remove all worker URL
Catch error when SCM_RUN_FROM_PACKAGE is not provided
@Hazhzeng Hazhzeng force-pushed the hazeng-pr4-scmbuild branch from 1ac11e0 to 2ab259f Compare June 13, 2019 18:41
@sanchitmehta sanchitmehta merged commit 3e0f397 into Azure-App-Service:dev Jun 14, 2019
@Hazhzeng Hazhzeng deleted the hazeng-pr4-scmbuild branch July 9, 2020 18:45
Hazhzeng pushed a commit to Hazhzeng/KuduLite that referenced this pull request Jul 20, 2021
…ice#45)

* Enable scm build in oryx builder
Fix using directives
Add TODO to remove all standard workers
Address issues in comment
Rename Linux consumption functionapp related function
Internal call does not require https
Update remove all worker URL
Catch error when SCM_RUN_FROM_PACKAGE is not provided

* Add unit tests for Oryx Factory

* Make SetupLinuxConsumptionFunctionAppDeployment(context).Wait() synchronous

* Remove assignment auth

* Move ScmRunFromPackage from AppSettings to Environment Variables

* Null check for pushdeploymentcontroller.cs

* Reenable Authorize

* Address unit tests
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.

3 participants