.netgoogle-app-enginegcloud

Issue when trying to deploy dotnet 8 web app to gcloud app engine flex


I've been using gcloud app deploy with a legacy project on dotnetcore 3.1 sometime ago. Had to go back to this project and after upgrading the project to dotnet 8 I can no longer deploy it.

Previous set of actions was:

  1. dotnet publish "./SolutionName/Project.Public/Project.Public.csproj" -o "publish-api/" -c Release

    • this creates a publish folder
  2. cp app-api.yaml ./publish-api/

    • copies the yaml to publish folder
  3. gcloud app deploy ./publish-api/app-api.yaml --version=1.1

    • the last step now throws the next error:
    Step #2 - "build": ERROR: No buildpack groups passed detection.
    Step #2 - "build": ERROR: Please check that you are running against the correct path.
    Step #2 - "build": ERROR: failed to detect: no buildpacks participating
    

    Possibly I miss something simple here? Should I not be able to deploy from dotnet published folder?

If I try to just deploy from within a project in that solution it goes further in its build, however it also fails with a next error (for some reason it can't locate a referenced project, which lives within this solution):

  Step #2 - "build": Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
  Step #2 - "build": --------------------------------------------------------------------------------------
  Step #2 - "build":   Determining projects to restore...
  Step #2 - "build":   Skipping project "/API.Common/API.Common.csproj" because it was not found.
  Step #2 - "build":   Skipping project "/API.Common/API.Common.csproj" because it was not found.
  Step #2 - "build":   Restored /workspace/API.csproj (in 10.28 sec).

I tried deploying a simple HelloWorld with my app.yaml consisting of just one project and that works fine. However in multi-project solution it can't find the referenced projects.

for completenes here's my deployment yaml:

    runtime: aspnetcore
    env: flex
    service: default
    
    runtime_config:
        operating_system: ubuntu22
    
    automatic_scaling:
      min_num_instances: 1
      cpu_utilization:
        target_utilization: 0.75
    
    liveness_check:
      path: "/health"
      check_interval_sec: 30
      timeout_sec: 4
      failure_threshold: 4
      success_threshold: 2
    
    resources:
      cpu: 1
      memory_gb: 1
      disk_size_gb: 10
    
    env_variables:
      GCLOUD_PROJECT_ID: proj-id

Hints or advice warmly welcome.


Solution

  • The issue was the that deployment tools were not understanding what to do with the published files.

    Added the next to app.yaml to aid the process:

    entrypoint: "dotnet Project.Public.API.dll"  # the main/starting dll 
    

    After that running gcloud app deploy from within a published folder worked fine.