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

[INFRA] test docker builds in CI #487

Merged
merged 71 commits into from Feb 7, 2023
Merged

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Jan 7, 2023

closes #481

aim

This PR aims to provide a CI workflow to evaluate what docker build will actually succeed for "some" versions of "some" of the main software that neurodocker supports.

changes

The PR adds:

  • a jinja template for a github workflow
  • a script to
    • create actual workflows from this
    • create a build dashboard (docs/README.md) to be rendered with github pages
  • a workflow to run that script in CI and push to a branch to run the workflows

explanation

the template + script allow to test:

  • different linux distributions (split by the package manager they use)
  • different softwares that neurodocker supports
  • different versions for a given software
  • different install method for a given software

all of those are defined in a python dictionary.

each workflow:

  • installs the latest version of neurodocker
  • builds a dockerfile for a combination of OS / software / version / install method
  • cat the dockerfile
  • attempts to build the corresponding image
  • each workflow will run twice a month automatically

other

This PR also adds a dashboard to let users know what are the builds that are valid.

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Jan 7, 2023

Will update this message as more builds finish.

Some additional notes and conclusions:

  • I did not test all versions of all softwares I went for a "grid search" (most recent, most ancient and soemthing in the middle)

centos:8

  • is a no go

ants

  • installing from source is a no go
make[2]: *** [CMakeFiles/ITKv5.dir/build.make:98: ITKv5-prefix/src/ITKv5-stamp/ITKv5-download] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/ITKv5.dir/all] Error 2
make: *** [Makefile:121: all] Error 2

MRrtix

  • installing from source is a no go

CAT12

does it require matlab MCR 2017b?

freesurfer

  • green everywhere but for centos:8

fsl

  • requires the yes flag to work in most cases. should probably be made a default.

afni

  • failing across the board but that is known issue on the neurodocker side

spm12

  • no java runtime engine error on ubuntu 20:04 and 22:04, debian buster and bullseye, and fedora36

matlab MCR

Getting this error with the oldest version of the MCR (BTW why is this antique version still supported?)

2010a error
Traceback (most recent call last):
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/reproenv/renderers.py", line 77, in _render_string_from_template
    source = tmpl.render(template=template)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 2, in top-level template code
jinja2.exceptions.UndefinedError: 'dict object' has no attribute '2010a'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.9/x64/bin/neurodocker", line 33, in <module>
    sys.exit(load_entry_point('neurodocker', 'console_scripts', 'neurodocker')())
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/cli/generate.py", line 431, in docker
    _base_generate(
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/cli/generate.py", line 408, in _base_generate
    r = renderer.from_dict(renderer_dict)
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/reproenv/renderers.py", line 213, in from_dict
    renderer.add_registered_template(method_or_template, **kwds)
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/reproenv/renderers.py", line 366, in add_registered_template
    self.add_template(template=template, method=method)
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/reproenv/renderers.py", line 278, in add_template
    d: ty.Mapping[str, str] = {
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/reproenv/renderers.py", line 281, in <dictcomp>
    ): _render_string_from_template(v, template_method)
  File "/home/runner/work/neurodocker/neurodocker/neurodocker/reproenv/renderers.py", line 79, in _render_string_from_template
    raise RendererError(err) from e
neurodocker.reproenv.exceptions.RendererError: A template included in this renderer raised an error. Please check the template definition. A required argument might not be included in the required arguments part of the template. Variables in the template should start with `self.`.

Comment on lines 44 to 46
# requires a token with repo and workflow permissions
with:
token: ${{ secrets.BOOTSTRAP }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Running this will require setting up a token


template_folder = Path(__file__).parents[2].joinpath("neurodocker", "templates")

build_dashboard_file = Path(__file__).parents[2].joinpath("docs", "README.md")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The dashboard is added to the docs folder and rendered with github pages.

That means that to make test this I had to nuke the .nojekyll file that was in there.

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Jan 18, 2023

if so, we may be able to create a special branch for CI testing. and a generic workflow that runs the script and pushes the changes to that branch for the CI testing (similar to how the current release workflow updates changes). this would allow us to focus on the script generator and also leave the main branch not reflect failed tests. we could also consider a gh-pages dashboard.

OK I think that all of this is now implemented with the latest commits:

  • workflows are created by the bootstrap workflow
  • pushed to the test_docker_build branch to be run
  • this also adds a README.md in the docs folder that will become the dashboard rendered by github pages: https://remi-gau.github.io/neurodocker/

Note that:

  • The bootstrap requires a token with repo and workflows permission.
  • I have had remove the .nojekyll file that was in the docs folder so you may have to tweak things to make this work with your set up, because I suspect this file was there for a reason.

@satra
Copy link
Contributor

satra commented Feb 3, 2023

@Remi-Gau - could i bother you to run a black update on this branch :)

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Feb 3, 2023

Music to my ears.
As soon as I can get away from this flock of parrots and get my hands on a computer. (it's complicated)

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Feb 4, 2023

@Remi-Gau - could i bother you to run a black update on this branch :)

@satra Done

@satra satra merged commit 0414fa0 into ReproNim:master Feb 7, 2023
@Remi-Gau Remi-Gau deleted the test_build branch February 7, 2023 15:21
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.

versioning support
4 participants