#metabrainz

/

      • Mineo
        alastairp: if you remove images before removing containers, docker should not remove the images (and intermediate layers) that are still used by the containers, maybe that's good enough?
      • alastairp
        Mineo: oh, that's a neat idea
      • though, I'm not sure if it'll work.
      • imagine if I have 4 layers, the last of which churns a lot because of code files changing. we have lots of different services running tests, so ideally I want to remove images based on its name
      • Mineo
        it definitely won't work if you have images for more than one project on the docker host, yeah
      • alastairp
        so, what actually happens is we use the jenkins project name _and_ build number as part of the container/image name
      • so I think I can say "all images whose name includes the project name, and are older than the image that I just built now"
      • because we'll actually keep the labels for previous images
      • yvanzo
        maybe that would be more clear with examples (?)
      • alastairp
        yes, I'm just running some experiments now have clear what happens
      • see that we have 2 labeled images here from build1 and build2. when build2 runs, we can use it to remove all images that match the reference and are older than build2. When build3 runs, it will remove build2. This will untag the image, we will still need to run a periodic image prune to remove dangling intermediate images
      • the filter=reference= could also be done with a label, we don't have labels in most of the python apps, but it seems like a good idea to copy what yvanzo does in some dockerfiles
      • yvanzo
        alastairp: IMHO, docker images should have labels that allow filtering them, see counter-example: docker inspect listenbrainzunittestjenkinsbuildjenkinslistenbrainzunit259_listenbrainz
      • alastairp
        yes, I agree that adding labels here will make it a lot easier to filter
      • reosarevok
      • yvanzo
        reosarevok: it is self-explanatory :)
      • reosarevok
        I mean, sure, but was it not needed before and now it is? I'm just confused about why :D
      • alastairp
        maybe he wanted to re-trigger testing?
      • yvanzo
        sorry, yes, I just triggered a build.
      • alastairp
        yvanzo: "@brainzbot retest this please" will do the same for jenkins, but I don't know about circleci
      • yvanzo
        that is right, but I keep forgetting the exact syntax of this command
      • alastairp
        me too. there are many commands that I only remember by looking in jenkins config. maybe we should document them somewhere
      • Darkloke has quit
      • yvanzo: do you have specific labels when building MBS for development?
      • yvanzo
        alastairp: does listenbrainz really need that many images for each build?
      • alastairp
        are you asking about jenkins?
      • yvanzo
        alastairp: we have only one base image to run all tests for musicbrainz-server.
      • currently musicbrainz-tests:v-2020-11
      • alastairp
        there are a few things. one is that we currently run 3 separate jenkins jobs for unit tests, integration tests, and js test. I'm working on combining those
      • zas
        yvanzo: test-keydb-A and test-keydb-B are test containers I made to evaluate keydb (replacement for redis), please keep for now
      • alastairp
        within a test we may have multiple services (although I see in https://github.com/metabrainz/listenbrainz-serv... we appear to reuse the same image in both services, so that's fine)
      • how does your musicbrainz-tests:v-2020-11 image work? Is that a single image built in november to run all subsequent tests?
      • what is/isn't in that image?
      • yvanzo
        alastairp: for mbs tests, we have one job in jenkins and one in circleci, services are not ran using separate images/containers.
      • alastairp: this image contains dependencies and services
      • alastairp
        so what happens if you change dependencies? Do you have to add a new test image?
      • how do you include updated sourcecode into the image? Do you build a new one?
      • yvanzo
        Dependencies are just pre-installed, but they are updated by each build.
      • alastairp
        are the updated during a docker build stage, or in the container before tests are started?
      • yvanzo
        We need to build a new image either when dependencies cannot be updated: breaking changes in dependencies installation method, or breaking change in services dependencies.
      • alastairp: in the container
      • alastairp: sourcecode is copied to the container too
      • alastairp
        ah, I see now. so in https://github.com/metabrainz/musicbrainz-serve... you specify the base image to run, and circleci runs that image and then copies the code into the container, and then runs the `steps` ?
      • yvanzo
        yes, it's the same for jenkins
      • alastairp
        this is very different to the docker-compose-based system that we currently have. In my view it adds significant complexity for little value
      • I think that it's still best to continue using our current system but ensure that we delete images after each build
      • yvanzo
        The musicbrainz-tests approach is more lightweight but not necessarily as flexible as using docker-compose.
      • alastairp: at least that explains why we don't face the same issues regarding jenkins :)
      • alastairp
        yes, absolutely
      • OK, I am going to add labels to ListenBrainz for testing
      • yvanzo
        +1
      • alastairp
        however, during development we shouldn't update these labels each time a user builds, because if the build date variable changes it will invalidate the entire cache
      • does that make sense to you?
      • yvanzo
        do you mean creating a LABEL named BUILD_DATE?
      • alastairp
        yes
      • yvanzo
        It's not needed as this is already part of image's metadata.
      • alastairp
        ah. so perhaps https://github.com/metabrainz/docker-irccat/blo... should be updated?
      • yvanzo
        right
      • alastairp
        ok, thanks. how about VCS_REF?
      • sumedh_p joined the channel
      • yvanzo
        hmm, not really
      • sumedh has quit
      • alastairp
        the main point here is that local developers use the same Dockerfile that we use for building the production image
      • yvanzo
        BUILD_DATE is unneeded for irccat but it can be useful when tagging
      • I think that was a lazy solution.
      • Build date can be extracted from image as in https://github.com/metabrainz/docker-python/blo...
      • VCS_REF seems to be more useful at least :)
      • bitmap
        reosarevok: yvanzo: orderingattribute ultimately wasn't intended to be searchable, but I think was left in on accident or in case it was used in the future
      • alastairp
        yvanzo: is the only way to view labels to use `docker inspect` from the host?
      • can a process in a container see the label?
      • bitmap
        originally series were designed to support different ordering attributes but we decided to just have one after the schema change iirc
      • (or maybe before but it was too late to change the sql)
      • yvanzo
        alastairp: not sure, I think host is the only way
      • alastairp
        yvanzo: for example we do this in LB push.sh: https://github.com/metabrainz/listenbrainz-serv...
      • this allows us to report the git hash from the app itself
      • yvanzo
        bitmap: it always looked weird to me to have a field name 'number' that actually is free text.
      • bitmap
      • well it was intended to have its meaning determined by the series type, I guess, so it needed a general name
      • and usually it's a volume number, catalog number, or part number...
      • yvanzo
        alastairp: it would require to break out of the containement
      • bitmap
        I do think adding a searchable 'number' field makes sense, just not sure about reusing orderingattribute for that. afaict it wasn't intended to be added or at least not publicly documented
      • alastairp
        yvanzo: yes, I thought so. no problem then
      • I have a working solution now, based on your and Mineo's suggestions. just preparing PR
      • yvanzo
        bitmap: do you mean a list of "numbers" for items of this series?
      • "orderingnumbers" maybe?
      • bitmap
        yes
      • yvanzo
        Alright, would it be fine to drop the useless (and unused) orderingattribute for now?
      • bitmap
        that sounds fine to me
      • yvanzo
        Ok, thanks, I understand the situation better now. :)
      • alastairp: but you could create an ENV variable similar to these labels.
      • it would be available from containers.
      • alastairp
        yes, either an ENV or the file that we add. you're right
      • BrainzGit
        [listenbrainz-server] MonkeyDo opened pull request #1255 (master…jenkins-js-reporter): Use checkstyle eslint reporter format for Jenkins https://github.com/metabrainz/listenbrainz-serv...
      • Mr_Monkey
        alastairp: drumroll ^
      • Yeah, the report looks really nice !
      • alastairp
      • great!
      • Mr_Monkey
        (on top of reporting errors/warnings separately)
      • alastairp
        I'll slowly update other jobs to use warnings-ngs instead of regular old warnings too!
      • so now we need to decide what difference there is between stable, unstable, and failed:
      • Mr_Monkey
        I think we'll be happy with 1 error = fail
      • alastairp
        so we can differentiate between failed (tests fail) and unstable (tests pass, but there are 2 warnings)
      • right, so errors -> fail, warnings -> unstable ?
      • or warnings -> pass ?
      • Mr_Monkey
        And unstable if there are +5 new warnings?
      • How about under 5 new warnings, pass, over that mark as unstable. Any error = fail.
      • alastairp
      • oh yeah, cool. you can choose based on total number, or new ones
      • OK, I tried to configure that.
      • re-running tests
      • [ESlint] Creating SCM blamer to obtain author and commit information for affected files
      • [ESlint] -> No blamer installed yet. You need to install the 'git-forensics' plugin to enable blaming for Git.
      • that looks scary
      • Mr_Monkey
        Huh
      • alastairp
        Mr_Monkey: cool! the test has failed, because there are errors
      • so I guess it can say "error introduced by alastairp"
      • Mr_Monkey
        Great
      • alastairp
        can you fix those 10 errors?
      • Mr_Monkey
        uh, "introduced by alastairp"?
      • Yeah, that's the next step. I'll do it in the same PR I suppose
      • alastairp
        yeah, because then we should see the state of that check change from failed to passed
      • -> class for the afternoon. have a good day
      • Mr_Monkey
        Thanks for setting that up alastairp ! g'luck !
      • zas
        bitmap, yvanzo: can you have a look at trille, something is creating load spikes, badly impacting mb containers and rabbitmq performance, unsure what to do. I see critiquebrainz runs there too.
      • this is why we often get response times alerts for trille
      • basically users served by trille got very slow responses if they are unlucky enough to hit a load spike
      • d4rkie joined the channel
      • there's also critiquebrainz there
      • yvanzo
        and mbspotify
      • D4RK-PH0_ has quit
      • BrainzGit
        [listenbrainz-server] alastair opened pull request #1256 (master…jenkins-image-cleanup): Jenkins image cleanup https://github.com/metabrainz/listenbrainz-serv...
      • yvanzo
        alastairp: critiquebrainz-prod logs are probably too large: 100MB in just 24h
      • alastairp
        ok thank. possibly related to transient errors during yesterday's outage. I can put this on my list to check tomorrow
      • sorry, no time this afternoon
      • Mr_Monkey
        alastairp: Now without errors but with warnings, the build correctly end in an unstable state. However on the PR on GH that seems to be interpreted as a failed check.Not sure if there's a config change needed on Jenkins to send a non-failure status for unstable builds;
      • Alternatively we could just want to pass the builds in case of only ESLint warnings.
      • (No rush of course)
      • sumedh_p has quit
      • alastairp
        Mr_Monkey: interesting. I don't know if github has the concept of 3 states
      • Mr_Monkey
        I don't recall ever seeing that (other than "pending" as a transient state)
      • alastairp
        it looks like there is an option in the github runner to tell it to treat unstable as success:
      • Mr_Monkey
        Oooh, juicy :)
      • Let's do that then.
      • please-and-thank-you