Skip to content

Commit 8ed5f9e

Browse files
committed
[Dockerfile] Install nixpy (and deps) for validation
1 parent d670df4 commit 8ed5f9e

File tree

3 files changed

+15
-37
lines changed

3 files changed

+15
-37
lines changed

Dockerfile

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,64 +27,43 @@ RUN go build ./cmd/ginvalid
2727

2828
### ============================ ###
2929

30-
# NIX BUILDER IMAGE
31-
FROM alpine:latest as nixbuilder
32-
33-
# HDF5 is in the 'testing' repository
34-
RUN echo http://dl-2.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
35-
RUN apk --no-cache --no-progress add \
36-
git \
37-
openssh \
38-
cmake \
39-
doxygen \
40-
git \
41-
build-base \
42-
boost-dev \
43-
boost-static \
44-
cppunit-dev \
45-
hdf5-dev \
46-
hdf5-static
47-
48-
RUN git clone https://github.com/G-Node/nix /nix
49-
WORKDIR /nix
50-
RUN git checkout master
51-
RUN mkdir build
52-
WORKDIR build
53-
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=Yes -DBUILD_STATIC=on ..
54-
RUN make all
55-
5630
# RUNNER IMAGE
5731
FROM alpine:latest
5832

5933
# Runtime deps
60-
RUN echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \
61-
&& apk --no-cache --no-progress add \
34+
RUN echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
35+
RUN echo http://dl-2.alpinelinux.org/alpine/edge/testing/ >> /etc/apk/repositories
36+
RUN apk --no-cache --no-progress add \
6237
bash \
6338
git \
6439
nodejs \
6540
npm \
6641
openssh \
6742
python3 \
68-
py3-lxml
43+
py3-lxml \
44+
py3-h5py \
45+
py3-numpy
6946

7047
# Install the BIDS validator
7148
RUN npm install -g bids-validator
7249

73-
# Install odml for odML validation
50+
# Upgrade pip before install python packages
7451
RUN pip3 install -U pip
52+
53+
# Install odml for odML validation
7554
RUN pip3 install odml
7655

7756
# Copy odML validation script
7857
COPY ./scripts/odml-validate /bin
7958

59+
# Install NIXPy for NIX validation
60+
# Use master branch until new beta is released
61+
RUN pip3 install --no-cache-dir -U git+https://github.com/G-Node/nixpy@master
62+
8063
# Copy git-annex from builder image
8164
COPY --from=binbuilder /git-annex /git-annex
8265
ENV PATH="${PATH}:/git-annex/git-annex.linux"
8366

84-
# Copy nixio-tool from nixbuilder image
85-
COPY --from=nixbuilder /nix/build/nixio-tool /bin
86-
87-
RUN nixio-tool
8867
RUN mkdir -p /gin-valid/results/
8968
RUN mkdir -p /gin-valid/tmp/
9069
RUN mkdir -p /gin-valid/config

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var defaultCfg = ServerCfg{
7272
},
7373
Executables{
7474
BIDS: "bids-validator",
75-
NIX: "nixio-tool",
75+
NIX: "nixio-validate",
7676
ODML: "odml-validate",
7777
},
7878
Directories{

internal/web/validate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ func validateNIX(valroot, resdir string) error {
201201
outBadge := filepath.Join(resdir, srvcfg.Label.ResultsBadge)
202202

203203
var out, serr bytes.Buffer
204-
args := append([]string{"validate"}, nixfiles...)
205-
cmd := exec.Command(srvcfg.Exec.NIX, args...)
204+
cmd := exec.Command(srvcfg.Exec.NIX, nixfiles...)
206205
out.Reset()
207206
serr.Reset()
208207
cmd.Stdout = &out

0 commit comments

Comments
 (0)