diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c8f319a..6452f74e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,9 +34,9 @@ jobs: *setup_kwds - restore_cache: keys: - - dfs-v0-{{ .Branch }}-{{ .Revision }} - - dfs-v0-{{ .Branch }} - - dfs-v0 + - dfs-v1-{{ .Branch }}-{{ .Revision }} + - dfs-v1-{{ .Branch }} + - dfs-v1 - run: name: Test docker image builds no_output_timeout: 360m @@ -45,8 +45,7 @@ jobs: pytest --cov -k 'test_docker' neurodocker codecov - save_cache: - key: dfs-v0-{{ .Branch }}-{{ .Revision }} - when: always + key: dfs-v1-{{ .Branch }}-{{ .Revision }} paths: - /tmp/cache @@ -61,9 +60,9 @@ jobs: *setup_kwds - restore_cache: keys: - - srs-v0-{{ .Branch }}-{{ .Revision }} - - srs-v0-{{ .Branch }} - - srs-v0 + - srs-v1-{{ .Branch }}-{{ .Revision }} + - srs-v1-{{ .Branch }} + - srs-v1 - run: name: Install singularity command: | @@ -82,8 +81,7 @@ jobs: pytest --cov -k 'test_singularity' neurodocker codecov - save_cache: - key: srs-v0-{{ .Branch }}-{{ .Revision }} - when: always + key: srs-v1-{{ .Branch }}-{{ .Revision }} paths: - ~/tmp/cache diff --git a/neurodocker/generators/docker.py b/neurodocker/generators/docker.py index 07966e0b..bb922a0e 100644 --- a/neurodocker/generators/docker.py +++ b/neurodocker/generators/docker.py @@ -306,13 +306,16 @@ def _add_header(self): # base, arg noninteractive frontend, ndfreeze, header, entrypoint. offset = 1 if self._specs['instructions'][1][0] == 'ndfreeze' else 0 self._specs['instructions'].insert( - 1, ('arg', { + 1, ('user', 'root') + ) + self._specs['instructions'].insert( + 2, ('arg', { 'DEBIAN_FRONTEND': 'noninteractive' })) kwds = {'version': 'generic', 'method': 'custom'} - self._specs['instructions'].insert(2 + offset, ('_header', kwds)) + self._specs['instructions'].insert(3 + offset, ('_header', kwds)) self._specs['instructions'].insert( - 3 + offset, ('entrypoint', "/neurodocker/startup.sh")) + 4 + offset, ('entrypoint', "/neurodocker/startup.sh")) def _ispecs_to_dockerfile_str(self): pkg_man = self._specs['pkg_manager'] diff --git a/neurodocker/generators/singularity.py b/neurodocker/generators/singularity.py index 9386339b..866fb9bd 100644 --- a/neurodocker/generators/singularity.py +++ b/neurodocker/generators/singularity.py @@ -157,6 +157,8 @@ def _add_neurodocker_header(self): if self._specs['instructions'][1][0] == 'ndfreeze': offset = 1 self._specs['instructions'].insert(1 + offset, ('_header', kwds)) + self._specs['instructions'].insert(1 + offset, ('user', 'root')) + def _fill_parts(self): pkg_man = self._specs['pkg_manager'] diff --git a/neurodocker/interfaces/tests/test_miniconda.py b/neurodocker/interfaces/tests/test_miniconda.py index 3031cb16..444071ef 100644 --- a/neurodocker/interfaces/tests/test_miniconda.py +++ b/neurodocker/interfaces/tests/test_miniconda.py @@ -45,6 +45,7 @@ def test_singularity(self): ( 'miniconda', { + 'version': '4.6.14', 'create_env': 'default', 'conda_install': ['python=3.6.5', 'traits'], 'pip_install': ['nipype'], diff --git a/neurodocker/templates/miniconda.yaml b/neurodocker/templates/miniconda.yaml index 1457ed78..ddf4152a 100644 --- a/neurodocker/templates/miniconda.yaml +++ b/neurodocker/templates/miniconda.yaml @@ -17,7 +17,7 @@ generic: curl {{ miniconda.curl_opts }} -o "$conda_installer" {{ miniconda.binaries_url }} bash "$conda_installer" -b -p {{ miniconda.install_path }} rm -f "$conda_installer" - {%- if miniconda.version == "latest" %} + {% if miniconda.version == "latest" -%} conda update -yq -nbase conda {% endif -%} conda config --system --prepend channels conda-forge