Skip to content

Commit ff9a63f

Browse files
satraiishiishii
andauthored
ref: use org secret and bump base images and toolkits (#651)
* ref: use org secret * update to non-EOL base images * fix: use miniforge since mambaforge is deprecated * update base test images * Changed mirror link to http://vault.centos.org to retrieve yum packages. Removed curl and localedef in dependencies. Fix #653 * replace more occurances * fix more fedora references * fix: update jq source links * update localdef packages * update jq versions * remove jq 1.5 references * add default to test template path * fix jq builds * fix: adjust config for different versions of jq * fix: adjust config for jq 1.6 * updating apptainer version and some tests * use apptainer when set for tests * build without sudo * try if a different version works * remove default and add yum config --------- Co-authored-by: iishiishii <[email protected]>
1 parent 7a8ae7c commit ff9a63f

17 files changed

+98
-62
lines changed

.github/workflows/create_workflows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
from jinja2 import Environment, FileSystemLoader, select_autoescape
3232

3333
apt_based = [
34+
"ubuntu:24.04",
3435
"ubuntu:22.04",
35-
"ubuntu:18.04",
36+
"debian:bookworm-slim",
3637
"debian:bullseye-slim",
37-
"debian:buster-slim",
3838
]
39-
yum_based = ["fedora:36", "centos:7"]
39+
yum_based = ["fedora:40", "centos:8"]
4040

4141
"""
4242
Add a "skip_versions" key to the software dictionary if you want to skip

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- name: Install Apptainer
2121
env:
22-
VERSION: 1.1.5
22+
VERSION: 1.3.6
2323
run: |
2424
sudo apt-get update
2525
sudo apt-get install -y wget

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
run: |
4242
~/auto shipit -vv
4343
env:
44-
GH_TOKEN: ${{ secrets.AUTO_USER_TOKEN }}
44+
GH_TOKEN: ${{ secrets.AUTO_TOKEN }}

docs/user_guide/examples.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Docker
117117
118118
neurodocker generate docker \
119119
--pkg-manager yum \
120-
--base-image fedora:36 \
120+
--base-image fedora:40 \
121121
--afni method=binaries version=latest \
122122
> afni-binaries.Dockerfile
123123
@@ -130,7 +130,7 @@ This does not install AFNI's R packages. To install relevant R things, use the f
130130
131131
neurodocker generate docker \
132132
--pkg-manager yum \
133-
--base-image fedora:36 \
133+
--base-image fedora:40 \
134134
--afni method=binaries version=latest install_r_pkgs=true \
135135
> afni-binaries-r.Dockerfile
136136
@@ -149,7 +149,7 @@ This does not install AFNI's R packages. To install relevant R things, use the f
149149
150150
.. neurodocker generate docker \
151151
.. --pkg-manager yum \
152-
.. --base-image fedora:36 \
152+
.. --base-image fedora:40 \
153153
.. --afni method=source version=master \
154154
.. > afni-source.Dockerfile
155155

neurodocker/cli/minify/_trace.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ function install_missing_dependencies() {
3838

3939

4040
function install_conda_reprozip() {
41-
TMP_CONDA_INSTALLER=/tmp/miniconda.sh
41+
TMP_CONDA_INSTALLER=/tmp/miniforge.sh
4242
ls /tmp
43-
curl -sSL -o "$TMP_CONDA_INSTALLER" "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
43+
curl -sSL -o "$TMP_CONDA_INSTALLER" "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
4444
bash $TMP_CONDA_INSTALLER -b -f -p $REPROZIP_CONDA
4545
rm -f $TMP_CONDA_INSTALLER
4646
${REPROZIP_CONDA}/bin/mamba install -c conda-forge -y reprozip

neurodocker/cli/minify/tests/test_minify.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@skip_arm_on_mac
1717
def test_minify():
1818
client = docker.from_env()
19-
container = client.containers.run("python:3.9-slim", detach=True, tty=True)
19+
container = client.containers.run("python:3.10-slim", detach=True, tty=True)
2020
commands = ["python --version", """python -c 'print(123)'"""]
2121
try:
2222
runner = CliRunner()
@@ -35,7 +35,8 @@ def test_minify():
3535
assert ret == 0, f"unexpected non-zero return code when running '{cmd}'"
3636

3737
# This should fail.
38-
ret, result = container.exec_run("pip --help")
38+
cmd = "pip --help"
39+
ret, result = container.exec_run(cmd)
3940
assert ret != 0, f"unexpected zero return code when running '{cmd}'"
4041

4142
finally:
@@ -46,7 +47,7 @@ def test_minify():
4647
@skip_arm_on_mac
4748
def test_minify_abort():
4849
client = docker.from_env()
49-
container = client.containers.run("python:3.9-slim", detach=True, tty=True)
50+
container = client.containers.run("python:3.10-slim", detach=True, tty=True)
5051
commands = ["python --version", """python -c 'print(123)'"""]
5152
try:
5253
runner = CliRunner()
@@ -64,7 +65,8 @@ def test_minify_abort():
6465
assert ret == 0, f"unexpected non-zero return code when running '{cmd}'"
6566

6667
# This should still succeed.
67-
ret, result = container.exec_run("pip --help")
68+
cmd = "pip --help"
69+
ret, result = container.exec_run(cmd)
6870
assert ret == 0, f"unexpected non-zero return code when running '{cmd}'"
6971

7072
finally:
@@ -80,7 +82,7 @@ def test_minify_with_mounted_volume(tmp_path: Path):
8082
(tmp_path / "foobar.txt").write_text("Foobar")
8183

8284
container = client.containers.run(
83-
"python:3.8-slim",
85+
"python:3.10-slim",
8486
detach=True,
8587
tty=True,
8688
volumes={str(tmp_path): {"bind": "/work", "mode": "rw"}},

neurodocker/cli/tests/sample-template-jq.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ binaries:
1717
ND_BAZ: '1234'
1818
ND_FOO: BAR
1919
instructions: |
20+
export DUMMY="dummy"
21+
{%- if self.pkg_manager == "yum" %}
22+
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
23+
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
24+
{%- endif %}
2025
{{ self.install_dependencies() }}
2126
curl -fsSL --output /usr/local/bin/jq {{ self.urls[self.version]}}
2227
chmod +x /usr/local/bin/jq
2328
urls:
24-
'1.5': https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
25-
'1.6': https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
29+
'1.6': https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64
30+
'1.7': https://github.com/jqlang/jq/releases/download/jq-1.7/jq-linux64
2631
source:
2732
arguments:
2833
required:
@@ -48,13 +53,21 @@ source:
4853
ND_BAZ: '1234'
4954
ND_FOO: BAR
5055
instructions: |
56+
export DUMMY="dummy"
57+
{%- if self.pkg_manager == "yum" %}
58+
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
59+
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
60+
{%- endif %}
5161
{{ self.install_dependencies() }}
5262
mkdir jq
5363
cd jq
54-
curl -fsSL https://github.com/stedolan/jq/releases/download/jq-{{self.version}}/jq-{{self.version}}.tar.gz \
64+
curl -fsSL https://github.com/jqlang/jq/releases/download/jq-{{self.version}}/jq-{{self.version}}.tar.gz \
5565
| tar xz --strip-components 1
56-
# Only required in version 1.6
57-
autoreconf -fi
58-
./configure --disable-maintainer-mode
66+
{%- if self.version == '1.6' %}
67+
autoreconf -i
68+
./configure --with-oniguruma=builtin --disable-maintainer-mode
69+
{%- else %}
70+
./configure --with-oniguruma=builtin
71+
{%- endif %}
5972
make
6073
make install

neurodocker/cli/tests/test_build_images_with_cli.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
],
2727
)
2828
@pytest.mark.parametrize(
29-
["pkg_manager", "base_image"], [("apt", "debian:buster-slim"), ("yum", "centos:7")]
29+
["pkg_manager", "base_image"],
30+
[("apt", "debian:bullseye-slim"), ("yum", "centos:8")],
3031
)
3132
def test_build_image_from_registered(
3233
tmp_path: Path, cmd: str, pkg_manager: str, base_image: str
@@ -46,11 +47,11 @@ def test_build_image_from_registered(
4647
"--pkg-manager",
4748
pkg_manager,
4849
"--jq",
49-
"version=1.5",
50+
"version=1.7",
5051
],
5152
)
5253
assert result.exit_code == 0, result.output
53-
assert "jq-1.5/jq-linux64" in result.output
54+
assert "jq-1.7/jq-linux64" in result.output
5455

5556
spec = "Dockerfile" if cmd == "docker" else "Singularity"
5657
(tmp_path / spec).write_text(result.output)
@@ -59,6 +60,8 @@ def test_build_image_from_registered(
5960
with build_fn(tmp_path) as img:
6061
stdout, _ = run_fn(img, args=["jq", "--help"])
6162
assert "jq is a tool for processing JSON" in stdout
63+
stdout, _ = run_fn(img, args=["jq", "--version"])
64+
assert "jq-1.7" in stdout
6265

6366

6467
@pytest.mark.long
@@ -82,7 +85,7 @@ def test_json_roundtrip(cmd: str, inputs: str, tmp_path: Path):
8285
cmd,
8386
"--json",
8487
"--base-image",
85-
"debian:buster-slim",
88+
"debian:bullseye-slim",
8689
"--pkg-manager",
8790
"apt",
8891
"--install",

neurodocker/cli/tests/test_cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,18 @@ def test_render_registered(cmd: str, pkg_manager: str):
165165
[
166166
cmd,
167167
"--base-image",
168-
"debian:buster",
168+
"debian:bullseye",
169169
"--pkg-manager",
170170
pkg_manager,
171171
"--jq",
172-
"version=1.5",
173-
"--jq",
174172
"version=1.6",
173+
"--jq",
174+
"version=1.7",
175175
],
176176
)
177177
assert result.exit_code == 0, result.output
178-
assert "jq-1.5/jq-linux64" in result.output
179178
assert "jq-1.6/jq-linux64" in result.output
179+
assert "jq-1.7/jq-linux64" in result.output
180180

181181

182182
# Test that we add the default header and default/custom entrypoints
@@ -188,7 +188,7 @@ def test_default_header_and_entrypoint(cmd: str, pkg_manager: str, entrypoint: s
188188
cmd_ = [
189189
cmd,
190190
"--base-image",
191-
"debian:buster",
191+
"debian:bullseye",
192192
"--pkg-manager",
193193
pkg_manager,
194194
]

neurodocker/reproenv/tests/sample-template-jq.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ binaries:
1212
- ca-certificates
1313
- curl
1414
debs:
15-
# Not required for jq -- used to test if packackages are installed properly with dpkg.
15+
# Not required for jq -- used to test if packages are installed properly with dpkg.
1616
- http://ftp.us.debian.org/debian/pool/main/r/rust-fd-find/fd-find_7.2.0-2_amd64.deb
1717
yum:
1818
- curl
@@ -25,8 +25,8 @@ binaries:
2525
curl -fsSL --output /usr/local/bin/jq {{ self.urls[self.version]}}
2626
chmod +x /usr/local/bin/jq
2727
urls:
28-
'1.5': https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
29-
'1.6': https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
28+
'1.6': https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64
29+
'1.7': https://github.com/jqlang/jq/releases/download/jq-1.7/jq-linux64
3030
source:
3131
arguments:
3232
required:
@@ -55,10 +55,13 @@ source:
5555
{{ self.install_dependencies() }}
5656
mkdir jq
5757
cd jq
58-
curl -fsSL https://github.com/stedolan/jq/releases/download/jq-{{self.version}}/jq-{{self.version}}.tar.gz \
58+
curl -fsSL https://github.com/jqlang/jq/releases/download/jq-{{self.version}}/jq-{{self.version}}.tar.gz \
5959
| tar xz --strip-components 1
60-
# Only required in version 1.6
61-
autoreconf -fi
62-
./configure --disable-maintainer-mode
60+
{%- if self.version == '1.6' %}
61+
autoreconf -i
62+
./configure --with-oniguruma=builtin --disable-maintainer-mode
63+
{%- else %}
64+
./configure --with-oniguruma=builtin
65+
{%- endif %}
6366
make
6467
make install

neurodocker/reproenv/tests/test_build_images_from_registered_templates.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
],
2727
)
2828
@pytest.mark.parametrize(
29-
["pkg_manager", "base_image"], [("apt", "debian:buster-slim"), ("yum", "fedora:33")]
29+
["pkg_manager", "base_image"],
30+
[("apt", "debian:bullseye-slim"), ("yum", "fedora:40")],
3031
)
3132
@pytest.mark.parametrize(
3233
["jq_version", "jq_version_output", "fd_version_startswith"],
@@ -81,12 +82,13 @@ def test_build_using_renderer_from_dict(
8182
],
8283
)
8384
@pytest.mark.parametrize(
84-
["pkg_manager", "base_image"], [("apt", "debian:buster-slim"), ("yum", "fedora:33")]
85+
["pkg_manager", "base_image"],
86+
[("apt", "debian:bullseye-slim"), ("yum", "fedora:40")],
8587
)
8688
@pytest.mark.parametrize(["method"], [("binaries",), ("source",)])
8789
@pytest.mark.parametrize(
8890
["jq_version", "jq_version_output", "fd_version_startswith"],
89-
[("1.6", "jq-1.6", "fd"), ("1.5", "jq-1.5", "fd")],
91+
[("1.6", "jq-1.6", "fd"), ("1.7", "jq-1.7", "fd")],
9092
)
9193
def test_build_using_renderer_instance_methods(
9294
cmd: str,
@@ -118,10 +120,7 @@ def test_build_using_renderer_instance_methods(
118120
stdout, _ = run_fn(img, args=["jq", "--help"])
119121
assert stdout.startswith("jq - commandline JSON processor")
120122
stdout, _ = run_fn(img, args=["jq", "--version"])
121-
if method == "source" and jq_version == "1.5":
122-
assert stdout == "jq-"
123-
else:
124-
assert stdout == jq_version_output
123+
assert stdout == jq_version_output
125124
# Test that deb was installed
126125
if method == "binaries":
127126
stdout, _ = run_fn(img, args=[fd_exe, "--version"])

neurodocker/reproenv/tests/test_build_images_simple.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def test_build_simple(cmd: str, tmp_path):
2121
# Create a Dockerfile.
2222
r = rcls("apt")
2323
if isinstance(r, DockerRenderer):
24-
r.from_("debian:buster-slim", as_="builder")
24+
r.from_("debian:bullseye-slim", as_="builder")
2525
else:
26-
r.from_("debian:buster-slim")
26+
r.from_("debian:bullseye-slim")
2727
r.arg("FOO")
2828
r.copy(["foo.txt", "tst/baz.txt"], "/opt/")
2929
r.env(PATH="$PATH:/opt/foo/bin")

neurodocker/reproenv/tests/test_renderers_docker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@ def test_docker_render_from_instance_methods():
307307
)
308308

309309
d = DockerRenderer("apt")
310-
d.from_("debian:buster-slim")
310+
d.from_("debian:bullseye-slim")
311311
d.entrypoint(["echo", "foo bar"])
312312
rendered = str(d)
313313
rendered = prune_rendered(rendered).strip()
314314
assert (
315315
rendered
316316
== """\
317-
FROM debian:buster-slim
317+
FROM debian:bullseye-slim
318318
ENTRYPOINT ["echo", "foo bar"]"""
319319
)

neurodocker/reproenv/tests/test_renderers_singularity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,15 @@ def test_singularity_render_from_instance_methods():
323323
)
324324

325325
s = SingularityRenderer("apt")
326-
s.from_("debian:buster-slim")
326+
s.from_("debian:bullseye-slim")
327327
s.entrypoint(["echo", "foobar baz"])
328328
rendered = str(s)
329329
rendered = prune_rendered(rendered).strip()
330330
assert (
331331
rendered
332332
== """\
333333
Bootstrap: docker
334-
From: debian:buster-slim
334+
From: debian:bullseye-slim
335335
336336
%post
337337

0 commit comments

Comments
 (0)