Unable to provide entrypoint in waypoint.hcl and getting error

I am using golang and I have multiple commands under cmd/ in main package. Its good that pack has identified all the main commands, but not sure its getting the right entrypoint. How can I provide the entrypoint in below configuration? For ex, I have two commands http which runs http server and other as grpc runs grpc server.

Below is my waypoint.hcl

project = "name"

labels = { "app" = "name" }

# An application to deploy.
app "http" {
    config {
        env = {
            LOG_LEVEL="0"
            HTTP_ADDR=":8000"
        }
    }

    build {
        use "pack" {
            builder = "paketobuildpacks/builder:base"
        }
    }

    deploy {
        use "docker" { } 
    }
}

waypoint up runs successfully and produces nice URLs but I get below error when I run the image build from pack with docker run http.

2021-06-04T12:43:50.765Z [INFO]  entrypoint: entrypoint starting: deployment_id= instance_id=01F7BGT6KDVBPT88VMSZT4T2H4 args=[/cnb/process/web]
2021-06-04T12:43:50.766Z [INFO]  entrypoint: entrypoint version: full_string=v0.3.2 version=v0.3.2 prerelease= metadata= revision=
2021-06-04T12:43:50.766Z [DEBUG] entrypoint.child: waiting for stateChildReady to flip to true
2021-06-04T12:43:50.766Z [DEBUG] entrypoint.child: starting child command watch loop
2021-06-04T12:43:50.766Z [DEBUG] entrypoint.child: child command received
2021-06-04T12:43:50.766Z [INFO]  entrypoint.child: starting child process: args=[/cnb/process/web] cmd=/cnb/process/web
2021/06/04 12:43:50 open /workspace/resources/certs/ca-cert.pem: no such file or directory
2021-06-04T12:43:50.802Z [WARN]  entrypoint.child: subprocess exited: args=[/cnb/process/web] cmd=/cnb/process/web err="exit status 1"
2021-06-04T12:43:50.802Z [INFO]  entrypoint.child: child process exited on its own: err="exit status 1"
Error initializing Waypoint entrypoint: exit status 1

Hi kamal-github,

As of our 0.4.0 release yesterday, we have a new feature that allows you to specify the pack process-type in waypoint.hcl (docs here).

From your logs, I see that pack is currently running the default web process type. If you have another process type available (i.e. grpc), you can add process_type = "grpc" below the builder line in your build pack stanza , and then the container entrypoint should be grpc.

Let me know if that doesn’t work for you,

Izaak

1 Like