diff --git a/.env b/.env index e226d758fbb..2ef46123956 100644 --- a/.env +++ b/.env @@ -1,3 +1,6 @@ +# English: the WORKDING_DIR mapped in the docker +# 中文: 这个是配置的 WORKING_DIR 将会映射到docker中的目录 +MAPPING_DOCKER_DIR=/import-file # English: Set the directory to upload files. With this directory set, docker can access files on your local host. No extra space is allowed in the directory. # 中文:上传文件目录设置,以便容器内部能共享到本机的文件夹,拥有读写权限,目录不支持有空格 -WORKING_DIR={please input your real local path} \ No newline at end of file +WORKING_DIR=./example \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..32e257c77da --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +example/tmp diff --git a/docker-compose.yml b/docker-compose.yml index ac7ff41e5c3..8e31f36ce5b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,16 +9,16 @@ services: networks: - nebula-web web: - image: vesoft/nebula-web-console:0.0.2 + image: vesoft/nebula-web-console:0.0.5 environment: USER: root - WORKING_DIR: ${WORKING_DIR} + WORKING_DIR: ${MAPPING_DOCKER_DIR} ports: - 7001 depends_on: - client volumes: - - ${WORKING_DIR}:${WORKING_DIR}:rw + - ${WORKING_DIR}:${MAPPING_DOCKER_DIR}:rw networks: - nebula-web importer: @@ -28,7 +28,7 @@ services: ports: - 5699 volumes: - - ${WORKING_DIR}:${WORKING_DIR}:rw + - ${WORKING_DIR}:${MAPPING_DOCKER_DIR}:rw command: - "--port=5699" - "--callback=http://nginx:7001/api/import/finish" @@ -36,6 +36,7 @@ services: image: nginx:alpine volumes: - ./nginx/nginx.conf:/etc/nginx/conf.d/nebula.conf + - ${WORKING_DIR}:${MAPPING_DOCKER_DIR}:rw depends_on: - client - web diff --git a/example/tmp/config.yaml b/example/tmp/config.yaml deleted file mode 100644 index 4cc7277046b..00000000000 --- a/example/tmp/config.yaml +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": "v1rc1", - "description": "web console import", - "clientSettings": { - "concurrency": 10, - "channelBufferSize": 128, - "space": "test", - "connection": { - "user": "user", - "password": "password", - "address": "192.168.3.38:3699" - } - }, - "logPath": "/Users/niania/WorkSpace/nebula-web-docker/example/tmp/import.log", - "files": [ - { - "path": "/Users/niania/WorkSpace/nebula-web-docker/example/player.csv", - "failDataPath": "/Users/niania/WorkSpace/nebula-web-docker/example/tmp/err/Vertex 0Fail.scv", - "batchSize": 10, - "type": "csv", - "csv": { - "withHeader": false, - "withLabel": false - }, - "schema": { - "type": "vertex", - "vertex": { - "vid": { - "index": 0 - }, - "tags": [ - { - "name": "person", - "props": [ - { - "name": "name", - "type": "string", - "index": 1 - }, - { - "name": "age", - "type": "int", - "index": 2 - } - ] - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/example/tmp/err/Vertex 0Fail.scv b/example/tmp/err/Vertex 0Fail.scv deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/example/tmp/import.log b/example/tmp/import.log deleted file mode 100644 index dee4a315bca..00000000000 --- a/example/tmp/import.log +++ /dev/null @@ -1,5 +0,0 @@ -2020/01/08 13:21:12 [INFO] clientmgr.go:28: Create 10 Nebula Graph clients -2020/01/08 13:21:12 [INFO] reader.go:53: Start to read file(0): /Users/niania/WorkSpace/nebula-web-docker/example/player.csv, schema: < :VID,person.name:string,person.age:int > -2020/01/08 13:21:12 [INFO] reader.go:108: Total lines of file(/Users/niania/WorkSpace/nebula-web-docker/example/player.csv) is: 9, error lines: 0 -2020/01/08 13:21:12 [INFO] statsmgr.go:61: Done(/Users/niania/WorkSpace/nebula-web-docker/example/player.csv): Time(0.16s), Finished(9), Failed(0), Latency AVG(5282us), Batches Req AVG(13235us), Rows AVG(56.04/s) -2020/01/08 13:21:12 [INFO] cmd.go:32: Finish import data, consume time: 0.24s diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 0059cad0e6f..d50c0abe4dc 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -12,6 +12,11 @@ server { proxy_set_header X-Forwarded-Host $server_name; } + location /import-file/ { + root /; + autoindex on; + } + location ~ ^/api-nebula/([A-Za-z0-9\/]+) { proxy_pass http://client:8080/api/$1; }