Azure / spring-apps-deploy

GitHub Actions to deploy to Azure Spring Cloud
MIT License
12 stars 9 forks source link

RFE: Probe support #12

Closed ezYakaEagle442 closed 1 year ago

ezYakaEagle442 commented 1 year ago

How to define ASA Probe using GH Action for Azure Spring Apps ?

Like in Bicep


// https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-09-01-preview/spring/apps/deployments?pivots=deployment-language-bicep
resource customersserviceappdeployment 'Microsoft.AppPlatform/Spring/apps/deployments@2022-09-01-preview' = {
  name: 'aca-${appName}-customers-service-init-v.0.1.0'
  parent: customersserviceapp
  sku: {
    name: azureSpringAppsSkuName
  }
  properties: {
    active: true
    deploymentSettings: {
      addonConfigs: {}
      environmentVariables: {
        XXX: 'foo'
        ZZZ: 'bar'
      }
      containerProbeSettings: {
        disableProbe: false
      }
      livenessProbe: {
        disableProbe: false
        failureThreshold: 5
        initialDelaySeconds: 30
        periodSeconds: 60
        probeAction: {
          type: 'HTTPGetAction'
        }
        successThreshold: 1
        timeoutSeconds: 30

      }
      readinessProbe: {
        disableProbe: false
        failureThreshold: 5
        initialDelaySeconds: 30
        periodSeconds: 60
        probeAction: {
          type: 'HTTPGetAction'
        }
        successThreshold: 1
        timeoutSeconds: 30
      }
      resourceRequests: {
          cpu: any(1)
          memory: any(1)
      }
    }

    source: {
      version: '1.0.0'

      type: 'Jar' // Jar, Container or Source https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-09-01-preview/spring/apps/deployments?pivots=deployment-language-bicep#usersourceinfo
      jvmOptions: '-Dazure.keyvault.uri=${kvURL} -Xms512m -Xmx1024m -Dspring.profiles.active=mysql,key-vault,cloud'
      relativePath: 'spring-petclinic-customers-service' // './target/petclinic-customers-service-2.6.6.jar'
      runtimeVersion: 'Java_11'

      type: 'Container' 
      customContainer:  {
        containerImage: 'https://acrpetcliasa.azurecr.io/petclinic/petclinic-customers-service:4242' // Container image of the custom container. This should be in the form of {repository}:{tag} without the server name of the registry   
        command: ['java', '-jar petclinic-customers-service-2.6.6.jar', '--server.port=8080', '--spring.profiles.active=docker,mysql'] 
        server: 'acrpetcliasa.azurecr.io' //    The name of the registry that contains the container image
        imageRegistryCredential: {
          username: 'AcrUserName'
          password: 'AcrPassword'
        }
        languageFramework: 'Java'
        args: '' // Arguments to the entrypoint. The docker image's CMD is used if this is not provided.
      }

      type: 'Source' // Jar, Container or Source https://learn.microsoft.com/en-us/azure/templates/microsoft.appplatform/2022-09-01-preview/spring/apps/deployments?pivots=deployment-language-bicep#usersourceinfo
      relativePath: 'spring-petclinic-customers-service'
      runtimeVersion: 'Java_11'
      artifactSelector: 'spring-petclinic-customers-service' // Selector for the artifact to be used for the deployment for multi-module projects. This should be the relative path to the target module/project.

    }
  }
}

@RuoyuWang-MS

RuoyuWang-MS commented 1 year ago

I think you can use probe feature through CLI support. Please refer to this doc and you can use some args such as --enable-liveness-probe, --liveness-probe-config, .... To use CLI in github action, please refer to this azure-cli-action. These args are not supported directly in our github action right now. Thanks for your question!

ezYakaEagle442 commented 1 year ago

@RuoyuWang-MS , customers do NOT use CLI , they mostly use GH Actions on Production environments, please consider this issue #12 as an RFE and please plan the implementation ASAP.

taoxu0903 commented 1 year ago

@ezYakaEagle442, this is Ken, PM from Azure Spring Apps. For now, we have only offered limited support in github action against deployment only and we think there is no blocker for customers to automate everything via CLI commands although it's imperative way, not that consistent. Would like to learn more about why customers won't use CLI in github actions for prod env? I think it's an important learning to evaluate the investment on github actions from product point of view.

RuoyuWang-MS commented 1 year ago

As Probe has been supported right now, close this issue. Thanks!