hashicorp / waypoint

A tool to build, deploy, and release any application on any platform.
https://waypointproject.io
Other
4.76k stars 327 forks source link

No application named *** #3942

Open rb-boubou opened 1 year ago

rb-boubou commented 1 year ago

Describe the bug Cannot deploy, tried with v5.2; v9.1 and latest. I'am sure what job and waypoint.hcl are correct because I deployed same app previously and I do not changed anything in project or files. I tried to delete **/root/.config/waypoint and waypoint login -server-addr=***** ... but same issue

waypoint init
✓ Configuration file appears valid
✓ Connection to Waypoint server was successful
✓ Project "gravitee/apim-gateway" and all apps are registered with the server.
✓ Plugins loaded and configured successfully

Project initialized!

You may now call 'waypoint up' to deploy your project or
commands such as 'waypoint build' to perform steps individually.

waypoint deploy -vvv
2022-09-28T16:45:40.941+0200 [INFO]  waypoint: waypoint version: full_string="v0.5.2 (20d177b6)" version=v0.5.2 prerelease="" metadata="" revision=20d177b6
2022-09-28T16:45:40.941+0200 [TRACE] waypoint: starting interrupt listener for context cancellation
2022-09-28T16:45:40.941+0200 [DEBUG] waypoint: home configuration directory: path=/root/.config/waypoint
2022-09-28T16:45:40.942+0200 [TRACE] waypoint: interrupt listener goroutine started
2022-09-28T16:45:40.943+0200 [TRACE] waypoint: no API client provided, initializing connection if possible
2022-09-28T16:45:40.943+0200 [TRACE] waypoint.server: WithLocal set, server credentials optional
2022-09-28T16:45:40.943+0200 [INFO]  waypoint.server: attempting to source credentials and connect
2022-09-28T16:45:40.962+0200 [DEBUG] waypoint.server: connection established with sourced credentials
2022-09-28T16:45:40.962+0200 [TRACE] waypoint: requesting version info from server
2022-09-28T16:45:40.964+0200 [INFO]  waypoint: server version info: version=v0.5.2 api_min=1 api_current=1 entrypoint_min=1 entrypoint_current=1
2022-09-28T16:45:40.964+0200 [INFO]  waypoint: negotiated api version: version=1
2022-09-28T16:45:40.964+0200 [DEBUG] waypoint: starting runner to process local jobs
2022-09-28T16:45:40.964+0200 [DEBUG] waypoint.runner: registering runner
2022-09-28T16:45:40.964+0200 [TRACE] waypoint.runner: runner connected, waiting for initial config
2022-09-28T16:45:40.964+0200 [INFO]  waypoint.runner: runner registered with server
2022-09-28T16:45:40.964+0200 [DEBUG] waypoint: will operate on app: name=gravitee/apim-gateway
2022-09-28T16:45:40.965+0200 [DEBUG] waypoint.runner: opening job stream
2022-09-28T16:45:40.965+0200 [TRACE] waypoint.runner: sending job request
2022-09-28T16:45:40.965+0200 [INFO]  waypoint.runner: waiting for job assignment
! No application named "gravitee/apim-gateway" is available, or application has no
  successful operations
2022-09-28T16:45:40.965+0200 [TRACE] waypoint: stopping signal listeners and cancelling the context

waypoint.hcl


project = "gravitee/apim-gateway"

# Labels can be specified for organizational purposes.
labels = { "domaine" = "gravitee" }

runner {
    enabled = true   
    poll {
        enabled = false
        interval = "24h"
    }
}
# An application to deploy.
app "gravitee/apim-gateway" {

    build {
        use "docker-pull" {
            image = "graviteeio/apim-gateway"
            tag   = "3.15.7"
            disable_entrypoint = true
        }
    }

    # Deploy to Nomad
    deploy {
        use "nomad-jobspec" {
            jobspec = templatefile("${path.app}/gravitee-apim-gateway.nomad.tpl", {
                datacenter = var.datacenter
                user_java_opts = var.user_java_opts
                apim_gateway_fqdn = var.apim_gateway_fqdn
                image = "graviteeio/apim-gateway"
                tag = "3.15.7"
                min_count = var.min_count
                max_count = var.max_count
                cooldown = var.cooldown
                seuil_scale_in = var.seuil_scale_in
                seuil_scale_out = var.seuil_scale_out
            })
        }
    }
}

variable "datacenter" {
    type = string
    default = "***"
}

variable ....
paladin-devops commented 1 year ago

Hey @rb-boubou, can you try running waypoint build prior to waypoint deploy, or waypoint up? A build is expected to be completed prior to a deployment.

rb-boubou commented 1 year ago

Hey @rb-boubou, can you try running waypoint build prior to waypoint deploy, or waypoint up? A build is expected to be completed prior to a deployment.

Hello dear, build and deploy works but I'm looking a way to deploy without build step. Build step is done on CI with waypoint up from ssh on worker. I would like to deploy my app only from controller where docker is not installed. Is there a option to deploy my app with waypoint deploy ?

please check my waypoint.hcl below there is not docker-pull, only docker in build step.

waypoint deploy -var-file=/opt/waypoint/varsfiles/myapp/my-api/test.wpvars
! No application named "finess-api-toto" is available, or application has no
  successful operations
project = "my-api-toto"
runner {
    enabled = true   
    poll {
        enabled = false
        interval = "30s"
    }
}
# An application to deploy.
app "my-api-toto" {
    build {
        use "docker" {
            dockerfile = "${path.app}/${var.dockerfile_path}"
        }

        # Uncomment below to use a remote docker registry to push your built images.
        #
         registry {
           use "docker" {
             image =  "${var.registry_path}/my-api-${var.env}"
             tag   = "${var.tag_version}"
           }
         }
    }

 # Deploy to Docker
    deploy {
           use "nomad-jobspec" {
      jobspec = templatefile("${path.app}/finess-api.hcl", {
    datacenter = var.datacenter
  image_version = "${var.registry_path}/my-api-${var.env}:${var.tag_version}"
  env = var.env
  db_service_name = "${var.db_service_name}-svc-${var.env}"
  url = "${var.app}.${var.env}.${var.domain}"
  update_stagger = var.update_stagger

          })
    }
    }

}
variable tag_version {
    type = string
    default = "1.0.0"
}
...

Dockerfile


FROM maven:3.6.0-jdk-11-slim AS build
COPY src /home/app/src
COPY pom.xml /home/app
RUN mkdir -p /root/.m2 \
    && mkdir /root/.m2/repository
COPY settings.xml /root/.m2
WORKDIR /home/app/

RUN mvn  clean package

#
# Package stage
#
FROM openjdk:11-jre-slim
COPY --from=build /home/app/target/my-api-0.0.1-SNAPSHOT.jar /usr/local/lib/my-api-0.0.1.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/usr/local/lib/my-api-0.0.1.jar"]
briancain commented 1 year ago

build and deploy works but I'm looking a way to deploy without build step. Build step is done on CI with waypoint up from ssh on worker.

If you want to deploy without a build step, your only option today is to use the docker-pull plugin.