Issue with parallel building

I have “clone, build & push” pipelines and when the steps are sequential all works good. But I want build step to be parallel for integration and production image. I was trying different ways like:

clone_repository:
build:
  type: parallel
    building_image_int:
    building_image_prod:
push:
  type: parallel
    pushing_image_int:
    pushing_image_prod:

AND

clone:
  type: parallel
    clone_repository_for_int:
    clone_repository_for_prod:
build:
  type: parallel
    building_image_int:
    building_image_prod:
push:
  type: parallel
    pushing_image_int:
    pushing_image_prod:

AND

clone_repository_for_int:
clone_repository_for_prod:
building_image_int:
building_image_prod:
pushing_image_int:
pushing_image_prod:
with "when steps name X on success"

but every time I get in my image repository (gcr.io) only one image with integration and production tags. Why it happens? How can I make parallel building of two images in one pipeline with pushing them to repository?

Hello

The example in the documentation is actually how to push two images in parallel Advanced Workflows with Parallel steps · Codefresh | Docs

The same thing should also work for docker builds.

Can you post that actual YAML that you used from the first approach? Even better, you can provide the URL of the build that has the issue so that our support team can investigate.

Here’s pipeline
https://g.codefresh.io/pipelines/edit/workflow?id=608548457cb730ca9950c6c7&pipeline=build-spring-appl&projects=CommonIntegration&projectId=5f572ba3d319493a61915ec5&rightbar=triggers

Hello

This is the URL of the pipeline. I need the URL of a build instead. It should be something like https://g.codefresh.io/build/61802b2497fc873039e

Also you need to enable support access to your account User Settings · Codefresh | Docs

https://g.codefresh.io/build/618000c3e78c23258cd590bf

Thank you.

You also need to enable this checkbox in your account for me to see the build https://codefresh.io/docs/docs/administration/user-settings/#enable-access-for-support-personnel

By default your pipelines are not accessible to anybody (not even Codefresh personnel).

I granted access for you

Hello again

The URL that you provided has sequential steps.

I looked at one that is using parallel steps like https://g.codefresh.io/build/617913af95856313bf06ea52

It has the following yaml

title: Pushing images
type: parallel
stage: push
steps:
  pushing_image_int:
    title: Pushing integration image
    type: push
    candidate: '${{building_image_int}}'
    image_name: '${{CF_REPO_NAME}}'
    tags:
      - '${{BLITZTAG}}'
      - latest
      - '${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}}'
    registry: gcr
  pushing_image_prod:
    title: Pushing production image
    type: push
    candidate: '${{building_image_prod}}'
    tags:
      - latest_prod
    image_name: '${{CF_REPO_NAME}}'
    registry: gcr

The syntax is correct. The pipeline also has finished successfully.
Both steps use the same image_name property but only have different tags

So the end result should be a multiple tags in GCR but under the same image.

So I am not sure what is the issue here. What was the expected result?

but every time I get in my image repository (gcr.io) only one image with integration and production tags. Why it happens? How can I make parallel building of two images in one pipeline with pushing them to repository?

If you want completely different images, you need to use a different image name on each build step. Or am I missing something here?

Hello

I see the issue here because of when I make consistent pipeline like
clone → build_integration_image → build_production_image → push_integration_image → push_production_image all works good and I get 2 images with one name and different tags in GCR. But when I make parallel build steps for integration and production, I get only one image with int and prod tags. But they should be different because they have different dockerfiles.
So the expected result is to have 2 images after one pipeline executing.
I don’t understand why it happens like this even if I do 2 clone steps with 2 working_directory in 2 build steps and 2 push steps with 2 candidates which were built with 2 different dockerfiles.

2 images with one name and different tags
only one image with int and prod tags

Isn’t this the same thing? An image with two tags is actually two different images

docker.io/example/my-image:int
docker.io/example/my-image:prod

are two different images.

And
docker.io/example/my-image-A:int
docker.io/example/my-image-B:prod

are also two different images.

Can you post a screenshot from your GCR registry with what you get in the sequential build and what you get with the parallel build? So that I can understand what is the difference?

Right, I’m sorry, that’s my fault. When I said “name” I meant image id. Certainly all the images I talked about have the same name. So if I use sequential build, e.g. 618d0ef098f096c7b480bc26 I get in GCR:

And if I use parallel build, e.g. 618d10add253798755b53d2b, I get this:

I see.

Ok in that case please open a issue from the top right menu in the Codefresh GUI. Be sure to include the two screenshots and mention the respective build URLS so that our support team can investigate.

To my knowledge, behind the scenes we use the standard registry API to push images