Skip to content

Conversation

@eilidhmacnicol
Copy link
Collaborator

Supercedes #53

Changes proposed in this pull request

Documentation that should be reviewed

@eilidhmacnicol eilidhmacnicol requested a review from oesteban April 18, 2023 16:27
@eilidhmacnicol
Copy link
Collaborator Author

I expected this to break some of the workflows (e.g. bumping smriprep will have an effect on workflow names) but since I'm about to implement some refactoring thought this was a good first step.

@eilidhmacnicol eilidhmacnicol force-pushed the docker/docker_overhaul branch from aea81fe to 86947cc Compare May 10, 2023 10:31
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some ignore-able notes on the GitHub actions. That can be dealt with separately. I did see one thing in your Dockerfile.

test "${INSTALLED_VERSION}" = "${THISVERSION}"
- name: Install in confined environment [setup.py - install]
run: |
python -m venv /tmp/setup_install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can go ahead and get rid of setup.py - install. Setuptools does not recommend installing this way. You could replace with pip install .. You should not need to install dependencies manually first.

- name: Install in confined environment [setup.py - develop]
run: |
python -m venv /tmp/setup_develop
source /tmp/setup_develop/bin/activate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, setup.py develop can be replaced with pip install -e . You should not need to install dependencies manually first.

@effigies
Copy link
Member

There's something up with the Circle builds. You're getting:

Unable to find image 'nipreps/fmriprep-rodents:latest' locally
latest: Pulling from nipreps/fmriprep-rodents
...

In the anatomical workflow.

Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@eilidhmacnicol
Copy link
Collaborator Author

Thanks for the speedy review.

I think the GHA fails are being investigated. Other than that, I think I'll come back to the setup.py changes more thoroughly because I think we also need to flesh out the pyproject.toml approach more generally.

RE circle builds: I think it's because there's no docker registry set up. I'll try to emulate fmriprep's code and come back with something soon.

@effigies
Copy link
Member

To fix the version, you need to remove things that are checked into git from your dockerignore:

# git
.gitignore
.git/**/*
.git
.mailmap
# CI, etc.
.circleci
.circleci/**/*
.github
.github/**/*
.zenodo.json
.travis.yml
.readthedocs.yml
.versions.json
CONTRIBUTING.md

@eilidhmacnicol
Copy link
Collaborator Author

Thanks - I was going to just comment out the check until versioneer was removed (i.e. something like nipreps/fmriprep@2191833 if pyproject.toml is upcoming) but this is much easier. 🤞🏼

@eilidhmacnicol eilidhmacnicol force-pushed the docker/docker_overhaul branch from 327f140 to 32b7740 Compare May 10, 2023 15:45
RUN pip install build
RUN apt-get update && \
apt-get install -y --no-install-recommends git
COPY . /src/fmriprep
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO NOT ACCEPT

@eilidhmacnicol @oesteban @mgxd One approach we could take to avoid annoying .dockerignore mismatches could be:

Suggested change
COPY . /src/fmriprep
COPY .git /src/fmriprep/.git
RUN git -C /src/fmriprep reset --hard HEAD

This would ensure that images only get built from commits, and not from dirty worktrees. I'm not sure whether we value being able to build from a dirty worktree... Personally, I just fmriprep-docker ... --patch fmriprep=$PWD/fmriprep when I want that.

@effigies
Copy link
Member

effigies commented May 10, 2023

Eilidh, for reference, I did the following to find the remaining things to remove from .dockerignore:

$ docker build --target=src -t fmriprep-rodents:test .
$ docker run --rm -it --entrypoint=bash fmriprep-rodents:test
> cd /src/fmriprep
> git status
On branch docker/docker_overhaul
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	deleted:    .maint/contributors.json
	deleted:    .maint/developers.json
	deleted:    .maint/former.json
	deleted:    .maint/paper_author_list.py
	deleted:    .maint/update_changes.sh
	deleted:    .maint/update_zenodo.py
	deleted:    Makefile

no changes added to commit (use "git add" and/or "git commit -a")

@eilidhmacnicol
Copy link
Collaborator Author

Okay, I gave it a shot but this is way over my head. Don't suppose you have any ideas, @effigies?

@eilidhmacnicol
Copy link
Collaborator Author

eilidhmacnicol commented May 10, 2023

Great! The tests are still failing, but at least now they are failing like I expected them to do. Unless there's anything else, I think this might be ready to merge. Thanks for all your help today, @effigies!

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and merge when you're ready.

@eilidhmacnicol eilidhmacnicol merged commit 1a9784d into nipreps:master May 11, 2023
@eilidhmacnicol eilidhmacnicol deleted the docker/docker_overhaul branch May 11, 2023 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants