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
2ac62ab1
Commit
2ac62ab1
authored
Aug 02, 2017
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DOCKERFILE] for notebook.
parent
d6ad20ef
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
9 deletions
+26
-9
nodes.py
gargantext/models/nodes.py
+8
-3
HAL.py
gargantext/util/crawlers/HAL.py
+1
-0
db.py
gargantext/util/db.py
+10
-0
Dockerfile
install/gargamelle/Dockerfile
+6
-6
requirements.txt
install/gargamelle/requirements.txt
+1
-0
No files found.
gargantext/models/nodes.py
View file @
2ac62ab1
...
...
@@ -2,6 +2,8 @@ from gargantext.util.db import session
from
gargantext.util.files
import
upload
from
gargantext.constants
import
*
from
sqlalchemy_utils.types
import
TSVectorType
from
datetime
import
datetime
from
.base
import
Base
,
Column
,
ForeignKey
,
relationship
,
TypeDecorator
,
Index
,
\
...
...
@@ -60,13 +62,16 @@ class Node(Base):
id
=
Column
(
Integer
,
primary_key
=
True
)
typename
=
Column
(
NodeType
,
index
=
True
)
# foreign keys
user_id
=
Column
(
Integer
,
ForeignKey
(
User
.
id
,
ondelete
=
'CASCADE'
))
parent_id
=
Column
(
Integer
,
ForeignKey
(
'nodes.id'
,
ondelete
=
'CASCADE'
))
user_id
=
Column
(
Integer
,
ForeignKey
(
User
.
id
,
ondelete
=
'CASCADE'
))
parent_id
=
Column
(
Integer
,
ForeignKey
(
'nodes.id'
,
ondelete
=
'CASCADE'
))
# main data
name
=
Column
(
String
(
255
))
date
=
Column
(
DateTime
(
timezone
=
True
),
default
=
datetime
.
now
)
# metadata (see https://bashelton.com/2014/03/updating-postgresql-json-fields-via-sqlalchemy/)
hyperdata
=
Column
(
JSONB
,
default
=
dict
)
hyperdata
=
Column
(
JSONB
,
default
=
dict
)
# To make search possible uncomment the line below
#search_vector = Column(TSVectorType('hyperdata'))
user
=
relationship
(
User
)
parent
=
relationship
(
'Node'
,
remote_side
=
[
id
])
...
...
gargantext/util/crawlers/HAL.py
View file @
2ac62ab1
...
...
@@ -45,6 +45,7 @@ class HalCrawler(Crawler):
, uri_s
, isbn_s
, issue_s
, docType_s
, journalPublisher_s
"""
#, authUrl_s
...
...
gargantext/util/db.py
View file @
2ac62ab1
...
...
@@ -5,8 +5,11 @@ from gargantext.util.json import json_dumps
########################################################################
# get engine, session, etc.
########################################################################
import
sqlalchemy
as
sa
from
sqlalchemy.orm
import
sessionmaker
,
scoped_session
from
sqlalchemy.ext.declarative
import
declarative_base
from
sqlalchemy
import
delete
from
sqlalchemy_searchable
import
make_searchable
def
get_engine
():
from
sqlalchemy
import
create_engine
...
...
@@ -18,6 +21,13 @@ def get_engine():
engine
=
get_engine
()
# To make Full Text search possible, uncomment lines below
# https://sqlalchemy-searchable.readthedocs.io/
#sa.orm.configure_mappers()
Base
=
declarative_base
()
#Base.metadata.create_all(engine)
#make_searchable()
session
=
scoped_session
(
sessionmaker
(
bind
=
engine
))
...
...
install/gargamelle/Dockerfile
View file @
2ac62ab1
...
...
@@ -15,9 +15,9 @@ RUN apt-get update && \
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
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
### Configure timezone and locale
...
...
@@ -37,7 +37,7 @@ ENV LC_ALL fr_FR.UTF-8
### Install main dependencies and python packages based on Debian distrib
RUN
echo
"############# PYTHON DEPENDENCIES ###############"
RUN
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
\
...
...
@@ -47,8 +47,8 @@ RUN apt-get update && apt-get install -y \
# python dependencies
python3-pip \
# for lxml
libxml2-dev libxslt-dev
#
libxslt1-dev zlib1g-dev
libxml2-dev libxslt-dev
\
libxslt1-dev zlib1g-dev
# UPDATE AND CLEAN
RUN
apt-get update
&&
apt-get autoclean
&&
\
...
...
install/gargamelle/requirements.txt
View file @
2ac62ab1
...
...
@@ -34,3 +34,4 @@ requests-futures==0.9.7
bs4==0.0.1
requests==2.10.0
alembic>=0.9.2
SQLAlchemy-Searchable==0.10.4
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