Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Build with aws-ecr-pull requiring docker.AccessInfo due to no registry stanza with remote runner #4896

Open
magickatt opened this issue Aug 23, 2023 · 2 comments
Labels

Comments

@magickatt
Copy link

magickatt commented Aug 23, 2023

Describe the bug

Have had this working previously (unsure how to replicate) with a Runner on the same EKS cluster as the Server, but am running into an issue trying to build using the aws-ecr-pull plugin whereby it will not work without a registry stanza, which from documentation should not be required since the image is never being built or pushed?

#3396 shows an example with no registry stanza. But not including it results in

» Building test...
✓ Running build v2
! There was an error while executing a Waypoint plugin for this operation!

  One or more required arguments for the plugin was not satisfied. This is usually
  due to a missing or incompatible set of plugins. For example, only certain build
  plugins are only compatible with certain registries, and so on. Please inspect
  the missing argument, the set of plugins you are using, and the documentation to
  determine if your plugin combination is valid.

  Plugin function:
  github.com/hashicorp/waypoint/builtin/aws/ecr/pull.(*Builder).BuildODR-fm

  ==> Missing arguments:

      - docker.AccessInfo

Steps to Reproduce

waypoint.hcl

project = "examples"

variable "tag" {
  type    = string
  description = "Git tag"
}

app "test" {
  runner {
    profile = "kubernetes-${workspace.name}"
  }
  
  build {
    use "aws-ecr-pull" {
      region             = "us-east-1"
      repository         = "test"
      tag                = var.tag
      disable_entrypoint = true
    }
  }

  deploy { 
    use "helm" {
      name  = app.name
      chart = "${path.app}/chart"
      set {
        name  = "environment"
        value = "${workspace.name}"
      }
      set {
        name  = "image.tag"
        value = var.tag
      }
    }
  }
}

Expected behavior
Build should work without a registry stanza, or it should be possible to supply a null registry stanza as per comment #3328 (comment)

Waypoint Platform Versions

  • Waypoint CLI Version: v0.11.0 (e92d6fb)
  • Waypoint Server Platform and Version: v0.11.3 (Kubernetes on EKS)
  • Waypoint Plugin: aws-ecr-pull

Additional context

Failing command is waypoint up -w=development -var=tag=0.0.7 -p=examples -local=false (same error happens when running for Production)

Runners are configured using an On-Demand Runner installed on the control cluster using Helm, and Development and Production Runners installed using waypoint runner install

$ waypoint runner list
              ID             |   STATE    |  KIND  |          LABELS          | LAST REGISTERED
-----------------------------+------------+--------+--------------------------+------------------
  production                 | adopted    | remote | environment:production   | 28 minutes ago
  development                | adopted    | remote | environment:development  | 29 minutes ago
  DVJLFQLAOERHBUBGTAQTXRZYFU | preadopted | remote |                          | 16 minutes ago

$ waypoint runner profile list
Runner profiles
             NAME            | PLUGIN TYPE |                 OCI URL                 |         TARGET RUNNER          | DEFAULT
-----------------------------+-------------+-----------------------------------------+--------------------------------+----------
  DVJLFQLAOERHBUBGTAQTXRZYFU | kubernetes  | docker.io/hashicorp/waypoint-odr:0.11.3 | *                              | yes
  kubernetes-development     | kubernetes  | hashicorp/waypoint-odr:latest           | labels:                        |
                             |             |                                         | {"environment":"development"}  |
  kubernetes-production      | kubernetes  | hashicorp/waypoint-odr:latest           | labels:                        |
                             |             |                                         | {"environment":"production"}   |
@magickatt magickatt added the new label Aug 23, 2023
@magickatt
Copy link
Author

Been investigating this further and noticed the following quote from the Registry documentation

A registry is required unless using the Docker build plugin via a CLI runner. This is not the common case, and thusly almost always a registry stanza should be used.

https://developer.hashicorp.com/waypoint/docs/waypoint-hcl/registry

But surely this isn't true for either aws-ecr-pull or docker-pull since they will often be used in situations where the image is not pushed back? (based on the example waypoint.hcl snippets provided for both)

@magickatt magickatt changed the title Build with aws-ecr-pull requiring docker.AccessInfo due to no registry stanza with remote Runner Build with aws-ecr-pull requiring docker.AccessInfo due to no registry stanza with remote runner Aug 25, 2023
@thangnc
Copy link

thangnc commented Sep 18, 2023

i ran into the same issue with aws-ecr-pull for build and aws-ecs deploy. I have to hack by add registry aws-ecs stanza but this caused re-pushing image on ECR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants