Verified Commit d428ae72 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-openalex

parents aa827322 53424dfd
Pipeline #4328 failed with stages
in 89 minutes and 22 seconds
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
*lock *lock
# Cabal
*.cabal
# Profiling # Profiling
*.prof *.prof
profiling profiling
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/ # https://vadosware.io/post/zero-to-continuous-integrated-testing-a-haskell-project-with-gitlab/
# #
# #
image: adinapoli/gargantext:v1 image: adinapoli/gargantext:v2
variables: variables:
STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root" STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root"
...@@ -13,13 +13,13 @@ variables: ...@@ -13,13 +13,13 @@ variables:
#- apt-get install make xz-utils #- apt-get install make xz-utils
stages: stages:
- deps - stack
- cabal
- test - test
- docs - docs
- cabal
deps: stack:
stage: deps stage: stack
cache: cache:
# cache per branch name # cache per branch name
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
...@@ -29,8 +29,7 @@ deps: ...@@ -29,8 +29,7 @@ deps:
- target - target
script: script:
- echo "Building the project from '$CI_PROJECT_DIR'" - echo "Building the project from '$CI_PROJECT_DIR'"
- hpack - nix-shell --run "stack build --no-terminal --haddock --no-haddock-deps --only-dependencies --fast --dry-run"
- nix-shell --run "LC_ALL=C.UTF-8 stack build --no-terminal --haddock --no-haddock-deps --only-dependencies --fast"
docs: docs:
stage: docs stage: docs
...@@ -42,8 +41,7 @@ docs: ...@@ -42,8 +41,7 @@ docs:
- .stack-work/ - .stack-work/
- target - target
script: script:
- hpack - nix-shell --run "stack build --no-terminal --haddock --no-haddock-deps --fast --dry-run"
- nix-shell --run "LC_ALL=C.UTF-8 stack build --no-terminal --haddock --no-haddock-deps --fast"
- cp -R "$(stack path --local-install-root)"/doc ./output - cp -R "$(stack path --local-install-root)"/doc ./output
artifacts: artifacts:
paths: paths:
...@@ -51,24 +49,22 @@ docs: ...@@ -51,24 +49,22 @@ docs:
expire_in: 1 week expire_in: 1 week
allow_failure: true allow_failure: true
test: cabal:
stage: test stage: cabal
cache: cache:
# cache per branch name # cache per branch name
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
paths: paths:
- .stack-root/ - .stack-root/
- .stack-work/ - .stack-work/
- dist-newstyle/
- target - target
script: script:
- hpack - nix-shell --run "./bin/update-cabal-project && cabal v2-build"
- nix-shell --run "stack test --no-terminal --fast" allow_failure: false
# TOOO
cabal: test:
# FIXME(adinapoli) A temporary hack until we switch to cabal 3.10.1.0 properly stage: test
stage: cabal
cache: cache:
# cache per branch name # cache per branch name
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
...@@ -78,7 +74,5 @@ cabal: ...@@ -78,7 +74,5 @@ cabal:
- dist-newstyle/ - dist-newstyle/
- target - target
script: script:
- hpack - nix-shell --run "cabal v2-test --test-show-details=streaming"
- nix-shell --run "./bin/update-cabal-project && cabal v2-build --dry-run"
allow_failure: false
...@@ -47,7 +47,7 @@ cd haskell-gargantext ...@@ -47,7 +47,7 @@ cd haskell-gargantext
#### 1. Installation #### 1. Installation
This project can be built with either Stack or Cabal. For historical This project can be built with either Stack or Cabal. For historical
reasons, we generate a `cabal.project` from the `package.yaml`, and reasons, we generate a `cabal.project` from the `stack.yaml`, and
we do not commit the former to the repo, to have a single "source of truth". we do not commit the former to the repo, to have a single "source of truth".
However, it's always possible to generate a `cabal.project` thanks However, it's always possible to generate a `cabal.project` thanks
to [stack2cabal](https://hackage.haskell.org/package/stack2cabal). to [stack2cabal](https://hackage.haskell.org/package/stack2cabal).
......
#!/usr/bin/env bash #!/usr/bin/env bash
cabal v2-update 'hackage.haskell.org,2023-06-25T00:00:00Z' cabal v2-update 'hackage.haskell.org,2023-06-25T00:00:00Z'
cabal v2-install hpack-0.35.0 --overwrite-policy=always
cabal v2-install stack2cabal-1.0.14 --overwrite-policy=always cabal v2-install stack2cabal-1.0.14 --overwrite-policy=always
stack2cabal --no-run-hpack -p '2023-06-25' stack2cabal --no-run-hpack -p '2023-06-25'
...@@ -18,84 +18,40 @@ sudo apt upgrade ...@@ -18,84 +18,40 @@ sudo apt upgrade
# Tmux to avoid disconnections during the installation process # Tmux to avoid disconnections during the installation process
# Htop for visual monitoring # Htop for visual monitoring
sudo apt install tmux htop sudo apt install tmux htop git iptables curl
######################################################################## ########################################################################
sudo sed -i "s/stretch/buster/g" /etc/apt/sources.list sudo sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list
sudo apt update sudo apt update
sudo apt dist-upgrade sudo apt dist-upgrade
# sudo reboot #recommended # sudo reboot #recommended
######################################################################## ########################################################################
#sudo apt update #sudo apt update
sudo apt install liblzma-dev libpcre3-dev libblas-dev liblapack-dev pkg-config libgsl-dev libbz2-dev postgresql postgresql-server-dev-11 nginx libigraph0-dev libgfortran-9-dev sudo apt install postgresql postgresql-server-dev-15
sudo apt install git
#git config --global user.email "contact@gargantext.org" #git config --global user.email "contact@gargantext.org"
#git config --global user.name "Gargantua" #git config --global user.name "Gargantua"
######################################################################## ########################################################################
echo "Which user?"
#read USER
USER="gargantua"
sudo adduser --disabled-password --gecos "" $USER
######################################################################## echo "Installing Nix"
#cd /home sh <(curl -L https://nixos.org/nix/install) --daemon
#sudo mv -if /home/$USER /srv/
#sudo ln -s /srv/$USER
curl -sSL https://get.haskellstack.org/ | sh
sudo apt install curl
sudo su $USER
stack update
stack upgrade
#git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
#cd haskell-gargantext
##########
if [[ ! -d "purescript-gargantext" ]]; then
./devops/debian/install-purescript
fi
#########################################################################
# stack install should be enough but all process is the following steps
stack setup && stack build && stack install
######################################################################### #######################################################################
# build deps # Get the Sources
git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
cd haskell-gargantext
if [[ ! -d "deps" ]]; then git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext.git
mkdir -v deps
cd deps
sudo apt install default-jdk
if [[ ! -f "coreNLP.tar.bz2" ]]; then
wget https://dl.gargantext.org/coreNLP.tar.bz2
fi
if [[ ! -d "home" ]]; then
tar xvjf coreNLP.tar.bz2
fi
# CoreNLP needs to be started
# ./startServer.sh
cd ..
fi
# Specific to our servers
#### Configure timezone and locale ################################### #### Configure timezone and locale ###################################
# todo sync dates # todo sync dates
#echo "########### LOCALES & TZ #################" #echo "########### LOCALES & TZ #################"
#echo "Europe/Paris" > /etc/timezone #echo "Europe/Paris" > /etc/timezone
#dpkg-reconfigure --frontend=noninteractive tzdata #sudo dpkg-reconfigure --frontend=noninteractive tzdata
##ENV TZ "Europe/Paris" ##ENV TZ "Europe/Paris"
# #
#sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \ #sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
...@@ -109,13 +65,12 @@ fi ...@@ -109,13 +65,12 @@ fi
# Database configuration # Database configuration
# CREATE USER gargantua WITH PASSWORD $(grep DB_PASS gargantext.ini) # CREATE USER gargantua WITH PASSWORD $(grep DB_PASS gargantext.ini)
# GRANT ALL PRIVILEGES ON DATABASE gargandbV4 to gargantua # GRANT ALL PRIVILEGES ON DATABASE gargandbV4 to gargantua
# sudo su postgres
# createdb gargandb
####################################################################### #######################################################################
## POSTGRESQL DATA (as ROOT) ## POSTGRESQL DATA (as ROOT)
####################################################################### #######################################################################
./devops/debian/install-postgres
# configure the database with script in devops/postgres # configure the database with script in devops/postgres
# edit gargantext.ini # edit gargantext.ini
...@@ -4,9 +4,16 @@ ARG DEBIAN_FRONTEND=noninteractive ...@@ -4,9 +4,16 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG GHC=8.10.7 ARG GHC=8.10.7
ARG STACK=2.7.3 ARG STACK=2.7.3
ARG CABAL=3.10.1.0 ARG CABAL=3.10.1.0
COPY ./shell.nix /builds/gargantext/shell.nix COPY ./shell.nix /builds/gargantext/shell.nix
COPY ./nix/pkgs.nix /builds/gargantext/nix/pkgs.nix COPY ./nix/pkgs.nix /builds/gargantext/nix/pkgs.nix
COPY ./nix/pinned-22.05.nix /builds/gargantext/nix/pinned-22.05.nix COPY ./nix/pinned-22.05.nix /builds/gargantext/nix/pinned-22.05.nix
COPY ./nix/overlays/Cabal-3.10.1.0.nix /builds/gargantext/nix/overlays/Cabal-3.10.1.0.nix
COPY ./nix/overlays/cabal-install-3.10.1.0.nix /builds/gargantext/nix/overlays/cabal-install-3.10.1.0.nix
COPY ./nix/overlays/cabal-install-solver-3.10.1.0.nix /builds/gargantext/nix/overlays/cabal-install-solver-3.10.1.0.nix
COPY ./nix/overlays/Cabal-syntax-3.10.1.0.nix /builds/gargantext/nix/overlays/Cabal-syntax-3.10.1.0.nix
COPY ./nix/overlays/directory-1.3.7.0.nix /builds/gargantext/nix/overlays/directory-1.3.7.0.nix
COPY ./nix/overlays/hackage-security-0.6.2.3.nix /builds/gargantext/nix/overlays/hackage-security-0.6.2.3.nix
COPY ./nix/overlays/process-1.6.15.0.nix /builds/gargantext/nix/overlays/process-1.6.15.0.nix
ENV TZ=Europe/Rome ENV TZ=Europe/Rome
RUN apt-get update && \ RUN apt-get update && \
...@@ -61,19 +68,7 @@ ENV PATH=/root/.nix-profile/bin:$PATH ...@@ -61,19 +68,7 @@ ENV PATH=/root/.nix-profile/bin:$PATH
RUN . $HOME/.bashrc && nix-env --version RUN . $HOME/.bashrc && nix-env --version
RUN \
curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup && \
ghcup config set gpg-setting GPGLax && \
ghcup -v install ghc --force ${GHC} && \
ghcup -v install cabal --force ${CABAL} && \
ghcup -v install stack --force ${STACK}
ENV PATH=/root/.ghcup/bin:$PATH
ENV PATH=/root/.local/bin:$PATH ENV PATH=/root/.local/bin:$PATH
RUN cd /builds/gargantext && nix-shell RUN cd /builds/gargantext && nix-shell
RUN ghcup set 8.10.7 && cabal v2-update && cabal v2-install hpack --overwrite-policy=always
WORKDIR "/builds/gargantext/" WORKDIR "/builds/gargantext/"
cabal-version: 1.12 cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.35.1.
--
-- see: https://github.com/sol/hpack
name: gargantext name: gargantext
version: 0.0.6.9.9.7 version: 0.0.6.9.9.7
synopsis: Search, map, share synopsis: Search, map, share
...@@ -59,12 +55,13 @@ library ...@@ -59,12 +55,13 @@ library
Gargantext.Core.Text.Context Gargantext.Core.Text.Context
Gargantext.Core.Text.Corpus.API Gargantext.Core.Text.Corpus.API
Gargantext.Core.Text.Corpus.API.Arxiv Gargantext.Core.Text.Corpus.API.Arxiv
Gargantext.Core.Text.Corpus.API.Pubmed
Gargantext.Core.Text.Corpus.API.OpenAlex Gargantext.Core.Text.Corpus.API.OpenAlex
Gargantext.Core.Text.Corpus.API.Pubmed
Gargantext.Core.Text.Corpus.Query Gargantext.Core.Text.Corpus.Query
Gargantext.Core.Text.Corpus.Parsers Gargantext.Core.Text.Corpus.Parsers
Gargantext.Core.Text.Corpus.Parsers.CSV Gargantext.Core.Text.Corpus.Parsers.CSV
Gargantext.Core.Text.Corpus.Parsers.Date.Parsec Gargantext.Core.Text.Corpus.Parsers.Date.Parsec
Gargantext.Core.Text.Corpus.Parsers.JSON
Gargantext.Core.Text.List.Formats.CSV Gargantext.Core.Text.List.Formats.CSV
Gargantext.Core.Text.Metrics Gargantext.Core.Text.Metrics
Gargantext.Core.Text.Metrics.CharByChar Gargantext.Core.Text.Metrics.CharByChar
...@@ -203,7 +200,6 @@ library ...@@ -203,7 +200,6 @@ library
Gargantext.Core.Text.Corpus.Parsers.GrandDebat Gargantext.Core.Text.Corpus.Parsers.GrandDebat
Gargantext.Core.Text.Corpus.Parsers.Iramuteq Gargantext.Core.Text.Corpus.Parsers.Iramuteq
Gargantext.Core.Text.Corpus.Parsers.Isidore Gargantext.Core.Text.Corpus.Parsers.Isidore
Gargantext.Core.Text.Corpus.Parsers.JSON
Gargantext.Core.Text.Corpus.Parsers.Json2Csv Gargantext.Core.Text.Corpus.Parsers.Json2Csv
Gargantext.Core.Text.Corpus.Parsers.RIS Gargantext.Core.Text.Corpus.Parsers.RIS
Gargantext.Core.Text.Corpus.Parsers.RIS.Presse Gargantext.Core.Text.Corpus.Parsers.RIS.Presse
......
This diff is collapsed.
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