Docker Image from Build stage reusage?

I was going to optimize the build process a bit for a company I start working for, but found some of the buddy actions behavior in convicting.

  • Why it’s not possible to reuse the Image created on BUILD action during the next BUILD action? BUILD creates docker artifacts I can make use of.
  • Why its supposed to be a docker build action that creates image that can be reused?

As developer I want fast CI check, that includes download dependencies once and run all checks at once (using use_image_from_action=true, run_next_parallel=true docker_build_action_id=0 ) without pushing build image to any repository for every commit.

Hello Oleg!
What Docker artifacts do you mean? If you have two actions in a row running in sequence, they share the same filesystem. This means that if action A generates artifacts, action B will be able to use it.

The best idea is that you drop an email to support@buddy.works with the URL to your pipeline and some more description of how you want the process to look like. The team will get you from there.

Cheers!
Alex

  1. what docker artifacts do you mean…

docker produce two types of artifacts - layers and images, images consists of layers.

  1. BUILD actions does not share the same filesystem as it runs in the docker container, am I understand buddy.works correct?

  2. sample pipeline i was expecting to work (corresponding docs)

- pipeline: 'Build and Test'
  ref_name: '(refs\/pull\/\d+)'
  ref_type: WILDCARD
  trigger_mode: ON_EVERY_PUSH
  trigger_condition: ALWAYS
  fail_on_prepare_env_warning: true
  auto_clear_cache: false
  actions:
  - action: "Make Build"
    type: BUILD
    working_directory: /buddy/generic
    docker_image_name:  docker.io/library/golang
    docker_image_tag: 1.15.7

    execute_commands:
    - - make pull_huge_dependency

    volume_mappings:
    -  /:/buddy/generic

  - action: "Concurrent Build: RunTask 1"
    type: BUILD
    working_directory: /buddy/generic

    docker_build_action_id: 0
    use_image_from_action: true
    run_next_parallel: true

    docker_image_name:  docker.io/library/golang
    docker_image_tag: 1.15.7

    execute_commands:
    - make pull_huge_dependency
    - make run_tests
    volume_mappings:
    -  /:/buddy/generic

  - action: "Concurrent Build: RunTask 2"
    type: BUILD
    working_directory: /buddy/generic

    docker_build_action_id: 0
    use_image_from_action: true
    run_next_parallel: true

    execute_commands:
    - make pull_huge_dependency
    - make run_static_analicys

    volume_mappings:
    -  /:/buddy/generictoday


  - action: "Concurrent Build: RunTask 3"
    type: BUILD
    working_directory: /buddy/generic
    docker_image_name:  docker.io/library/golang
    docker_image_tag: 1.15.7

    docker_build_action_id: 0
    use_image_from_action: true
    run_next_parallel: true

    execute_commands:
    - make pull_huge_dependency
    - make run_build_process

    volume_mappings:
    -  /:/buddy/generictoday

but looks like its supposed to work only if the previous image built by the DOCKERFILE action, which automatically push image to the registry (the thing i would like to avoid). The documentation also not make it clear that docker_build_action_id if reffereted to DOCKERFILE, butnot BUILD action (which also runs and build some image).

I think clients can gain from implementing the feature to keep the BUILD process docker image to use it on next parallel build till the end of pipeline.

Hello Oleg,
Please find the answers to your questions below:

  1. Build actions run in the container, that’s right, BUT with a submounted directory with the filesystem of this pipeline – so everything is available.

  2. This structure with fields:

docker_build_action_id: 0
use_image_from_action: true

refers to images generated by the Build image action only.

Each action type: BUILD, however, has its separate Docker cache as well (this is when setup commands are specified – then the image is built with the executed commands but available only for this action).

Should you need anything else, feel free to contact us at support@buddy.works – we’ll be happy to help!

  1. for a particular kind of builds (like Go modules) it’s not possible in the obvious way to store artifacts on a disk.
  2. should you mention this in docs for the BUILD action or its obvious information?
  3. I got this. I start to question this logic in the first post in this thread. If it’s OK for you and your clients and you don’t see a value in reusing docker cache… ok. no big deal. no deal breaker. it’s just OK.
  4. this is a Community forum, right?

Anyway, thanks buddy works people for responses. Somehow, it didn’t solve my issues and I got no new info regarding how buddy works works.

Cheers.

P/S/
how to unsubscribe from this thread?

P/P/S/
Found! (Muted)