Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
0b6f1d50
Commit
0b6f1d50
authored
Mar 20, 2017
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PSQL] Install fix
parent
e390703a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
22 deletions
+20
-22
metric_tfidf.py
gargantext/util/toolchain/metric_tfidf.py
+5
-4
Debian.sh
install/gargamelle/Debian.sh
+10
-13
psql_configure.sh
install/gargamelle/psql_configure.sh
+5
-5
No files found.
gargantext/util/toolchain/metric_tfidf.py
View file @
0b6f1d50
...
...
@@ -109,7 +109,7 @@ def compute_occs(corpus, overwrite_id = None, groupings_id = None,):
.
group_by
(
"counted_form"
)
)
#print(str(occs_q))
#print(str(occs_q
.all()
))
occ_sums
=
occs_q
.
all
()
# example result = [(1970, 1.0), (2024, 2.0), (259, 2.0), (302, 1.0), ... ]
# ^^^^ ^^^
...
...
@@ -190,7 +190,7 @@ def compute_ti_ranking(corpus,
if
type
(
corpus
)
==
int
:
corpus_id
=
corpus
corpus
=
cache
.
Node
[
corpus_id
]
elif
type
(
corpus
)
==
str
and
match
(
r'\d+$'
,
corpus
):
elif
type
(
corpus
)
==
str
and
match
(
r'
^
\d+$'
,
corpus
):
corpus_id
=
int
(
corpus
)
corpus
=
cache
.
Node
[
corpus_id
]
else
:
...
...
@@ -330,7 +330,7 @@ def compute_ti_ranking(corpus,
# result
print
(
"
%
s : Starting Query tf_nd_query"
%
t
())
print
(
str
(
tf_nd_query
))
#print(str(tf_nd_query.all()
))
tf_nd
=
tf_nd_query
.
all
()
print
(
"
%
s : End Query tf_nd_quer"
%
t
())
...
...
@@ -399,7 +399,8 @@ def compute_tfidf_local(corpus,
- overwrite_id: optional id of a pre-existing TFIDF-XXXX node for this corpus
(the Node and its previous NodeNodeNgram rows will be replaced)
"""
print
(
"Compute TFIDF local"
)
# All docs of this corpus
docids_subquery
=
(
session
.
query
(
Node
.
id
)
...
...
install/gargamelle/Debian.sh
View file @
0b6f1d50
...
...
@@ -5,13 +5,10 @@ apt-get install -y \
apt-utils ca-certificates locales
\
sudo
aptitude gcc g++ wget git vim
\
build-essential make
\
postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
\
postgresql-server-dev-9.5 libpq-dev libxml2
\
postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
\
nginx rabbitmq-server
# WARNING: uwsgi is not on stretch any more (get it from unstable)
# uwsgi uwsgi-core uwsgi-plugin-python3
postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6
\
postgresql-server-dev-9.6 libpq-dev libxml2
\
postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6
\
nginx rabbitmq-server uwsgi uwsgi-core uwsgi-plugin-python3
### Configure timezone and locale
...
...
@@ -32,15 +29,15 @@ update-locale LC_ALL=fr_FR.UTF-8
### Install main dependencies and python packages based on Debian distrib
echo
"############# PYTHON DEPENDENCIES ###############"
apt-get update
&&
apt-get
install
-y
\
libxml2-dev xml-core libgfortran-
5
-dev
\
libxml2-dev xml-core libgfortran-
6
-dev
\
libpq-dev
\
python3.5
\
python3-dev
\
python3-six python3-numpy python3-setuptools
\
python3-numexpr
\
python3-pip
\
libxml2-dev libxslt-dev
#libxslt1-dev
zlib1g-dev
libxml2-dev libxslt-dev
zlib1g-dev
#libxslt1-dev
UPDATE AND CLEAN
apt-get update
&&
apt-get autoclean
...
...
@@ -70,7 +67,7 @@ update-locale LC_ALL=fr_FR.UTF-8
## POSTGRESQL DATA (as ROOT)
#######################################################################
sed
-iP
"s%^data_directory.*%data_directory =
\'\/
srv
\/
gargandata
\'
%"
/etc/postgresql/9.
5
/main/postgresql.conf
echo
"host all all 0.0.0.0/0 md5"
>>
/etc/postgresql/9.
5
/main/pg_hba.conf
echo
"listen_addresses='*'"
>>
/etc/postgresql/9.
5
/main/postgresql.conf
sed
-iP
"s%^data_directory.*%data_directory =
\'\/
srv
\/
gargandata
\'
%"
/etc/postgresql/9.
6
/main/postgresql.conf
echo
"host all all 0.0.0.0/0 md5"
>>
/etc/postgresql/9.
6
/main/pg_hba.conf
echo
"listen_addresses='*'"
>>
/etc/postgresql/9.
6
/main/postgresql.conf
install/gargamelle/psql_configure.sh
View file @
0b6f1d50
...
...
@@ -12,12 +12,12 @@ echo "::::: POSTGRESQL :::::"
su postgres
-c
'pg_dropcluster 9.4 main --stop'
#done in docker but redoing it
rm
-rf
/srv/gargandata
&&
mkdir
/srv/gargandata
&&
chown
postgres:postgres /srv/gargandata
su postgres
-c
'/usr/lib/postgresql/9.
5
/bin/initdb -D /srv/gargandata/'
su postgres
-c
'/usr/lib/postgresql/9.
5
/bin/pg_ctl -D /srv/gargandata/ -l /srv/gargandata/journal_applicatif start'
su postgres
-c
'/usr/lib/postgresql/9.
6
/bin/initdb -D /srv/gargandata/'
su postgres
-c
'/usr/lib/postgresql/9.
6
/bin/pg_ctl -D /srv/gargandata/ -l /srv/gargandata/journal_applicatif start'
su postgres
-c
'pg_createcluster -D /srv/gargandata 9.
5
main '
su postgres
-c
'pg_ctlcluster -D /srv/gargandata 9.
5
main start '
su postgres
-c
'pg_ctlcluster 9.
5
main start'
su postgres
-c
'pg_createcluster -D /srv/gargandata 9.
6
main '
su postgres
-c
'pg_ctlcluster -D /srv/gargandata 9.
6
main start '
su postgres
-c
'pg_ctlcluster 9.
6
main start'
service postgresql start
...
...
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