Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
191
Issues
191
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
1adc512e
Verified
Commit
1adc512e
authored
Jul 02, 2025
by
Przemyslaw Kaminski
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[nix] move corenlp to separate flake in core-nix repo
#483
parent
397b19a5
Pipeline
#7720
canceled with stages
in 27 minutes and 57 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
84 deletions
+24
-84
README.md
README.md
+4
-2
corenlp.nix
nix/corenlp.nix
+0
-66
pkgs.nix
nix/pkgs.nix
+15
-14
Main.hs
test/drivers/hspec/Main.hs
+5
-2
No files found.
README.md
View file @
1adc512e
...
...
@@ -117,15 +117,17 @@ And provide a name and a password for the master user as requested.
CoreNLP can be started with nix:
```
shell
nix
-shell
--run
startCoreNLPServer.sh
nix
run
"git+https://gitlab.iscpif.fr/gargantext/corenlp-nix.git"
#
```
By default, this starts on port
`9000`
. If you want a different port, then do:
```
shell
nix
-shell
--run
'startCoreNLPServer.sh -p 9001'
nix
run
"git+https://gitlab.iscpif.fr/gargantext/corenlp-nix.git"
# -- -p 9001
```
See https://gitlab.iscpif.fr/gargantext/corenlp-nix for more info.
### Running Gargantext
From inside the
`haskell-gargantext/`
directory, run
...
...
nix/corenlp.nix
deleted
100644 → 0
View file @
397b19a5
# https://nixos.wiki/wiki/Java
{
fetchzip
,
makeWrapper
,
stdenv
,
writeShellScript
,
jre
,
version
?
"4.5.9"
,
hash
?
"sha256-DOGBkGJfvR1PoXz2CNoo58HXwGLxvPKMChRqlrFtQLQ="
,
}:
stdenv
.
mkDerivation
(
finalAttrs
:
let
startServer
=
writeShellScript
"startCoreNLPServer.sh"
''
set -x
PORT=9000
while getopts ':p:h' opt; do
case $opt in
(p) PORT=$OPTARG;;
(h) echo "$(basename $0) [-p 9000]"
exit 0
;;
esac
done
shift "$((OPTIND - 1))"
${
jre
}
/bin/java -mx4g -cp "$CORENLP_PATH/*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port $PORT -timeout 15000 "$@"
''
;
# see https://huggingface.co/stanfordnlp/CoreNLP/commits/main
versionCommits
=
{
"4.5.8"
=
"34264e88b7add9e0045f4727bc7d1872385f06aa"
;
"4.5.9"
=
"06f79ee8b1ec475d7630b1871bfd75a57c77ffa4"
;
};
commit
=
versionCommits
.
"
${
finalAttrs
.
version
}
"
;
in
{
name
=
"corenlp"
;
inherit
version
;
src
=
fetchzip
{
inherit
hash
;
# url = "http://nlp.stanford.edu/software/stanford-corenlp-${finalAttrs.version}.zip";
# huggin face is more stable
url
=
"https://huggingface.co/stanfordnlp/CoreNLP/resolve/
${
commit
}
/stanford-corenlp-latest.zip"
;
};
buildInputs
=
[
jre
];
nativeBuildInputs
=
[
makeWrapper
];
phases
=
[
"unpackPhase"
"installPhase"
];
installPhase
=
''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share/corenlp
cp -r . $out/share/corenlp
makeWrapper
${
startServer
}
$out/bin/startCoreNLPServer.sh \
--set CORENLP_PATH "$out/share/corenlp"
runHook postInstall
''
;
}
)
nix/pkgs.nix
View file @
1adc512e
{
pkgs
?
import
(
if
builtins
.
elem
builtins
.
currentSystem
[
"x86_64-darwin"
"aarch64-darwin"
]
{
pkgs
?
import
(
if
builtins
.
elem
builtins
.
currentSystem
[
"x86_64-darwin"
"aarch64-darwin"
]
then
./pinned-25.05.darwin.nix
else
./pinned-25.05.nix
)
{}
}:
else
./pinned-25.05.nix
)
{
}
}:
rec
{
inherit
pkgs
;
ghc966
=
pkgs
.
haskell
.
compiler
.
ghc966
;
cabal_install
=
pkgs
.
haskell
.
lib
.
compose
.
justStaticExecutables
pkgs
.
haskell
.
packages
.
ghc966
.
cabal-install
;
graphviz
=
pkgs
.
callPackage
./graphviz.nix
{};
igraph_0_10_4
=
pkgs
.
callPackage
./igraph.nix
{};
corenlp
=
pkgs
.
callPackage
./corenlp.nix
{
};
# 4.5.8
graphviz
=
pkgs
.
callPackage
./graphviz.nix
{
};
igraph_0_10_4
=
pkgs
.
callPackage
./igraph.nix
{
};
cabal2stack
=
pkgs
.
callPackage
./cabal2stack.nix
{
ghc
=
ghc966
;
};
nng_notls
=
pkgs
.
nng
.
overrideAttrs
(
old
:
{
cmakeFlags
=
(
old
.
cmakeFlags
or
[])
++
[
"-DNNG_ENABLE_TLS=OFF"
];
cmakeFlags
=
(
old
.
cmakeFlags
or
[
])
++
[
"-DNNG_ENABLE_TLS=OFF"
];
});
hsBuildInputs
=
[
...
...
@@ -28,7 +30,6 @@ rec {
blas
bzip2
cabal2stack
corenlp
curl
czmq
docker-compose
...
...
@@ -56,7 +57,7 @@ rec {
zlib
zeromq
curl
]
++
(
lib
.
optionals
stdenv
.
isDarwin
[
]
++
(
lib
.
optionals
stdenv
.
isDarwin
[
darwin
.
apple_sdk
.
frameworks
.
Accelerate
]);
libPaths
=
pkgs
.
lib
.
makeLibraryPath
nonhsBuildInputs
;
...
...
test/drivers/hspec/Main.hs
View file @
1adc512e
...
...
@@ -21,7 +21,10 @@ startCoreNLPServer :: IO ProcessHandle
startCoreNLPServer
=
do
putText
"calling start core nlp"
devNull
<-
openFile
"/dev/null"
WriteMode
let
p
=
proc
"startCoreNLPServer.sh"
[]
let
p
=
proc
"nix"
[
"--extra-experimental-features"
,
"nix-command flakes"
,
"run"
,
"git+https://gitlab.iscpif.fr/gargantext/corenlp-nix.git"
]
(
_
,
_
,
_
,
hdl
)
<-
(
createProcess
$
p
{
cwd
=
Nothing
-- NOTE(adn) Issue #451, this one has to stay disabled, because if we
-- turn it on, despite the confusing documentation on the `process` library
...
...
@@ -35,7 +38,7 @@ startCoreNLPServer = do
,
std_err
=
UseHandle
devNull
})
`
catch
`
\
e
->
case
e
of
_
|
True
<-
"does not exist"
`
isInfixOf
`
(
T
.
pack
.
show
@
SomeException
$
e
)
->
fail
$
"Cannot execute the '
startCoreNLPServer.sh' script
. Make sure you are in a nix environment."
->
fail
$
"Cannot execute the '
corenlp' via nix flakes
. Make sure you are in a nix environment."
|
otherwise
->
throwIO
e
pure
hdl
...
...
Przemyslaw Kaminski
@cgenie
mentioned in commit
78032d98
·
Aug 04, 2025
mentioned in commit
78032d98
mentioned in commit 78032d980205bdc10120a302e191c883282b9224
Toggle commit list
Przemyslaw Kaminski
@cgenie
mentioned in merge request
!434 (merged)
·
Aug 04, 2025
mentioned in merge request
!434 (merged)
mentioned in merge request !434
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment