Skip to content

Make CI failures easier to investigate #424

Closed

Description

@willirath

In #423, @riedel tracked down a version bump of the 5.7 tag of the mysql docker image that was difficult to spot from the logs alone (at least for me).

I suggest to make these kinds of environment changes easier to spot, we create Travis artefacts that summarise what we need to know:

  • hashes and tags of all docker images
  • python env listings
  • what else?

Activity

  1. willirath commented on May 3, 2020

    @willirath
    CollaboratorAuthor

    The reason this is difficult to see in the failed build is that we only show the full image list with

    docker images

    after the slurm cluster started
    ./start-slurm.sh

    This is probably done because the result is only known after docker compose was done in start-slurm.sh.

    The same logic applies to all other Jobqueue clusters.

    As a way forward, we should disentangle the logic into

    • building the env (docker build, docker compose),
    • documenting the env (docker ps, docker images),
    • starting the scheduler.

    And we should consider pinning more aggressively. At least on the CI env side, we should pin external dependencies using the full semver tag or, even more robust but less easy to read by a human, use the immutable image hash.

  2. willirath commented on May 3, 2020

    @willirath
    CollaboratorAuthor

    See #425.

  3. riedel commented on May 3, 2020

    @riedel
    Member

    As commented on the PR I would do docker pull, build, images, run, ps, exec in that order. If you actually pin everything I don't expect many insights though.

    More important, I would pipe pip freeze/rpm -qa/dpkg-l/conda list --export (or whatever is used) through sort to actually make them diffable.

    The process could be much more robust, if the CI images would not be build during the CI run at all, but that has many other downsides I guess.

  4. riedel commented on May 16, 2020

    @riedel
    Member

    Just noted that in case of the condor image it would make sense to call like docker images -q | xargs -n1 docker image inspect --format='{"RepoTags":{{json .RepoTags}},"RepoDigests":{{json .RepoDigests}},"Config":{{json .Config}} } '

    which will give

    {
    "RepoTags": [
        "htcondor/mini:el7"
      ],
      "RepoDigests": [
        "htcondor/mini@sha256:c0e20cf8573f499cdacee22607fc95233bb458a5c59623211a88d634617f6c49"
      ],
      "Config": {
        "Hostname": "",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
          "8080/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
          "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
          "/start.sh"
        ],
        "Image": "sha256:f91b3afd15e07989f226991ecc6b21879af1f28ef3442db99fc4d8e12badcd6b",
        "Volumes": null,
        "WorkingDir": "",
        "Entrypoint": null,
        "OnBuild": null,
        "Labels": {
          "org.label-schema.build-date": "20200508",
          "org.label-schema.description": "HTCondor 8.9.6 minicondor image for RHEL 7-compatible",
          "org.label-schema.license": "Apache-2.0",
          "org.label-schema.name": "htcondor/mini:8.9.6-el7",
          "org.label-schema.schema-version": "1.0",
          "org.label-schema.vendor": "HTCondor"
        }
      }
    }
    
  5. guillaumeeb commented on May 16, 2020

    @guillaumeeb
    Member

    So as mentioned in #427, I fully support the idea as long as it does not overcomplicate CI code!

  6. lesteve commented on May 17, 2020

    @lesteve
    Member

    Yep I agree on this the Slurm CI issue was something we see extremely rarely (once in maybe 2 years since I have been involved in Dask-Jobqueue). Generally you can always reproduce the problem and debug locally ... this should be taken into account and not go overboard with spending time on things that have no sizeable benefit.

    If doing this kind of tasks is the definition of fun for someone then sure please have fun ;-) !

    The process could be much more robust, if the CI images would not be build during the CI run at all, but that has many other downsides I guess.

    About this one of my idea was to build the docker images in a scheduled task (maybe weekly) and reuse them in the CI this would speed up the CI quite a bit and also allow local debugging in a more efficient manner. If someone wants to do this, I would encourage this and think this has clear benefit !

  7. riedel commented on May 17, 2020

    @riedel
    Member

    About this one of my idea was to build the docker images in a scheduled task (maybe weekly) and reuse them in the CI this would speed up the CI quite a bit and also allow local debugging in a more efficient manner. If someone wants to do this, I would encourage this and think this has clear benefit !

    I am totally in support of this! I have quickly checked out docker autobuild feature (https://hub.docker.com/repository/docker/tillkit/dask-jobqueue-ci/tags , someone with commit access needs to do this eventually) . It is really easy and can be configured to update on base image changes. Ideally the stuff done in all CIs would then roughly be the same (heavy lifting done by the docker images and the compose file). IMHO the rest can be done just exec calling installand pytest. Some preinstalling in the Dockerfile is fine, but then you need the weekly trigger.

    Another idea for the future, would be to have a second Travis test, that runs other not so critical stuff and may be a bit longer (development versions and old-stable versions of the schedulers). I remember that I got started into this because our Lab is still running htcondor 8.6.

    Furthermore, I wonder why some of the tests have to be run on all the different CIs without many benefits and much more output.

    PS: Unfortunately docker compose has no copy support and is a bit oppinionated about this (docker/compose#5523) and I personally dislike docker bind mounts because of inconsistent behaviour, but I guess just mounting the repo root is an acceptable pattern for a CI.

  8. lesteve commented on May 18, 2020

    @lesteve
    Member

    So I am not an expert on this so I'll trust you fully on the autodocker thing. I am guessing you can play a bit on your fork to experiment with this at first?

    If later on we converge on the approach and you need something done by an admin to make progress on this I can do it of course!

    Something I am wondering about is whether autodocker supports building multiple Docker images.

    Also as a side comment : the thing I liked (but not absolutely necessary) about the weekly docker image update is that it changes "slowly" and regularly so if something breaks weirdly on Monday you are like "oh this must be the Docker image update" rather than "what the hell is happening I am going to debug this and it will take me a full day". I am thinking new version of Dask or weird thing like mysql version problem on Travis. How likely this is to happen of course I don't really know but at the same time being a bit defensive about this feels like a good idea.

    I kind of agree with your points about possible ameliorations for the future, but at the same time I don't feel it is a bottleneck at the moment. Having the Docker images built will already be a great improvement and will speed up the CI considerably!

  9. riedel commented on May 18, 2020

    @riedel
    Member

    So I will put all existing images plus a HTCondor image into the docker builds (one can do as many tags as one likes) and try to collaboratively draft a pull request that uses the Docker autobuilds (we can try different things and see what makes everyone happy).

    We can still manually trigger builds I guess. I will, however, check if we can simply go back in time one image (by using pinning) as a fast fix if sth breaks. Good things about storing the images centrally is that we gain reproducabilty). I would encourage to establish a small check list of things (pin image and open a ticket to unpin) to do in sequence if the CI breaks.

    PS: hope that I can do sth on the week end (long one due to holiday)

  10. lesteve commented on May 18, 2020

    @lesteve
    Member

    OK let me know! IMO anything that works is likely to get multiple 👍 from me (and a fair amount of thanks as well).

    I guess by "anything that works" I mean this two main features:

    • automatic build of Docker images
    • reuse of these Docker images in the CI

    We should not aim for perfection on the first PR and we can always refine things on further PRs if we realise with time that things can be improved.

    Another general opinion while I am at it, the less changes you make the quicker it will be reviewed and merged so I would aim for a smallish amount of change to get the two features above. Other things you see that you think are not really Docker accepted best practices or other things that could be easily improved but are not really related to having Docker images automatically built can be done in separate PRs.

  11. added
    CI
    on Jan 24, 2021
  12. guillaumeeb commented on Sep 7, 2021

    @guillaumeeb
    Member

    I guess by "anything that works" I mean this two main features:

    • automatic build of Docker images
    • reuse of these Docker images in the CI

    This has been done with #455 and maybe other. So I'm gonna close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions