Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PUT doesn't add ref to INPUT when registry mirror is set. #313

Open
Typositoire opened this issue Nov 3, 2020 · 3 comments
Open

PUT doesn't add ref to INPUT when registry mirror is set. #313

Typositoire opened this issue Nov 3, 2020 · 3 comments

Comments

@Typositoire
Copy link

Typositoire commented Nov 3, 2020

Disclaimer, this could be just because of a specific registry mirror, we use Artifactory.

Context: With the Docker Hub rate limit hell, we upgraded to Concourse 6.7.1 and setup a registry-mirror for docker-image and registry-image.

Issue: We have a build step that is then used by a task right after.

- name: build-pull-request
  plan:
  - get: pull-request
  - get: labels
  - put: ci-image
    inputs:
    - pull-request
    - labels
    get_params: { skip_download: true }
    params:
      cache: true
      build: pull-request
      tag_file: ./labels/tag_ci
      labels_file: ./labels/file.json
      target_name: dev
      build_args:
        ARTIFACTORY_CREDENTIALS: ((artifactory.username)):((artifactory.password))
- name: do-stuff
  plan:
    - get: ci-image
      passed: [build-pull-request]
      version: every
      trigger: true

And what happens is that when the put: ci-image is done, get: ci-image in do-stuff never gets its input.

We did the following:

- name: docker-image-no-mirror
  type: registry-image
  privileged: true
  source:
    repository: concourse/docker-image-resource
    tag: 1.5.1

And changed the type of ci-image to docker-image-no-mirror and VOILA, refs are filled correctly now.

Now, we still haven't looked at why, but this should help trace it at least.
Feel free to change the title, it's hard to explain that bug in a one liner :/

@Typositoire
Copy link
Author

I've been trying to reproduce that for the last 2 hours without luck... I can confirm by the audit logs that the PUT generate a good digest. I tried locally with the image 1.5.1 and I always get the latest and cursor digest. I have no idea why using the bundled docker-image in v6.7.X I have a different behavior ...

@mischcon
Copy link

mischcon commented Nov 17, 2020

I can confirm that using Concourse v6.7.0 with the built-in version of docker-image-resource (1.5.0) or Concourse v6.7.1 with the built-in version of the docker-image-resource (1.5.1) that dependent downstream jobs do not get triggered if a artifact gets produced / pushed by the docker-image-resource.

Further hints: I can confirm that PUT produces some digests, but those digests do not appear in the version history of the resource (in fact it remains empty on a new resource).

The workaround described above works for me.
I added the "registry-mirror" manually to the resource - still everything works fine.

resources:
- name: ci-image
  type: docker-image-no-mirror
  icon: docker
  source:
    registry_mirror: https://link.to.custom.mirror
    repository: ....
    tag: ...

@mstansberry
Copy link

We had a similar issue recently when the resource source config didn't include a tag (implicit latest), but we were also using a tag or tag_file param in the task. Adding a proper tag to the source config and using additional_tags within the task allowed the new versions to show up

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

No branches or pull requests

3 participants