Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: puzzling erroneous version reporting in docker #1354

Open
bpinsard opened this issue Aug 30, 2024 · 4 comments · May be fixed by #1357
Open

BUG: puzzling erroneous version reporting in docker #1354

bpinsard opened this issue Aug 30, 2024 · 4 comments · May be fixed by #1357
Labels

Comments

@bpinsard
Copy link

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 bpinsard added the bug label Aug 30, 2024
@bpinsard bpinsard changed the title BUG: puzzling erroneous version reporting BUG: puzzling erroneous version reporting in docker Aug 30, 2024
@bpinsard
Copy link
Author

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

@effigies
Copy link
Member

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

@bpinsard
Copy link
Author

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
Copy link
Member

Looks like we inject a token during the build process.

mriqc/.circleci/config.yml

Lines 131 to 137 in d5b13cb

# Get version before making repo dirty
THISVERSION=$( python3 -m hatch version )
# Inject MRIQC-WebAPI secret
if [ "${MRIQC_API_SECRET_TOKEN}" != "" ]; then
sed -i -E "s/<secret_token>/$MRIQC_API_SECRET_TOKEN/" mriqc/config.py
grep -q -i $MRIQC_API_SECRET_TOKEN mriqc/config.py
fi

So we probably need to set:

ARG VERSION
ENV SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION

In the build step:

mriqc/Dockerfile

Lines 31 to 37 in d5b13cb

FROM python:slim AS src
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends git
RUN python -m pip install -U pip build
COPY . /src
RUN python -m build /src

oesteban added a commit that referenced this issue Sep 10, 2024
@oesteban oesteban linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants