Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docker): support building with gradio #1701

Merged
merged 5 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,8 @@ docker/charts/index.yaml
docker/charts/starwhale-*.tgz

/client/.idea/

# for building gradio
gradio
.pnpm-store/
console/src/assets/GradioWidget/
10 changes: 10 additions & 0 deletions console/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ build-ui:
ci-lint:
yarn lint
yarn typecheck

rebuild-gradio:
rm -rf gradio && git clone --depth 1 --branch=feat/sw-gradio-widget https://github.com/star-whale/gradio gradio
pushd gradio/ui && \
pnpm i && \
pnpm build && \
rm -rf src/assets/GradioWidget && mkdir -p src/assets/GradioWidget && \
mv packages/starwhale/build src/assets/GradioWidget/es && popd
rm -rf gradio

10 changes: 2 additions & 8 deletions console/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
# react-typescript-starter


## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Open [http://localhost:5173/](http://localhost:5173/) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
Run `make rebuild-gradio` if error like "@/assets/GradioWidget/es/app.es.js can not found" occurs.

### `yarn build`

Expand Down
2 changes: 2 additions & 0 deletions console/packages/starwhale-core/src/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ export function withEditorRegister(EditorApp: React.FC) {
return function EditorLoader(props: any) {
// const [registred, setRegistred] = React.useState(false)
useEffect(() => {
/*
import('http://127.0.0.1:8080/widget.js').then((module) => {
// setRegistred(true)
console.log(module)
})
*/
}, [])
// if (!registred) {
// return <BusyPlaceholder type='spinner' />
Expand Down
3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/BlockLabel.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/BlockLabel.js.map

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Column.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Column.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/File.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/File.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Image.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Image.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Image2.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Image2.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Model3D.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Model3D.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/ModifyUpload.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/ModifyUpload.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Tabs.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Tabs.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Upload.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Upload.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Webcam.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/Webcam.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/_commonjsHelpers.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/_commonjsHelpers.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/app.es.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/app.es.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/color.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/color.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/csv.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/csv.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/dsv.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/dsv.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index10.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index10.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index11.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index11.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index12.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index12.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index13.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index13.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index14.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index14.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index15.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index15.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index16.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index16.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index17.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index17.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index18.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index18.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index19.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index19.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index2.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index2.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index20.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index20.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index21.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index21.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index22.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index22.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index23.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index23.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index24.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index24.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index25.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index25.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index26.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index26.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index27.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index27.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index28.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index28.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index29.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index29.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index3.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index3.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index30.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index30.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index31.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index31.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index32.js

This file was deleted.

3 changes: 0 additions & 3 deletions console/src/assets/GradioWidget/es/index32.js.map

This file was deleted.

Loading