nipreps / mriqc

Automated Quality Control and visual reports for Quality Assessment of structural (T1w, T2w) and functional MRI of the brain
http://mriqc.readthedocs.io
Apache License 2.0
300 stars 132 forks source link

BUG: puzzling erroneous version reporting in docker #1354

Open bpinsard opened 2 months ago

bpinsard commented 2 months ago

What happened?

I noticed that the MRIQC package in docker are all reporting a non-existent version that mismatch the version of the docker tag for the 24 line. I haven't checked the 23 and older.

That is likely the version that gets reported in the outputs too, disrupting reproducibility.

What command did you use?

#24.0.0
$ docker run nipreps/mriqc:24.0.0 --version
MRIQC v24.1.0.dev0+g3fe90466.d20240417

#24.0.1
$ docker run nipreps/mriqc:24.0.1 --version
MRIQC v24.1.0.dev0+g5c3f8b6e.d20240820

#24.0.2
$ docker run nipreps/mriqc:24.0.2 --version
MRIQC v24.1.0.dev0+gd5b13cb5.d20240826

What version of the software are you running?

24.0.*

How are you running this software?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

No response

Additional information / screenshots

No response

bpinsard commented 2 months ago

something fishy in the circleCI -> hatch link when running the docker build

effigies commented 2 months ago

It looks like the package is getting polluted, so a dirty version is being calculated.

bpinsard commented 2 months ago

Oh ok, I don't know when the problem started, but it is present in 23 too, where it can be listed as 24.0.0

$ docker run nipreps/mriqc:23.1.1 --version
You are using MRIQC v24.0.0.dev0+g4d96184d.d20240320, and a newer version is available: 24.0.2.
MRIQC v24.0.0.dev0+g4d96184d.d2024032
effigies commented 2 months ago

Looks like we inject a token during the build process.

https://github.com/nipreps/mriqc/blob/d5b13cb56b6de1493ad91979f0e1e48ebb6708db/.circleci/config.yml#L131-L137

So we probably need to set:

ARG VERSION
ENV SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION

In the build step:

https://github.com/nipreps/mriqc/blob/d5b13cb56b6de1493ad91979f0e1e48ebb6708db/Dockerfile#L31-L37