diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..33c36ab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM base/archlinux + +WORKDIR /app + +# Update +RUN pacman -Syu --noconfirm + +# minigrida deps +RUN pacman -S --noconfirm python-gdal python-yaml + +# triskele deps (build) +RUN pacman -S --noconfirm git python-pip make gcc intel-tbb boost + +# LD2DAPs deps +RUN pacman -S --noconfirm python-pandas python-scikit-learn + +# !#$*(&@(&(%* +RUN pacman -S --noconfirm python-matplotlib + +# Dependencies +# TODO: prod pip install +# TODO: remove source +## Triskele +RUN git clone https://git.normalized.xyz/Florent/Triskele.git \ + && cd Triskele \ + && make -f MakefileNoOTB apGenerator -j 8\ + && cd python \ + && pip install -e . + +## LD2DAPs +RUN git clone https://git.normalized.xyz/Florent/LD2DAPs.git \ + && cd LD2DAPs \ + && pip install -e . + +RUN mkdir Enrichment Data + +## Minigrida scripts +ADD . /app + +CMD ["python", "supervisor.py"] diff --git a/cvgenerators/jurse.py b/cvgenerators/jurse.py index 1f6948e..c68eb20 100644 --- a/cvgenerators/jurse.py +++ b/cvgenerators/jurse.py @@ -9,7 +9,6 @@ # TODO details import numpy as np -import ipdb class Split: """Geographic split cross validation generator. diff --git a/docker-compose-nfs.yml b/docker-compose-nfs.yml new file mode 100644 index 0000000..1d3c80f --- /dev/null +++ b/docker-compose-nfs.yml @@ -0,0 +1,30 @@ +version: '3.7' + +# NFS server require `nfs` and `nfsd` module. You can add them in +# `/etc/modules-load.d/nfs.conf` for automatic handling during boot. + +services: + minigrida-storage: + image: erichough/nfs-server + environment: + NFS_EXPORT_0: '/nfs *(rw,sync,crossmnt,fsid=0)' + NFS_EXPORT_1: '/nfs/music *(rw,sync)' + NFS_EXPORT_2: '/nfs/home *(rw,sync,nohide)' + + #NFS_EXPORT_0: '/nfs *(rw,all_squash,anonuid=1000,anongid=974,fsid=0)' + #NFS_EXPORT_0: '/nfs *(rw,sync,crossmnt,fsid=0)' + #NFS_EXPORT_1: '/nfs/enrichment *(rw,sync,all_squash,fsid=0,anonuid=99,anongid=99)' + #NFS_EXPORT_2: '/nfs/data *(rw,sync,all_squash,fsid=0,anonuid=99,anongid=99)' + volumes: + - ./nfs_data:/nfs + #- data:/nfs/data + #- enrichment:/nfs/enrichment + ports: + - 2049:2049 + cap_add: + - SYS_ADMIN + +volumes: + data: + enrichment: + nfs: diff --git a/docker-compose-registry.yml b/docker-compose-registry.yml new file mode 100644 index 0000000..9d8f06d --- /dev/null +++ b/docker-compose-registry.yml @@ -0,0 +1,14 @@ +version: '3.7' + +services: + registry: + image: registry + restart: always + volumes: + - storage:/var/lib/registry + ports: + - 5000:5000 + +volumes: + storage: + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f45778d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.7' + +services: + minigrida: + build: . + image: metropolis:5000/minigrida + environment: + - HOST + volumes: + - enrichment:/app/Enrichment + - data:/app/Data + deploy: + mode: global + +volumes: + data: + driver_opts: + type: "nfs" + o: "addr=metropolis,nolock,soft,rw" + device: ":/srv/nfs/data" + enrichment: + driver_opts: + type: "nfs" + o: "addr=metropolis,nolock,soft,rw" + device: ":/srv/nfs/enrichment" diff --git a/supervisor.py b/supervisor.py index bada05e..4b7c000 100644 --- a/supervisor.py +++ b/supervisor.py @@ -122,7 +122,8 @@ def run(expe_file): def create_report(experience, stime=None, etime=None): expe_report = OrderedDict() - expe_report['supervisor'] = os.uname()[1] + host = os.getenv("HOST") + expe_report['supervisor'] = host if host is not None else os.uname()[1] # Dates for datek, timev in zip(('start_date', 'end_date'), (stime, etime)):