未验证 提交 24135c4b 编写于 作者: P Peter Pan 提交者: GitHub

add demo docker (#766)

* bump to 2.0.1

* update demo

* bump fe to 2.0.0

* update demo

* add ping url
上级 35e1252f
FROM nikolaik/python-nodejs:python3.8-nodejs14 AS builder
WORKDIR /home/visualdl
COPY . .
RUN apt-get update && apt-get -y --no-install-recommends install cmake && rm -rf /var/lib/apt/lists/*
RUN ["pip", "install", "--disable-pip-version-check", "-r", "requirements.txt"]
RUN ["python", "setup.py", "bdist_wheel"]
FROM python:3-alpine as opencv
WORKDIR /opt
......@@ -109,24 +119,14 @@ RUN cp -p $(find `python -c "from distutils.sysconfig import get_python_lib; pri
RUN tar zcf packages.tar.gz -C $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") .
FROM nikolaik/python-nodejs:python3.8-nodejs14 AS builder
WORKDIR /home/visualdl
COPY . .
RUN apt-get update && apt-get -y --no-install-recommends install cmake && rm -rf /var/lib/apt/lists/*
RUN ["pip", "install", "-r", "requirements.txt"]
RUN ["python", "setup.py", "bdist_wheel"]
FROM python:3-alpine
WORKDIR /home/visualdl
COPY --from=builder /home/visualdl/dist/* dist/
COPY --from=opencv /usr/local/include/opencv* /usr/local/include/
COPY --from=opencv /usr/local/lib/* /usr/local/lib/
COPY --from=opencv /usr/local/lib64/* /usr/local/lib64/
COPY --from=opencv /opt/packages.tar.gz .
COPY --from=builder /home/visualdl/dist/* dist/
COPY requirements.txt .
RUN tar zxf packages.tar.gz -C $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
......@@ -136,4 +136,4 @@ RUN sed -i -e '/opencv-python/d' requirements.txt
RUN ["pip", "install", "--disable-pip-version-check", "-r", "requirements.txt"]
RUN ["pip", "install", "--disable-pip-version-check", "--no-deps", "--find-links=dist", "visualdl"]
ENTRYPOINT ["visualdl", "--logdir", "/home/visualdl/log"]
ENTRYPOINT ["visualdl", "--logdir", "/home/visualdl/log", "--host", "0.0.0.0"]
FROM nikolaik/python-nodejs:python3.8-nodejs14 AS builder
WORKDIR /home/visualdl
COPY . .
RUN apt-get update && apt-get -y --no-install-recommends install cmake libgl1-mesa-glx && rm -rf /var/lib/apt/lists/*
RUN ["pip", "install", "--disable-pip-version-check", "-r", "requirements.txt"]
RUN ["python", "setup.py", "bdist_wheel"]
RUN ["pip", "install", "--disable-pip-version-check", "--find-links=dist", "visualdl"]
WORKDIR frontend
ENV SCOPE server
ENV PUBLIC_PATH /paddle/visualdl/demo
ENV API_URL /paddle/visualdl/demo/api
RUN ["./scripts/install.sh"]
RUN ["./scripts/build.sh"]
FROM node:14-alpine
WORKDIR /home/visualdl
COPY --from=builder /home/visualdl/frontend/ ./
ENV NODE_ENV production
ENV PUBLIC_PATH /paddle/visualdl/demo
ENV API_URL /paddle/visualdl/demo/api
ENV PING_URL /ping
ENV DEMO true
ENV HOST 0.0.0.0
ENV PORT 8999
RUN ["yarn", "install", "--frozen-lockfile"]
ENTRYPOINT ["yarn", "workspace" , "@visualdl/server", "start"]
version: '3.8'
services:
demo:
build:
context: .
dockerfile: Dockerfile.demo
ports:
- "8999:8999"
environment:
PING_URL: /ping
PORT: 8999
......@@ -6,7 +6,7 @@ services:
- "8000"
volumes:
- "log:/home/visualdl/log"
command: ["--api-only", "--host=0.0.0.0", "--port=8000"]
command: ["--api-only", "--port=8000"]
frontend:
build: ./frontend
depends_on:
......
......@@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "2.0.0-beta.50",
"version": "2.0.0",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
......
{
"name": "@visualdl/cli",
"version": "2.0.0-beta.50",
"version": "2.0.0",
"description": "A platform to visualize the deep learning process and result.",
"keywords": [
"visualdl",
......@@ -34,7 +34,7 @@
"dist"
],
"dependencies": {
"@visualdl/server": "2.0.0-beta.50",
"@visualdl/server": "2.0.0",
"open": "7.1.0",
"ora": "4.0.5",
"pm2": "4.4.0",
......
{
"name": "@visualdl/core",
"version": "2.0.0-beta.50",
"version": "2.0.0",
"title": "VisualDL",
"description": "A platform to visualize the deep learning process and result.",
"keywords": [
......@@ -34,9 +34,9 @@
},
"dependencies": {
"@tippyjs/react": "4.1.0",
"@visualdl/i18n": "2.0.0-beta.50",
"@visualdl/netron": "2.0.0-beta.50",
"@visualdl/wasm": "2.0.0-beta.50",
"@visualdl/i18n": "2.0.0",
"@visualdl/netron": "2.0.0",
"@visualdl/wasm": "2.0.0",
"bignumber.js": "9.0.0",
"d3-format": "1.4.4",
"echarts": "4.8.0",
......@@ -80,7 +80,7 @@
"@types/react-dom": "16.9.8",
"@types/react-rangeslider": "2.2.3",
"@types/styled-components": "5.1.2",
"@visualdl/mock": "2.0.0-beta.50",
"@visualdl/mock": "2.0.0",
"babel-plugin-emotion": "10.0.33",
"babel-plugin-styled-components": "1.11.1",
"babel-plugin-typescript-to-proptypes": "1.4.0",
......
import type {Worker} from './types';
import type {Data, Worker} from './types';
interface Audio {
step: number;
......@@ -11,11 +11,11 @@ const worker: Worker = async io => {
return;
}
const tagsMap = await io.save<Record<string, string[]>>('/audio/tags');
for (const [run, tags] of Object.entries(tagsMap)) {
for (const tag of tags) {
const list = await io.save<Audio[]>('/audio/list', {run, tag});
for (const [index, audio] of Object.entries(list)) {
const {runs, tags} = await io.save<Data>('/audio/tags');
for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) {
const list = (await io.save<Audio[]>('/audio/list', {run, tag})) ?? [];
for (const [index, audio] of list.entries()) {
await io.saveBinary('/audio/audio', {run, tag, index, ts: audio.wallTime});
}
}
......
import type {Worker} from './types';
import type {Data, Worker} from './types';
const worker: Worker = async io => {
const components = await io.getData<string[]>('/components');
......@@ -6,10 +6,10 @@ const worker: Worker = async io => {
return;
}
const tagsMap = await io.save<Record<string, string[]>>('/histogram/tags');
const {runs, tags} = await io.save<Data>('/histogram/tags');
const q = [];
for (const [run, tags] of Object.entries(tagsMap)) {
for (const tag of tags) {
for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) {
q.push(io.save('/histogram/list', {run, tag}));
}
}
......
import type {Worker} from './types';
import type {Data, Worker} from './types';
interface Image {
step: number;
......@@ -11,11 +11,11 @@ const worker: Worker = async io => {
return;
}
const tagsMap = await io.save<Record<string, string[]>>('/image/tags');
for (const [run, tags] of Object.entries(tagsMap)) {
for (const tag of tags) {
const list = await io.save<Image[]>('/image/list', {run, tag});
for (const [index, image] of Object.entries(list)) {
const {runs, tags} = await io.save<Data>('/image/tags');
for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) {
const list = (await io.save<Image[]>('/image/list', {run, tag})) ?? [];
for (const [index, image] of list.entries()) {
await io.saveBinary('/image/image', {run, tag, index, ts: image.wallTime});
}
}
......
......@@ -29,7 +29,7 @@ async function start() {
'--logdir',
'.',
'--model',
'./graph/__model__',
'./__model__',
'--host',
host,
'--port',
......
import type {Worker} from './types';
import type {Data, Worker} from './types';
const worker: Worker = async io => {
const components = await io.getData<string[]>('/components');
......@@ -6,10 +6,10 @@ const worker: Worker = async io => {
return;
}
const tagsMap = await io.save<Record<string, string[]>>('/pr-curve/tags');
for (const [run, tags] of Object.entries(tagsMap)) {
const {runs, tags} = await io.save<Data>('/pr-curve/tags');
for (const [index, run] of runs.entries()) {
await io.save('/pr-curve/steps', {run});
for (const tag of tags) {
for (const tag of tags[index]) {
await io.save('/pr-curve/list', {run, tag});
}
}
......
import type {Worker} from './types';
import type {Data, Worker} from './types';
const worker: Worker = async io => {
const components = await io.getData<string[]>('/components');
......@@ -6,10 +6,10 @@ const worker: Worker = async io => {
return;
}
const tagsMap = await io.save<Record<string, string[]>>('/scalar/tags');
const {runs, tags} = await io.save<Data>('/scalar/tags');
const q = [];
for (const [run, tags] of Object.entries(tagsMap)) {
for (const tag of tags) {
for (const [index, run] of runs.entries()) {
for (const tag of tags[index]) {
q.push(io.save('/scalar/list', {run, tag}));
}
}
......
import type IO from './io';
export type Worker = (io: IO) => Promise<void>;
export type Data = {
runs: string[];
tags: string[][];
};
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册