exercism / rust-test-runner

GNU Affero General Public License v3.0
3 stars 15 forks source link

Update base images to specific versions #3

Closed ccare closed 4 years ago

ccare commented 4 years ago

Hi @coriolinus,

Please feel free to think about a different way of achieving this... but I can't think of one right now.

To ensure that all builds are repeatable, I think we need to be explicit about versions of base images. To this end, I've tried to replace the docker tags 'nightly' and 'latest' with more stable tags.

The first change I've made is, I think, reasonable. We'll want a specific git-commit to relate to a specific rust language.

It's the versioning of the second base image that frustrates me. The nightly builds have no other versioned tagging, so the only way of achieving stability is to be precise with the SHA digest (which has poor readability). I wondered whether there's another docker image we could use here, but I don't know enough about the Rust ecosystem to understand.

Appreciate your insights.

ccare commented 4 years ago

Interesting. I'd not appreciated the 6 week cycle until now. Although using latest probably won't achieve what you're hoping for.

I think there are two main problems here:

1) What is nightly depends on the invocation time (and to some extent, the state of the caches) on the build environment at the time of build. Given we currently label an image with the git-sha, builds won't be repeatable and this will make it hard to replicate/test issues in different environments.

2) We want to keep the runtime environment up-to-date. Hence the motivation for using nightly.

However, all of this only applies to building of an image. Not to running it. So unless we manually reimage the container (which isn't idempotent) we won't see any change to the runtime environment (even though the container is based on nightly). So whatever we do, we're going to have to do periodic updates of some frequency, the nightly flag won't help with that in that regard (although it would avoid a code change on re-release).

Our other issue is that images are currently labelled off their git sha, so ideally we would have a 'bump' commit to indicate a new version needed building. At the moment a given image version is 1..1 with a git commit (and optionally a git tag) and maintaining that invariant would be helpful for me (it would allow us to rollback etc).

Just to be clear, the current build process is something like this

We could, I guess, have a script that releases a new version of the container every N weeks. We could introduce automatic fixtures into the process and aim for something between option (1) and option (2). I'm thinking automatic testing, but with a manual smoke test.

The minimal process would, I think, look something like this:

We can do as much as we can to make that loop fast. But I think the fundamental question is how often we should (and practically how much time you have to) go around that loop.

@iHiD - you may have an opinion on this too.

iHiD commented 4 years ago

Based on what you've both said, I think a new git commit (and subsequent build/deploy) every 12 weeks with a tested stable version (not nightly) is the most sensible approach.

coriolinus commented 4 years ago

@iHiD the student code must run on some nightly version, unfortunately, because emitting the test results as JSON has not yet been formally promoted to stable. (I think it might work on Rust's beta branch--which is intermediate between stable and nightly--but I haven't been able to discover a public updated docker image of the beta version, and I'd prefer not to maintain one myself.)

ccare commented 4 years ago

I see - that's the missing feature we need. I think all we need to to periodically - every 12 weeks or so - 'pick' a nightly tag then.

ccare commented 4 years ago

I've reverted this because, weirdly, the image ids that I proposed seem to have disappeared on DockerHub.