Skip to content

Support deploying app without web server#101

Merged
rujche merged 15 commits into
azure-javaee:feature/sjadfrom
rujche:user-can-deploy-non-web-app-to-aca
Jan 21, 2025
Merged

Support deploying app without web server#101
rujche merged 15 commits into
azure-javaee:feature/sjadfrom
rujche:user-can-deploy-non-web-app-to-aca

Conversation

@rujche

@rujche rujche commented Dec 31, 2024

Copy link
Copy Markdown

Support deploying app without web server

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • cli/azd/resources/scaffold/templates/resources.bicept: Language not supported
  • schemas/alpha/azure.yaml.json: Language not supported
Comments suppressed due to low confidence (1)

cli/azd/internal/appdetect/spring_boot.go:485

  • [nitpick] The function name 'detectDependencyAboutEmbeddedWebServer' is verbose. Consider renaming it to 'detectEmbeddedWebServerDependency' for conciseness.
func detectDependencyAboutEmbeddedWebServer(azdProject *Project, springBootProject *SpringBootProject) {

@rujche

rujche commented Dec 31, 2024

Copy link
Copy Markdown
Author

Please ignore the GitHub action failure:

image

It will be fixed in this PR: #99

image

}

func getJavaApplicationPort(svc appdetect.Project) int {
if svc.Metadata.ContainsDependencySpringCloudEurekaServer {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it possible that users change the port number using properties?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point. Updated.

ContainsDependencySpringCloudEurekaServer: true,
},
},
expected: 8080,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

FYI: For eureka server, of not configured in application.properties, the default port is 8080;
Refs: https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#spring-cloud-eureka-server-standalone-mode

image

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agree that, but I'm worries about we cannot make the current spring-petclinic-microservices work well, because we set the port as default 8080 when server.port not configured. but for the eureka server, it sets this property server.port:8761 in the remote config file, so it cannot be aware of this info until starts up, then it will use 8761, but we listen on 8080, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it sets this property server.port:8761 in the remote config file, so it cannot be aware of this info until starts up, then it will use 8761, but we listen on 8080, right?

Good point.

I think we can enhance the property resolver in SJAD. ADO item created: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2332275

BTW, where is the CONFIG_SERVER_URL set the the spring-petclinic-microservices sample? https://github.com/azure-javaee/spring-petclinic-microservices/blob/14dcdc2379eb843d3a9cfe7748987e4d03beaa0d/spring-petclinic-discovery-server/src/main/resources/application.yml#L5C37-L5C54

image

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The CONFIG_SERVER_URL will be configured as the Env Var for the config client services.

ContainsDependencySpringCloudConfigServer: true,
},
},
expected: 8080,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@rujche rujche requested review from Copilot and saragluna January 2, 2025 07:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • cli/azd/resources/scaffold/templates/resources.bicept: Language not supported
  • schemas/alpha/azure.yaml.json: Language not supported

Comment thread cli/azd/internal/repository/infra_confirm_test.go
Comment thread cli/azd/internal/appdetect/spring_boot.go
@rujche rujche self-assigned this Jan 3, 2025
Comment thread cli/azd/resources/scaffold/templates/resources.bicept
Comment thread cli/azd/internal/appdetect/spring_boot.go
@rujche rujche requested review from Copilot and haoozhang January 7, 2025 09:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 11 changed files in this pull request and generated no comments.

Files not reviewed (6)
  • cli/azd/resources/scaffold/templates/resources.bicept: Language not supported
  • schemas/alpha/azure.yaml.json: Language not supported
  • cli/azd/internal/appdetect/appdetect.go: Evaluated as low risk
  • cli/azd/internal/appdetect/appdetect_test.go: Evaluated as low risk
  • cli/azd/.vscode/cspell.yaml: Evaluated as low risk
  • cli/azd/internal/repository/app_init_test.go: Evaluated as low risk
Comments suppressed due to low confidence (2)

cli/azd/pkg/project/scaffold_gen.go:401

  • The error message formatting is slightly off. It should be: return fmt.Errorf("port value for '%s' must be between 0 and 65535 (port = 0 means ingress disabled), but it's %d", resourceConfig.Name, port)
return fmt.Errorf("port value for '%s' must be between 0 and 65535 (port = 0 means ingress disabled), "+"but it's %d ", resourceConfig.Name, port)

cli/azd/internal/repository/infra_confirm.go:341

  • The function promptPortNumber is no longer used and should be removed to avoid dead code.
func promptPortNumber(console input.Console, ctx context.Context, promptMessage string) (int, error) {

@rujche

rujche commented Jan 20, 2025

Copy link
Copy Markdown
Author

Hi, @saragluna , @haoozhang
Please help to review this PR again.

@rujche rujche merged commit 85e3d3d into azure-javaee:feature/sjad Jan 21, 2025
@rujche rujche deleted the user-can-deploy-non-web-app-to-aca branch January 21, 2025 07:09
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.

4 participants