Commit 56330f76 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[README] getting started updates, added .nix files, docker fixes

parent ce9814b9
...@@ -18,38 +18,83 @@ progress. Please report and improve this documentation if you encounter ...@@ -18,38 +18,83 @@ progress. Please report and improve this documentation if you encounter
issues. issues.
### Build Core Code ### Build Core Code
#### Docker #### Docker
curl -sSL https://gitlab.iscpif.fr/gargantext/haskell-gargantext/raw/master/devops/docker-install | sh
``` sh
curl -sSL https://gitlab.iscpif.fr/gargantext/haskell-gargantext/raw/master/devops/docker/docker-install | sh
```
#### Debian #### Debian
curl -sSL https://gitlab.iscpif.fr/gargantext/haskell-gargantext/raw/master/devops/debian-install | sh
``` sh
curl -sSL https://gitlab.iscpif.fr/gargantext/haskell-gargantext/raw/master/devops/debian/install | sh
```
### Add dependencies ### Add dependencies
1. CoreNLP is needed (EN and FR); This dependency will not be needed 1. CoreNLP is needed (EN and FR); This dependency will not be needed
soon. soon.
- wget https://dl.gargantext.org/coreNLP.tar.bz2
- tar xvjf coreNLP.tar.bz2 ``` sh
- ./startServer.sh ./devops/install-corenlp
```
2. Louvain C++ needed to draw the socio-semantic graphs 2. Louvain C++ needed to draw the socio-semantic graphs
- git clone https://gitlab.iscpif.fr/gargantext/clustering-louvain-cplusplus.git
- cd clustering-louvain-cplusplus NOTE: This is already added in the Docker build.
- ./install
``` sh
git clone https://gitlab.iscpif.fr/gargantext/clustering-louvain-cplusplus.git
cd clustering-louvain-cplusplus
./install
```
### Initialization ### Initialization
Users has to be created first (user1 is created as instance): #### Docker
Run PostgreSQL first:
``` sh
cd devops/docker
docker-compose up
```
- stack install Initialization schema should be loaded automatically (from `devops/postgres/schema.sql`).
- ~/.local/bin/gargantext-init "gargantext.ini"
#### Gargantext
Users have to be created first (`user1` is created as instance):
``` sh
stack install
~/.local/bin/gargantext-init "gargantext.ini"
```
For Docker env, run:
``` sh
stack run gargantext-init -- gargantext.ini
```
### Importing data
You can import some data with:
``` sh
docker run --rm -it -p 9000:9000 cgenie/corenlp-garg
stack exec gargantext-import -- "corpusCsvHal" "user1" "IMT3" gargantext.ini 10000 ./1000.csv
```
## Use Cases ## Use Cases
### Multi-User with Graphical User Interface (Server Mode) ### Multi-User with Graphical User Interface (Server Mode)
``` sh
~/.local/bin/stack --docker exec gargantext-server -- --ini "gargantext.ini" --run Prod ~/.local/bin/stack --docker exec gargantext-server -- --ini "gargantext.ini" --run Prod
Then you can log in with user1:1resu ```
Then you can log in with `user1:1resu`.
### Command Line Mode tools ### Command Line Mode tools
......
{ghc}:
with (import <nixpkgs> {});
haskell.lib.buildStackProject {
inherit ghc;
name = "gargantext";
buildInputs = [
docker-compose
blas
bzip2
gfortran
glibc
gmp
gsl
igraph
liblapack
pcre
postgresql
#stack
xz
zlib
];
}
FROM openjdk
ADD home/debian/CoreNLP /CoreNLP
WORKDIR /CoreNLP
CMD ./startServer.sh
with (import <nixpkgs> {});
stdenv.mkDerivation rec {
name = "env";
env = buildEnv {
name = name;
paths = buildInputs;
};
buildInputs = [
docker-compose
#glibc
#gmp
#gsl
#igraph
#pcre
#postgresql
#stack
#xz
];
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
touch $out
'';
}
from fpco/stack-build:lts-14.6 from fpco/stack-build:lts-14.22
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y git libigraph0-dev && \ apt-get install -y git libigraph0-dev && \
......
...@@ -10,9 +10,15 @@ services: ...@@ -10,9 +10,15 @@ services:
POSTGRES_PASSWORD: C8kdcUrAQy66U POSTGRES_PASSWORD: C8kdcUrAQy66U
POSTGRES_DB: gargandbV5 POSTGRES_DB: gargandbV5
volumes: volumes:
- pgdata:/var/lib/postgresql/data - garg-pgdata:/var/lib/postgresql/data
- ../:/gargantext - ../:/gargantext
- ../dbs:/dbs - ../dbs:/dbs
- ../postgres/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
corenlp:
image: 'cgenie/corenlp-garg'
ports:
- 9000:9000
volumes: volumes:
pgdata: garg-pgdata:
#!/bin/bash
if [ "$#" -lt 3 ]; then if [ "$#" -lt 3 ]; then
echo "Usage: $0 <name> <path> <limit>" echo "Usage: $0 <name> <path> <limit>"
exit 1 exit 1
......
...@@ -37,27 +37,27 @@ exec sudo -E /usr/bin/docker \"\$@\"" >> $DOCKERBIN ...@@ -37,27 +37,27 @@ exec sudo -E /usr/bin/docker \"\$@\"" >> $DOCKERBIN
fi fi
######################################################################## ########################################################################
curl -sSL https://get.haskellstack.org/ | sh if stack --version;
stack update then
stack upgrade echo "Haskell stack installed, ok"
else
curl -sSL https://get.haskellstack.org/ | sh
stack update
stack upgrade
fi
git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
cd haskell-gargantext cd haskell-gargantext
git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext
mkdir deps ../install-deps $(pwd)
cd deps
git clone https://gitlab.iscpif.fr/gargantext/clustering-louvain.git pushd devops/docker
git clone https://github.com/np/servant-job.git docker build --pull -t fpco/stack-build:lts-14.22-garg .
git clone https://github.com/np/patches-map popd
git clone https://gitlab.com/npouillard/patches-class.git
git clone https://github.com/delanoe/haskell-opaleye
git clone -b next --single-branch https://github.com/delanoe/hsparql
cd ..
stack docker pull #stack docker pull
stack --docker setup stack --docker setup
stack --docker build stack --docker build
stack --docker install stack --docker install
......
#!/bin/bash
set -eu set -eu
docker stop dbgarg || : docker stop dbgarg || :
docker rm --volumes dbgarg || : docker rm --volumes dbgarg || :
export PGPASSWORD="$(grep DB_PASS gargantext.ini | \awk '{print $3}')" export PGPASSWORD="$(grep DB_PASS gargantext.ini | \awk '{print $3}')"
......
#!/bin/bash
stack --docker exec gargantext-server -- --run Prod --ini gargantext.ini stack --docker exec gargantext-server -- --run Prod --ini gargantext.ini
#!/bin/bash
if [ ! -d coreNLP ]; then
mkdir -v coreNLP
fi
pushd coreNLP
wget https://dl.gargantext.org/coreNLP.tar.bz2
tar xvjf coreNLP.tar.bz2
pushd home/debian/CoreNLP
./startServer.sh
#!/bin/bash
DIR=$1
DEPS_DIR=${DIR}/deps
function clone_or_update() {
REPO=$1
echo "Checking repo ${REPO}"
# strip only dir name from URL
DIR=${REPO##*/}
# strip the remaining '.git' suffix
RAW_DIR=${DIR%.*}
if [ -d "${RAW_DIR}" ]; then
pushd ${RAW_DIR}
git pull
popd ..
else
git clone "$@"
fi
}
if [ ! -d "${DEPS_DIR}" ]; then
mkdir ${DIR}/deps
fi
cd ${DIR}/deps
clone_or_update https://gitlab.iscpif.fr/gargantext/clustering-louvain.git
clone_or_update https://github.com/np/servant-job.git
clone_or_update https://github.com/np/patches-map
clone_or_update https://gitlab.com/npouillard/patches-class.git
clone_or_update https://github.com/delanoe/haskell-opaleye
clone_or_update https://github.com/delanoe/hsparql -b next --single-branch
resolver: lts-14.16 resolver: lts-14.22
flags: {} flags: {}
extra-package-dbs: [] extra-package-dbs: []
packages: packages:
...@@ -7,7 +7,13 @@ packages: ...@@ -7,7 +7,13 @@ packages:
docker: docker:
enable: false enable: false
repo: 'fpco/stack-build:lts-14.6-garg' repo: 'fpco/stack-build:lts-14.22-garg'
nix:
enable: false
#packages: [gmp]
add-gc-roots: true
shell-file: build-shell.nix
allow-newer: true allow-newer: true
extra-deps: extra-deps:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment