diff --git a/dubhe-visual-server/README.md b/dubhe-visual-server/README.md index 5f010ed..98d6aea 100644 --- a/dubhe-visual-server/README.md +++ b/dubhe-visual-server/README.md @@ -3,10 +3,12 @@ - 依赖 Python3.7 环境,建议使用 Anaconda 创建虚拟环境 ```shell -# 创建虚拟环境 -conda create --file dubhe_visual.yaml -# 激活 dubhe_visual -conda activate dubhe_visual +# 首次使用,执行 +bash init.sh +# 创建虚拟环境完毕后,后续启动服务,请执行 +source start_server.sh +# 关闭服务,请执行 +source stop_server.sh ``` - 依赖 [Redis](https://redis.io/download) 作为中间件 diff --git a/dubhe-visual-server/backend/backend/api/api.py b/dubhe-visual-server/backend/backend/api/api.py index a268822..afe05fc 100644 --- a/dubhe-visual-server/backend/backend/api/api.py +++ b/dubhe-visual-server/backend/backend/api/api.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from .utils import * from backend.component import * from django.views.decorators.gzip import gzip_page diff --git a/dubhe-visual-server/backend/backend/api/utils.py b/dubhe-visual-server/backend/backend/api/utils.py index 7e94cc9..1394929 100644 --- a/dubhe-visual-server/backend/backend/api/utils.py +++ b/dubhe-visual-server/backend/backend/api/utils.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import re import time from pathlib import Path diff --git a/dubhe-visual-server/backend/backend/asgi.py b/dubhe-visual-server/backend/backend/asgi.py index 55a9394..61e912c 100644 --- a/dubhe-visual-server/backend/backend/asgi.py +++ b/dubhe-visual-server/backend/backend/asgi.py @@ -1,32 +1,4 @@ """ -Copyright (c) Django Software Foundation and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of Django nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ASGI config for backend project. It exposes the ASGI callable as a module-level variable named ``application``. diff --git a/dubhe-visual-server/backend/backend/component/Audio/audio_read.py b/dubhe-visual-server/backend/backend/component/Audio/audio_read.py index 50516bc..9f448ef 100644 --- a/dubhe-visual-server/backend/backend/component/Audio/audio_read.py +++ b/dubhe-visual-server/backend/backend/component/Audio/audio_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= class audio_read: diff --git a/dubhe-visual-server/backend/backend/component/Audio/provider.py b/dubhe-visual-server/backend/backend/component/Audio/provider.py index 72b5ff3..2897890 100644 --- a/dubhe-visual-server/backend/backend/component/Audio/provider.py +++ b/dubhe-visual-server/backend/backend/component/Audio/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from utils.path_utils import get_file_path from .audio_read import audio_read diff --git a/dubhe-visual-server/backend/backend/component/Distribution/dist_read.py b/dubhe-visual-server/backend/backend/component/Distribution/dist_read.py index 3c1c6cf..a2c3b08 100644 --- a/dubhe-visual-server/backend/backend/component/Distribution/dist_read.py +++ b/dubhe-visual-server/backend/backend/component/Distribution/dist_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import numpy as np from backend.component.Histogram.hist_read import histogram_read diff --git a/dubhe-visual-server/backend/backend/component/Distribution/provider.py b/dubhe-visual-server/backend/backend/component/Distribution/provider.py index 5311537..a85a6cd 100644 --- a/dubhe-visual-server/backend/backend/component/Distribution/provider.py +++ b/dubhe-visual-server/backend/backend/component/Distribution/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from utils.path_utils import get_file_path from .dist_read import distribution_read diff --git a/dubhe-visual-server/backend/backend/component/Exception/exception_read.py b/dubhe-visual-server/backend/backend/component/Exception/exception_read.py index 6c7a551..9e62f40 100644 --- a/dubhe-visual-server/backend/backend/component/Exception/exception_read.py +++ b/dubhe-visual-server/backend/backend/component/Exception/exception_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import numpy as np import math from .histogram import Histogram diff --git a/dubhe-visual-server/backend/backend/component/Exception/histogram.py b/dubhe-visual-server/backend/backend/component/Exception/histogram.py index 0dbd514..edf41ca 100644 --- a/dubhe-visual-server/backend/backend/component/Exception/histogram.py +++ b/dubhe-visual-server/backend/backend/component/Exception/histogram.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import numpy as np diff --git a/dubhe-visual-server/backend/backend/component/Exception/provider.py b/dubhe-visual-server/backend/backend/component/Exception/provider.py index 2f28ce9..1b5da8b 100644 --- a/dubhe-visual-server/backend/backend/component/Exception/provider.py +++ b/dubhe-visual-server/backend/backend/component/Exception/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from utils.path_utils import get_file_path from .exception_read import Exception_read diff --git a/dubhe-visual-server/backend/backend/component/Graph/graph.py b/dubhe-visual-server/backend/backend/component/Graph/graph.py index 38787f7..53d2989 100644 --- a/dubhe-visual-server/backend/backend/component/Graph/graph.py +++ b/dubhe-visual-server/backend/backend/component/Graph/graph.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from __future__ import division, print_function, with_statement from __future__ import unicode_literals # at top of module diff --git a/dubhe-visual-server/backend/backend/component/Graph/graph_read.py b/dubhe-visual-server/backend/backend/component/Graph/graph_read.py index ef12f3b..ccb22f8 100644 --- a/dubhe-visual-server/backend/backend/component/Graph/graph_read.py +++ b/dubhe-visual-server/backend/backend/component/Graph/graph_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from backend.component.Graph.graph import Node from backend.component.Graph.graph import Proxy diff --git a/dubhe-visual-server/backend/backend/component/Graph/parse_json.py b/dubhe-visual-server/backend/backend/component/Graph/parse_json.py index 6a26daa..585def2 100644 --- a/dubhe-visual-server/backend/backend/component/Graph/parse_json.py +++ b/dubhe-visual-server/backend/backend/component/Graph/parse_json.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from .graph import Node, Graph, TreeNode from collections import defaultdict diff --git a/dubhe-visual-server/backend/backend/component/Graph/provider.py b/dubhe-visual-server/backend/backend/component/Graph/provider.py index 99b63a3..960c823 100644 --- a/dubhe-visual-server/backend/backend/component/Graph/provider.py +++ b/dubhe-visual-server/backend/backend/component/Graph/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import json from utils.cache_io import CacheIO from utils.path_utils import get_file_path diff --git a/dubhe-visual-server/backend/backend/component/Graph/s_graph_read.py b/dubhe-visual-server/backend/backend/component/Graph/s_graph_read.py index ea58beb..e1749ab 100644 --- a/dubhe-visual-server/backend/backend/component/Graph/s_graph_read.py +++ b/dubhe-visual-server/backend/backend/component/Graph/s_graph_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import json from backend.component.Graph.parse_json import Proxy_json from backend.component.Graph.graph import Node diff --git a/dubhe-visual-server/backend/backend/component/Histogram/hist_read.py b/dubhe-visual-server/backend/backend/component/Histogram/hist_read.py index 5a8a78b..c97cad6 100644 --- a/dubhe-visual-server/backend/backend/component/Histogram/hist_read.py +++ b/dubhe-visual-server/backend/backend/component/Histogram/hist_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import random diff --git a/dubhe-visual-server/backend/backend/component/Histogram/hist_summary.py b/dubhe-visual-server/backend/backend/component/Histogram/hist_summary.py index 1a3cce2..3d54d28 100644 --- a/dubhe-visual-server/backend/backend/component/Histogram/hist_summary.py +++ b/dubhe-visual-server/backend/backend/component/Histogram/hist_summary.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import numpy as np diff --git a/dubhe-visual-server/backend/backend/component/Histogram/provider.py b/dubhe-visual-server/backend/backend/component/Histogram/provider.py index 6162207..345e44a 100644 --- a/dubhe-visual-server/backend/backend/component/Histogram/provider.py +++ b/dubhe-visual-server/backend/backend/component/Histogram/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from .hist_read import histogram_read from utils.path_utils import get_file_path diff --git a/dubhe-visual-server/backend/backend/component/Hparams/hparams_read.py b/dubhe-visual-server/backend/backend/component/Hparams/hparams_read.py index d42a35e..75a9e2e 100644 --- a/dubhe-visual-server/backend/backend/component/Hparams/hparams_read.py +++ b/dubhe-visual-server/backend/backend/component/Hparams/hparams_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= def get_proto_value(value): _data = None if value.HasField("number_value"): diff --git a/dubhe-visual-server/backend/backend/component/Hparams/provider.py b/dubhe-visual-server/backend/backend/component/Hparams/provider.py index 9b2b68d..e578926 100644 --- a/dubhe-visual-server/backend/backend/component/Hparams/provider.py +++ b/dubhe-visual-server/backend/backend/component/Hparams/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from .hparams_read import hparams_read from utils.path_utils import get_file_path diff --git a/dubhe-visual-server/backend/backend/component/Image/image_read.py b/dubhe-visual-server/backend/backend/component/Image/image_read.py index 71d9645..14e3177 100644 --- a/dubhe-visual-server/backend/backend/component/Image/image_read.py +++ b/dubhe-visual-server/backend/backend/component/Image/image_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= class image_read: diff --git a/dubhe-visual-server/backend/backend/component/Image/provider.py b/dubhe-visual-server/backend/backend/component/Image/provider.py index 43ed266..9829778 100644 --- a/dubhe-visual-server/backend/backend/component/Image/provider.py +++ b/dubhe-visual-server/backend/backend/component/Image/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from utils.path_utils import get_file_path from .image_read import image_read diff --git a/dubhe-visual-server/backend/backend/component/Projector/projector_read.py b/dubhe-visual-server/backend/backend/component/Projector/projector_read.py index c99a88d..b6c5c35 100644 --- a/dubhe-visual-server/backend/backend/component/Projector/projector_read.py +++ b/dubhe-visual-server/backend/backend/component/Projector/projector_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= class projector_read: diff --git a/dubhe-visual-server/backend/backend/component/Projector/projector_reduction.py b/dubhe-visual-server/backend/backend/component/Projector/projector_reduction.py index ca51de2..adea72a 100644 --- a/dubhe-visual-server/backend/backend/component/Projector/projector_reduction.py +++ b/dubhe-visual-server/backend/backend/component/Projector/projector_reduction.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from sklearn.decomposition import PCA import numpy as np from tsne import bh_sne diff --git a/dubhe-visual-server/backend/backend/component/Projector/provider.py b/dubhe-visual-server/backend/backend/component/Projector/provider.py index 44107d5..f5f7692 100644 --- a/dubhe-visual-server/backend/backend/component/Projector/provider.py +++ b/dubhe-visual-server/backend/backend/component/Projector/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from PIL import Image import io from utils.cache_io import CacheIO diff --git a/dubhe-visual-server/backend/backend/component/Scalar/provider.py b/dubhe-visual-server/backend/backend/component/Scalar/provider.py index 3e6edec..b444f80 100644 --- a/dubhe-visual-server/backend/backend/component/Scalar/provider.py +++ b/dubhe-visual-server/backend/backend/component/Scalar/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from .scalar_read import scalar_read from utils.path_utils import get_file_path diff --git a/dubhe-visual-server/backend/backend/component/Scalar/scalar_read.py b/dubhe-visual-server/backend/backend/component/Scalar/scalar_read.py index 7f44689..a858fe0 100644 --- a/dubhe-visual-server/backend/backend/component/Scalar/scalar_read.py +++ b/dubhe-visual-server/backend/backend/component/Scalar/scalar_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= class scalar_read: diff --git a/dubhe-visual-server/backend/backend/component/Text/provider.py b/dubhe-visual-server/backend/backend/component/Text/provider.py index 6f13734..1f96e65 100644 --- a/dubhe-visual-server/backend/backend/component/Text/provider.py +++ b/dubhe-visual-server/backend/backend/component/Text/provider.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.cache_io import CacheIO from utils.path_utils import get_file_path from .text_read import text_read diff --git a/dubhe-visual-server/backend/backend/component/Text/text_read.py b/dubhe-visual-server/backend/backend/component/Text/text_read.py index 0e4fe75..8f4fbf5 100644 --- a/dubhe-visual-server/backend/backend/component/Text/text_read.py +++ b/dubhe-visual-server/backend/backend/component/Text/text_read.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= def _warp_values(values): diff --git a/dubhe-visual-server/backend/backend/component/__init__.py b/dubhe-visual-server/backend/backend/component/__init__.py index 875a43d..e84bcb5 100644 --- a/dubhe-visual-server/backend/backend/component/__init__.py +++ b/dubhe-visual-server/backend/backend/component/__init__.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= __all__ = [ "get_scalar_data", "get_histogram_data", "get_distribution_data", "get_text_data", "get_audio_meta_data", "get_audio_data", diff --git a/dubhe-visual-server/backend/backend/data_provider/session_mdw.py b/dubhe-visual-server/backend/backend/data_provider/session_mdw.py index 44760eb..e097d03 100644 --- a/dubhe-visual-server/backend/backend/data_provider/session_mdw.py +++ b/dubhe-visual-server/backend/backend/data_provider/session_mdw.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from django.http import JsonResponse diff --git a/dubhe-visual-server/backend/backend/settings.py b/dubhe-visual-server/backend/backend/settings.py index 1f9cf35..77e99a5 100644 --- a/dubhe-visual-server/backend/backend/settings.py +++ b/dubhe-visual-server/backend/backend/settings.py @@ -1,32 +1,4 @@ """ -Copyright (c) Django Software Foundation and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of Django nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Django settings for backend project. Generated by 'django-admin startproject' using Django 3.0.3. diff --git a/dubhe-visual-server/backend/backend/urls.py b/dubhe-visual-server/backend/backend/urls.py index b5af8d3..182b3fb 100644 --- a/dubhe-visual-server/backend/backend/urls.py +++ b/dubhe-visual-server/backend/backend/urls.py @@ -1,33 +1,4 @@ -""" -Copyright (c) Django Software Foundation and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of Django nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -backend URL Configuration +"""backend URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ diff --git a/dubhe-visual-server/backend/backend/wsgi.py b/dubhe-visual-server/backend/backend/wsgi.py index c7f500a..1b7a976 100644 --- a/dubhe-visual-server/backend/backend/wsgi.py +++ b/dubhe-visual-server/backend/backend/wsgi.py @@ -1,31 +1,4 @@ """ -Copyright (c) Django Software Foundation and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of Django nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. WSGI config for backend project. It exposes the WSGI callable as a module-level variable named ``application``. diff --git a/dubhe-visual-server/backend/main.py b/dubhe-visual-server/backend/main.py index dc6a5c7..f7d11f6 100644 --- a/dubhe-visual-server/backend/main.py +++ b/dubhe-visual-server/backend/main.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from absl import app, flags import manage import sys diff --git a/dubhe-visual-server/backend/manage.py b/dubhe-visual-server/backend/manage.py index 87c83cf..10e17af 100644 --- a/dubhe-visual-server/backend/manage.py +++ b/dubhe-visual-server/backend/manage.py @@ -1,32 +1,3 @@ -""" -Copyright (c) Django Software Foundation and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of Django nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os diff --git a/dubhe-visual-server/init.sh b/dubhe-visual-server/init.sh new file mode 100644 index 0000000..ded5905 --- /dev/null +++ b/dubhe-visual-server/init.sh @@ -0,0 +1,11 @@ +#!/bin/bash +wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh +bash Anaconda3-2020.07-Linux-x86_64.sh +echo 'export PATH=$PATH:/root/anaconda3/bin'>>/root/.bashrc + +source /root/.bashrc + +conda env create --file dubhe_visual.yaml + +echo '环境初始化成功,启动服务请执行:source start_server.sh' + diff --git a/dubhe-visual-server/parser_service/master.py b/dubhe-visual-server/parser_service/master.py index fe76851..5aae4ee 100644 --- a/dubhe-visual-server/parser_service/master.py +++ b/dubhe-visual-server/parser_service/master.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import sys sys.path.append('../service_utils') from python_io import logfile_utils diff --git a/dubhe-visual-server/parser_service/python_io/dictionary_watcher.py b/dubhe-visual-server/parser_service/python_io/dictionary_watcher.py index 6ebbbe7..5b1ca1f 100644 --- a/dubhe-visual-server/parser_service/python_io/dictionary_watcher.py +++ b/dubhe-visual-server/parser_service/python_io/dictionary_watcher.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import os from watchdog.observers.polling import PollingObserver from watchdog.events import * diff --git a/dubhe-visual-server/parser_service/python_io/lazy_load.py b/dubhe-visual-server/parser_service/python_io/lazy_load.py index 259c2d1..3971b61 100644 --- a/dubhe-visual-server/parser_service/python_io/lazy_load.py +++ b/dubhe-visual-server/parser_service/python_io/lazy_load.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from pathlib import Path from typing import Union import os diff --git a/dubhe-visual-server/parser_service/python_io/logfile_loader.py b/dubhe-visual-server/parser_service/python_io/logfile_loader.py index 0b95ee4..07d44fa 100644 --- a/dubhe-visual-server/parser_service/python_io/logfile_loader.py +++ b/dubhe-visual-server/parser_service/python_io/logfile_loader.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import threading import time from io import BytesIO diff --git a/dubhe-visual-server/parser_service/python_io/logfile_utils.py b/dubhe-visual-server/parser_service/python_io/logfile_utils.py index 4936064..f7ff85f 100644 --- a/dubhe-visual-server/parser_service/python_io/logfile_utils.py +++ b/dubhe-visual-server/parser_service/python_io/logfile_utils.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from pathlib import Path diff --git a/dubhe-visual-server/parser_service/tbparser/graph_reader.py b/dubhe-visual-server/parser_service/tbparser/graph_reader.py index 06d49a1..4cfa0c7 100644 --- a/dubhe-visual-server/parser_service/tbparser/graph_reader.py +++ b/dubhe-visual-server/parser_service/tbparser/graph_reader.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from tbparser.events_reader import EventReadingError, EventsFileReader from tensorboard.compat.proto.graph_pb2 import GraphDef from pathlib import Path diff --git a/dubhe-visual-server/parser_service/tbparser/projector_reader.py b/dubhe-visual-server/parser_service/tbparser/projector_reader.py index 48a2120..5f08848 100644 --- a/dubhe-visual-server/parser_service/tbparser/projector_reader.py +++ b/dubhe-visual-server/parser_service/tbparser/projector_reader.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from oneflow.customized.utils import projector_pb2 from collections.abc import Iterable from typing import BinaryIO diff --git a/dubhe-visual-server/service_utils/monitor.py b/dubhe-visual-server/service_utils/monitor.py index 1491bd0..5b7cc0d 100644 --- a/dubhe-visual-server/service_utils/monitor.py +++ b/dubhe-visual-server/service_utils/monitor.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from utils.redis_utils import RedisInstance import json import time diff --git a/dubhe-visual-server/service_utils/utils/cache_io.py b/dubhe-visual-server/service_utils/utils/cache_io.py index 46f5a9b..0ef35e4 100644 --- a/dubhe-visual-server/service_utils/utils/cache_io.py +++ b/dubhe-visual-server/service_utils/utils/cache_io.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import pickle diff --git a/dubhe-visual-server/service_utils/utils/config_utils.py b/dubhe-visual-server/service_utils/utils/config_utils.py index af85a55..ebc6888 100644 --- a/dubhe-visual-server/service_utils/utils/config_utils.py +++ b/dubhe-visual-server/service_utils/utils/config_utils.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import configparser from os import path diff --git a/dubhe-visual-server/service_utils/utils/path_utils.py b/dubhe-visual-server/service_utils/utils/path_utils.py index 723f796..92a7933 100644 --- a/dubhe-visual-server/service_utils/utils/path_utils.py +++ b/dubhe-visual-server/service_utils/utils/path_utils.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= from pathlib import Path from .redis_utils import RedisInstance from .config_utils import ConfigInstance diff --git a/dubhe-visual-server/service_utils/utils/redis_utils.py b/dubhe-visual-server/service_utils/utils/redis_utils.py index d722843..ad9a0d2 100644 --- a/dubhe-visual-server/service_utils/utils/redis_utils.py +++ b/dubhe-visual-server/service_utils/utils/redis_utils.py @@ -1,23 +1,18 @@ -""" -/** -* Copyright 2020 Zhejiang Lab. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================= -*/ -""" - # -*- coding: UTF-8 -*- +# Copyright 2020 Zhejiang Lab. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================= import redis from pathlib import Path from .config_utils import ConfigInstance diff --git a/dubhe-visual-server/services b/dubhe-visual-server/services deleted file mode 100644 index 04b73bc..0000000 --- a/dubhe-visual-server/services +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -HOME={可视化后端代码根目录} -CONDA={conda环境目录} - -django() -{ - cd $HOME/backend - nohup $CONDA/bin/python -u $HOME/backend/main.py --port $1 >$HOME/django.log 2>&1 & -} - -server() -{ - cd $HOME/parser_service - nohup $CONDA/bin/python -u $HOME/parser_service/master.py >$HOME/server.log 2>&1 & -} - -monitor() -{ - cd $HOME/service_utils - nohup $CONDA/bin/python -u $HOME/service_utils/monitor.py >$HOME/monitor.log 2>&1 & -} - - -case $1 in - django) - django $2 - ;; - server) - server - ;; - monitor) - monitor - ;; - *) - echo "usage:dubhe-visual-server {django PORT|server|monitor}" >&2 - exit 0 - ;; -esac -exit 0 \ No newline at end of file diff --git a/dubhe-visual-server/start_dubhe_visual_server.sh b/dubhe-visual-server/start_dubhe_visual_server.sh deleted file mode 100644 index 0eeee5a..0000000 --- a/dubhe-visual-server/start_dubhe_visual_server.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -SERVER=$(systemctl is-active server.service) -DJANGO=$(systemctl is-active django@$1.service) -MONITOR=$(systemctl is-active monitor.service) - -if [ $SERVER = active ] -then - echo restart server - systemctl restart server.service -else - echo start server - systemctl start server.service -fi - -if [ $DJANGO = active ] -then - echo restart django at port $1 - systemctl restart django@$1.service -else - echo start django at port $1 - systemctl start django@$1.service -fi - -if [ $MONITOR = active ] -then -echo restart monitor -systemctl restart monitor.service -else -echo start monitor -systemctl start monitor.service -fi - diff --git a/dubhe-visual-server/start_server.sh b/dubhe-visual-server/start_server.sh new file mode 100644 index 0000000..407a3e8 --- /dev/null +++ b/dubhe-visual-server/start_server.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +conda activate dubhe_visual +echo '进入conda虚拟环境,正在启动服务...' +DIRNAME=$(pwd) + +cd backend/ +nohup python $DIRNAME/backend/main.py --port 9898 >django.log 2>&1 & +echo 'http 服务启动' + +cd parser_service/ +nohup python $DIRNAME/parser_service/master.py >server.log 2>&1 & +echo 'parser 服务启动' + +cd service_utils/ +nohup python $DIRNAME/service_utils/monitor.py >monitor.log 2>&1 & +echo 'monitor 服务启动' + +echo '服务启动成功,停止服务请执行:source stop_server.sh' diff --git a/dubhe-visual-server/stop_server.sh b/dubhe-visual-server/stop_server.sh new file mode 100644 index 0000000..2246140 --- /dev/null +++ b/dubhe-visual-server/stop_server.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +ps -ef | grep python |grep -v "ndp" |awk '{print $2}'|xargs kill -9 + +conda deactivate + +echo '服务停止成功,退出conda虚拟环境'