GithubHelp home page GithubHelp logo

reassess DOCKER_FORCE_BUILD about linkerd2 HOT 5 CLOSED

linkerd avatar linkerd commented on July 26, 2024
reassess DOCKER_FORCE_BUILD

from linkerd2.

Comments (5)

olix0r avatar olix0r commented on July 26, 2024

Can you explain in more detail what you think it's doing versus what it's actually doing?

from linkerd2.

siggy avatar siggy commented on July 26, 2024

This comment at the top of docker_maybe_build:
If the tag is 'latest', an image will always be built.

...but my reading of that function, where DOCKER_FORCE_BUILD is not set, is that it will always rely on already built images if available:

    if [ -z "${DOCKER_FORCE_BUILD:-}" ]; then
        docker pull "${repo}:${tag}" >/dev/null 2>&1 || true

        for t in $(docker_tags "${repo}:${tag}") ; do
            if [ "$t" = "$tag" ]; then
                docker tag "${repo}:${tag}" "${repo}:latest" >/dev/null

                echo "${repo}:${tag}"
                return 0
            fi
        done
    fi

from linkerd2.

olix0r avatar olix0r commented on July 26, 2024

Ahh yeah, the latest behavior was changed without updating the comment, I believe.

Relying only on docker caching would be nice, though I think that's going to be a bit tricky.

In the short-term, i'd suggest that we ensure the scripts are commented appropriately -- I'm happy to help with that.

If we're going to retool all of the build stuff, we need to be clear in scoping/motivating that work. I don't think it should be a priority unless the current tools are actively causing problems.

from linkerd2.

klingerf avatar klingerf commented on July 26, 2024

Am not sure @siggy is suggesting retooling all of our build stuff, but it would be nice to fix the script with regard to the latest tag. I do think it always makes sense to rebuild the latest tag, instead of potentially pulling whatever's currently tagged as latest on gcr.io.

from linkerd2.

olix0r avatar olix0r commented on July 26, 2024

Okay, I think I understand now. Please confirm this is the problem:

When running bin/docker-build latest without DOCKER_FORCE_BUILD, we'll pull latest from gcr.io, which probably isn't what's intended.


The behavior changed when we stopped using latest as the default tag; and so the check was a bit pointless, since you have to try to do this.

The intended workflow is bin/docker-build && bin/docker-retag-all $(bin/root-tag) latest, which builds images with the git tag and then sets latest to that.

if you don't want to commit between builds, the recommendation would be DOCKER_FORCE_BUILD=1 bin/docker-build latest

If we find that there are larger automatable common workflows around these scripts, we should definitely script it up.

I'm not sure that we should treat latest as a special tag at this point in the code, as there can be other symbolic/floating tags that we can't account for here, and so i think we need to make those determinations in the place where we choose the tag and not down in the guts of the helpers.

from linkerd2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.