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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
6b5cac2c
Commit
6b5cac2c
authored
Sep 12, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADMIN] Upgrade scripts
parent
b98ddbfc
Pipeline
#3162
passed with stage
in 92 minutes and 4 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
38 deletions
+64
-38
CHANGELOG.md
CHANGELOG.md
+10
-8
Main.hs
bin/gargantext-upgrade/Main.hs
+10
-29
0.0.6.1.sh
devops/upgrade/0.0.6.1.sh
+43
-0
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+1
-1
No files found.
CHANGELOG.md
View file @
6b5cac2c
...
...
@@ -2,19 +2,21 @@
*
[
BACK
][
FIX
]
Ngrams List saved in database on halting
*
[
BACK
][
FIX
]
Confluence on Graph
*
[
BACK
][
FIX
]
HAL parser fix
*
[
BACK
][
UPGRADE
]
./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.2.sql
*
[
BACK
][
ADMIN
]
upgrade script (WIP)
## Version 0.0.6.1
*
[
FEAT
]
Spacy Server connection for French (and others) languages
*
[
FEAT
]
At startup, check if gargantext.init script has been activated
*
[
UPGRADE
]
Use the devops/postgres/upgrade/0.0.6.1.sql up
rade script
*
[
FIX
]
PubMed Parser with threadDelay
*
[
BACK
][
FEAT
]
Spacy Server connection for French (and others) languages
*
[
BACK
][
FEAT
]
At startup, check if gargantext.init script has been activated
*
[
BACK
][
UPGRADE
]
Use the devops/postgres/upgrade/0.0.6.1.sql upg
rade script
*
[
BACK
][
FIX
]
PubMed Parser with threadDelay
*
[
BACK
][
FIX
]
Hash to remove duplicates on filtered text
## Version 0.0.6
*
[
OPTIM
]
Ngrams Table optmization. To upgrade:
1.
`./bin/psql gargantext.ini < devops/postgresql/upgrade/0.0.6.sql`
2.
in
`stack --nix repl`
run
`runCmdReplEasy $ migrateFromDirToDb`
*
[
FIX
]
Ngrams Table next button: loads only one time instead of twice previously
*
[
BACK
][
OPTIM
]
Ngrams Table optmization. To upgrade:
1.
`./bin/psql gargantext.ini < devops/postgresql/upgrade/0.0.6.sql`
2.
in
`stack --nix repl`
run
`runCmdReplEasy $ migrateFromDirToDb`
*
[
F
RONT
][
F
IX
]
Ngrams Table next button: loads only one time instead of twice previously
*
[
FRONT
][
FIX
]
Resize handler on Write Node
*
[
FRONT
][
FIX
]
Do not highlight ngrams if maximum abstract length > 4500 characters
...
...
bin/gargantext-upgrade/Main.hs
View file @
6b5cac2c
...
...
@@ -24,6 +24,7 @@ import Gargantext.API.Admin.EnvTypes (DevEnv)
import
Gargantext.API.Dev
(
withDevEnv
,
runCmdDev
)
import
Gargantext.API.Node
()
-- instances only
import
Gargantext.API.Prelude
(
GargError
)
import
Gargantext.API.Ngrams.Tools
(
migrateFromDirToDb
)
import
Gargantext.Core
(
HasDBid
(
toDBid
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Action.Flow
(
getOrMk_RootWithCorpus
)
...
...
@@ -42,10 +43,13 @@ import qualified Data.List as List (cycle, concat, take, unlines)
main
::
IO
()
main
=
do
let
___
=
putStrLn
$
List
.
concat
$
List
.
take
72
$
List
.
cycle
[
"_"
]
let
___
=
putStrLn
$
List
.
concat
$
List
.
take
72
$
List
.
cycle
[
"_"
]
___
putStrLn
"GarganText upgrade to version 0.0.
5
"
putStrLn
"GarganText upgrade to version 0.0.
6
"
___
params
@
[
iniPath
]
<-
getArgs
...
...
@@ -57,9 +61,6 @@ main = do
[
"Your Database defined in gargantext.ini will be upgraded."
,
"We stronlgy recommend you to make a backup using pg_dump."
,
""
,
"If you encounter issues, please report your bugs here:"
,
"https://gitlab.iscpif.fr/gargantext/haskell-gargantext/issues/101"
,
""
,
"Press ENTER if you want to continue, CTRL+C if you want to stop."
]
...
...
@@ -68,31 +69,9 @@ main = do
cfg
<-
readConfig
iniPath
let
secret
=
_gc_secretkey
cfg
let
contextsTriggers
::
Cmd
GargError
()
contextsTriggers
=
do
(
masterUserId
,
_masterRootId
,
masterCorpusId
)
<-
getOrMk_RootWithCorpus
(
UserName
userMaster
)
(
Left
corpusMasterName
)
(
Nothing
::
Maybe
HyperdataCorpus
)
masterListId
<-
getOrMkList
masterCorpusId
masterUserId
_triggers
<-
initLastTriggers
masterListId
pure
()
withDevEnv
iniPath
$
\
env
->
do
-- First upgrade the Database Schema
_
<-
runCmdDev
env
sqlSchema
-- Then upgrade the triggers
_
<-
runCmdDev
env
(
initFirstTriggers
secret
::
Cmd
GargError
[
Int64
])
_
<-
runCmdDev
env
(
contextsTriggers
::
Cmd
GargError
()
)
-- Move nodes to contexts table
_
<-
runCmdDev
env
sqlNodes2Contexts
-- Update the hashes
_
<-
runCmdDev
env
sqlUpdateTriggerHash
_
<-
runCmdDev
env
(
migrateFromDirToDb
::
Cmd
GargError
()
)
___
putStrLn
"Uprade done with success !"
...
...
@@ -100,7 +79,7 @@ main = do
pure
()
{-
sqlUpdateTriggerHash :: Cmd'' DevEnv IOException Int64
sqlUpdateTriggerHash = do
execPGSQuery query ()
...
...
@@ -283,3 +262,5 @@ sqlSchema = do
CREATE INDEX IF NOT EXISTS context_node_node_id_idx ON public.context_node_ngrams USING btree (node_id);
|]
-}
devops/upgrade/0.0.6.1.sh
0 → 100644
View file @
6b5cac2c
#!/bin/bash
# To be executed at the root of the project
# backup
sudo
apt update
sudo
apt upgrade
sudo sed
-i
"s/buster/bullseye/g"
/etc/apt/sources.list
sudo
apt update
sudo
apt
-yy
dist-upgrade
git pull origin dev
./bin/install
#./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.0.sql
#./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.1.sql
# exec script haskell upgrade
sudo sed
-i
"s/bullseye/bookworm/g"
/etc/apt/sources.list
sudo
apt update
sudo
apt
-yy
dist-upgrade
sudo
apt
install
-y
postgresql-14 libpq-dev
sed
-i
"s/DB_PORT = 5432/DB_PORT = 5433/"
gargantext.ini
DBPASS
=
$(
grep
"DB_PASS"
gargantext.ini |
sed
"s/^.*= //"
)
sudo
-i
-u
postgres bash
<<
EOF
psql < 'ALTER ROLE gargantua password \'
$DBPASS
\'';
EOF
./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.2.sql
src/Gargantext/API/Ngrams/Tools.hs
View file @
6b5cac2c
...
...
@@ -199,7 +199,7 @@ getCoocByNgrams' f (Diagonal diag) m =
------------------------------------------
migrateFromDirToDb
::
(
CmdM
env
err
m
,
HasNodeStory
env
err
m
)
migrateFromDirToDb
::
(
CmdM
env
err
m
)
--
, HasNodeStory env err m)
=>
m
()
migrateFromDirToDb
=
do
pool
<-
view
connPool
...
...
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