2019-03-19 20:04:15 +08:00
|
|
|
# Vecwise Engine
|
|
|
|
|
|
|
|
### Geting started
|
|
|
|
|
2019-03-27 18:09:52 +08:00
|
|
|
- Create .env base on .env.example
|
|
|
|
|
2019-03-19 20:04:15 +08:00
|
|
|
- Install Miniconda first
|
|
|
|
- `conda create --name vec_engine python=3.6`
|
|
|
|
- `conda activate vec_engine`
|
|
|
|
- `conda install faiss-gpu cuda90 -c pytorch # For CUDA9.0`
|
|
|
|
- `conda install flask`
|
2019-03-27 17:48:39 +08:00
|
|
|
- `pip install flask-restful flask_sqlalchemy flask_script`
|
2019-04-02 10:41:03 +08:00
|
|
|
- `pip install pymysql environs flask-profiler`
|
2019-03-20 11:54:33 +08:00
|
|
|
|
|
|
|
### Create Database
|
|
|
|
|
|
|
|
- Install MySQL
|
|
|
|
- `sudo apt-get update`
|
|
|
|
- `sudo apt-get install mariadb-server`
|
|
|
|
|
|
|
|
- Create user and database:
|
|
|
|
- `create user vecwise;`
|
|
|
|
- `create database vecdata;`
|
|
|
|
- `grant all privileges on vecdata.* to 'vecwise'@'%';`
|
|
|
|
- `flush privileges;`
|
|
|
|
|
|
|
|
- Create table:
|
|
|
|
- `python` # enter python3 interaction environment
|
|
|
|
- `from engine import db`
|
|
|
|
- `db.create_all()`
|
2019-03-20 19:49:17 +08:00
|
|
|
|
|
|
|
- table desc
|
|
|
|
group_table
|
|
|
|
+-------------+--------------+------+-----+---------+----------------+
|
|
|
|
| Field | Type | Null | Key | Default | Extra |
|
|
|
|
+-------------+--------------+------+-----+---------+----------------+
|
|
|
|
| id | int(11) | NO | PRI | NULL | auto_increment |
|
|
|
|
| group_name | varchar(100) | YES | | NULL | |
|
|
|
|
| file_number | int(11) | YES | | NULL | |
|
|
|
|
+-------------+--------------+------+-----+---------+----------------+
|
|
|
|
|
|
|
|
file_table
|
|
|
|
+------------+--------------+------+-----+---------+----------------+
|
|
|
|
| Field | Type | Null | Key | Default | Extra |
|
|
|
|
+------------+--------------+------+-----+---------+----------------+
|
|
|
|
| id | int(11) | NO | PRI | NULL | auto_increment |
|
|
|
|
| group_name | varchar(100) | YES | | NULL | |
|
|
|
|
| filename | varchar(100) | YES | | NULL | |
|
|
|
|
| row_number | int(11) | YES | | NULL | |
|
|
|
|
+------------+--------------+------+-----+---------+----------------+
|