Skip to content

Commit

Permalink
Merge pull request #1 from kaczmarj/add/pytests
Browse files Browse the repository at this point in the history
WIP: Add/pytests
  • Loading branch information
Shotgunosine authored Sep 14, 2018
2 parents 7d595e4 + 117f182 commit da0ab3b
Show file tree
Hide file tree
Showing 19 changed files with 751 additions and 532 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ jobs:
machine: true
steps:
- checkout
- run: docker build -t afni/afni_dev:$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} -f Dockerfile.dev .
- run:
- run: docker build -t afni/afni_dev:$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} --build-arg AFNI_WITH_COVERAGE=1 .
- run:
no_output_timeout: 2h
command: |
ci_env=`bash <(curl -s https://codecov.io/env)`
docker run $ci_env afni/afni_dev:$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} /usr/afni_build_dir/tests/run_tests.sh
- run:
command: |
set +o pipefail
if [ $DOCKER_USER == 'afni' ]
set +o pipefail
if [ $DOCKER_USER == 'afni' ]
then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker build -t afni/afni:$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} -f Dockerfile .
docker build -t afni/afni:$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} .
docker tag afni/afni_dev:$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} afni/afni_dev:latest
docker push afni/afni_dev
docker tag afni/afni:$CIRCLE_BUILD_NUM-${CIRCLE_SHA1:0:6} afni/afni:latest
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ ___*
# Octave workspace
octave-workspace
/Debug/

# Python
__pycache__
*.pyc

# Test and coverage artifacts
.pytest_cache
.coverage
98 changes: 64 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,70 @@
FROM ubuntu:bionic-20180526@sha256:c8c275751219dadad8fa56b3ac41ca6cb22219ff117ca98fe82b42f24e1ba64e
USER root
RUN apt-get update -y ; apt-get upgrade -y

ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get install -y tcsh vim
RUN apt-get install -y libxmu-dev libxt-dev libmotif-dev
RUN apt-get install -y libxpm-dev libxi-dev libxmhtml-dev
RUN apt-get install -y libglw1-mesa-dev libglu1-mesa-dev
RUN apt-get install -y libglib2.0-dev libgsl-dev
RUN apt-get install -y r-base m4
RUN apt-get install -y python-qt4 git
RUN apt-get install -yq --no-install-recommends gcc
RUN apt-get install -yq --no-install-recommends g++
RUN apt-get update -y -qq \
&& apt-get install -yq --no-install-recommends \
ca-certificates \
curl \
g++ \
gcc \
git \
libglib2.0-dev \
libglu1-mesa-dev \
libglw1-mesa-dev \
libgsl-dev \
libmotif-dev \
libxi-dev \
libxmhtml-dev \
libxmu-dev \
libxpm-dev \
libxt-dev \
m4 \
python-matplotlib \
python-numpy \
python-qt4 \
python-rpy2 \
python-tk \
r-base \
tcsh \
vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#######################################
# this copies source code from the host
# into the image and invalidates the cache
RUN mkdir /usr/afni_build_dir
WORKDIR /usr/afni_build_dir
RUN mkdir src .git
ADD src src
ADD .git .git
# Copy AFNI source code. This can invalidate the build cache.
ARG AFNI_ROOT=/opt/afni
COPY [".", "$AFNI_ROOT/"]

ENV PATH=$PATH:/usr/afni_build_dir/src/afni_src/abin
ARG VERSION
# RUN git checkout "${VERSION}"
WORKDIR /usr/afni_build_dir/src
ARG AFNI_MAKEFILE_SUFFIX=linux_ubuntu_16_64
ARG AFNI_WITH_COVERAGE="0"

# o files are ignored by the repo but will
# cause the build to fail.
RUN make -f Makefile.linux_ubuntu_16_64 afni_src.tgz \
&& tar zxvf afni_src.tgz \
&& cd afni_src \
&& cp Makefile.linux_ubuntu_16_64 Makefile
WORKDIR /usr/afni_build_dir/src/afni_src
# RUN make libmri.so
RUN make itall && mv linux_ubuntu_16_64 /opt/abin
WORKDIR /opt/abin
WORKDIR "$AFNI_ROOT/src"
RUN \
if [ "$AFNI_WITH_COVERAGE" != "0" ]; then \
echo "Adding testing and coverage components" \
&& sed -i 's/# CPROF = /CPROF = -coverage /' Makefile.$AFNI_MAKEFILE_SUFFIX \
&& curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3 - --no-cache-dir \
&& pip3 install --no-cache-dir \
codecov \
pytest \
pytest-cov; \
fi \
\
# Clean AFNI src directory (*.o files can cause build to fail).
&& make -f Makefile.$AFNI_MAKEFILE_SUFFIX afni_src.tgz \
&& mv afni_src.tgz .. \
&& cd .. \
\
# Empty the src directory, and replace with the contents of afni_src.tgz
&& rm -rf src/ && mkdir src \
&& tar -xzf afni_src.tgz -C $AFNI_ROOT/src --strip-components=1 \
&& rm afni_src.tgz \
\
# Build AFNI.
&& cd src \
&& cp Makefile.$AFNI_MAKEFILE_SUFFIX Makefile \
&& make itall \
&& mv $AFNI_MAKEFILE_SUFFIX $AFNI_ROOT/abin

ENV PATH="$AFNI_ROOT/abin:$PATH"
WORKDIR "$AFNI_ROOT"
47 changes: 0 additions & 47 deletions Dockerfile.dev

This file was deleted.

9 changes: 5 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ purposes as well. See https://afni.nimh.nih.gov/afni for more fun.
AFNI directory
--------------

Currently top directory contains only two sub-directories
Currently top directory contains three sub-directories

doc/
documentation for AFNI
src/
source code for AFNI

tests/
tests for AFNI

Relevant git-ology for AFNI
---------------------------
Expand Down Expand Up @@ -90,7 +91,7 @@ To make and install everything do::
make vastness

The command::

make cleanest

will remove all the *.o files, etc.
3 changes: 1 addition & 2 deletions src/3dmaxima.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
of Wisconsin, 1994-2000, and are released under the Gnu General Public
License, Version 2. See the file README.Copyright for details.
******************************************************************************/

static char * g_history[] =
{
"History:",
Expand Down Expand Up @@ -452,4 +452,3 @@ ENTRY("process_args");

RETURN(0);
}

Loading

0 comments on commit da0ab3b

Please sign in to comment.