Skip to content

Commit

Permalink
Merge branch 'main' of github.com:porink0424/optuna-dashboard into fo…
Browse files Browse the repository at this point in the history
…llowup/feature/tslib-trialtable
  • Loading branch information
porink0424 committed Aug 23, 2024
2 parents 80d45a4 + 01cbcf5 commit 6347ef8
Show file tree
Hide file tree
Showing 55 changed files with 6,080 additions and 8,955 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/e2e-dashboard-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ on:
paths:
- '.github/workflows/e2e-dashboard-tests.yml'
- '**.py'
- '**.ts'
- '**.tsx'
- 'tslib/**.ts'
- 'tslib/**.tsx'
- 'tslib/**/package.json'
- 'tslib/**/package-lock.json'
- 'optuna_dashboard/**.ts'
- 'optuna_dashboard/**.tsx'
- 'optuna_dashboard/package.json'
- 'optuna_dashboard/package-lock.json'
- 'optuna_dashboard/tsconfig.json'
Expand Down Expand Up @@ -37,7 +41,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.11'
architecture: x64

- name: Setup Optuna ${{ matrix.optuna-version }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e-standalone-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- main
paths:
- '.github/workflows/e2e-standalone-tests.yml'
- 'tslib/**.ts'
- 'tslib/**.tsx'
- 'tslib/**/package.json'
- 'tslib/**/package-lock.json'
- 'standalone_app/**.ts'
- 'standalone_app/**.tsx'
- 'standalone_app/package.json'
Expand Down Expand Up @@ -34,7 +38,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.11'
architecture: x64

- name: Setup Optuna ${{ matrix.optuna-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: '20'
- name: Build rustlib
working-directory: rustlib
run: wasm-pack build --target web
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Build bundle.js
working-directory: optuna_dashboard
run: |
npm install
npm run build:prd
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off wheel twine build
- run: python -m build --sdist --wheel
- run: make python-package
- run: twine check dist/*

- name: Create GitHub release
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,20 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Build bundle.js
working-directory: optuna_dashboard
run: |
npm install
npm run build:prd
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off wheel twine build
- run: python -m build --sdist --wheel
- run: make python-package

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
19 changes: 18 additions & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
architecture: x64
- name: Install dependencies
run: |
Expand All @@ -26,6 +26,23 @@ jobs:
- run: black --check --diff .
- run: isort --check --diff .
- run: mypy optuna_dashboard python_tests
build-python-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off wheel twine build
- run: make python-package
test:
runs-on: ubuntu-latest
strategy:
Expand Down
36 changes: 21 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ The repository is organized as follows:

```
.
├── optuna_dashboard/ # The Python package.
│ └── ts/ # TypeScript code for the Python package.
├── standalone_app/ # Standalone application that can be run in browser or within the WebView of the VS Code extension.
│ ├── browser_app_entry.tsx # Entry point for browser app, hosted on GitHub pages.
│ └── vscode_entry.tsx # Entry point for VS Code app, output placed under `vscode/assets`.
├── vscode/ # The VS Code extension.
├── rustlib/ # Rust library exporting Wasm functions.
│ └── pkg/ # Output directory for rustlib, installed from package.json via `"./rustlib/pkg"`.
└── tslib/ # TypeScript library shared for common use.
├── react/ # Common React components.
├── storage/ # Common code for handling storage.
└── types/ # Common TypeScript types.
├── optuna_dashboard/ # The Python package.
│ └── ts/ # TypeScript code for the Python package.
│ ├── index.tsx # Entry point for the Python package.
│ └── pkg_index.tsx # Entry point for Jupyter Lab extension, output placed under `optuna_dashboard/pkg/`.
├── standalone_app/ # Standalone application that can be run in browser or within the WebView of the VS Code extension.
│ ├── browser_app_entry.tsx # Entry point for browser app, hosted on GitHub pages.
│ └── vscode_entry.tsx # Entry point for VS Code extension, output placed under `vscode/assets`.
├── vscode/ # The VS Code extension.
├── jupyterlab/ # The Jupyter Lab extension.
├── rustlib/ # Rust library exporting Wasm functions.
│ └── pkg/ # Output directory for rustlib, installed from package.json via `"./rustlib/pkg"`.
└── tslib/ # TypeScript library shared for common use.
├── react/ # Common React components.
├── storage/ # Common code for handling storage.
└── types/ # Common TypeScript types.
```

## Python package
Expand Down Expand Up @@ -145,8 +148,6 @@ The release process(compiling TypeScript files, packaging Python distributions a

## Standalone Single-page Application

### Compiling Rust library and TypeScript files

Please install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) and execute the following command.

```
Expand All @@ -155,10 +156,15 @@ $ make serve-browser-app

Open http://localhost:5173/


## VS Code Extension

```
$ npm i -g vsce
$ make vscode-extension
```

## Jupyter Lab Extension

```
$ make jupyterlab-extension
```
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DEFAULT_GOAL := sdist
.DEFAULT_GOAL := python-package

PYTHON ?= python3
MODE ?= dev
Expand All @@ -15,7 +15,7 @@ $(RUSTLIB_OUT): rustlib/src/*.rs rustlib/Cargo.toml
vscode/assets/bundle.js: $(RUSTLIB_OUT) $(STANDALONE_SRC) tslib
cd standalone_app && npm install && npm run build:vscode

$(DASHBOARD_TS_OUT): $(DASHBOARD_TS_SRC)
$(DASHBOARD_TS_OUT): $(DASHBOARD_TS_SRC) tslib
cd optuna_dashboard && npm install && npm run build:$(MODE)

.PHONY: tslib
Expand All @@ -31,24 +31,21 @@ tslib-test: tslib

.PHONY: serve-browser-app
serve-browser-app: tslib $(RUSTLIB_OUT)
cd standalone_app && npm install && npm run watch
cd standalone_app && npm i && npm run watch

.PHONY: vscode-extension
vscode-extension: vscode/assets/bundle.js
cd vscode && npm install && npm run vscode:prepublish && vsce package
cd vscode && npm i && npm run vscode:prepublish && vsce package

.PHONY: jupyterlab-extension
jupyterlab-extension: tslib
cd optuna_dashboard && npm install && npm run build:pkg
cd jupyterlab && python -m build --sdist

.PHONY: sdist
sdist: pyproject.toml $(DASHBOARD_TS_OUT)
python -m build --sdist

.PHONY: wheel
wheel: pyproject.toml $(DASHBOARD_TS_OUT)
python -m build --wheel
.PHONY: python-package
python-package: pyproject.toml tslib
cd optuna_dashboard && npm i && npm run build:prd
python -m build --sdist --wheel

.PHONY: docs
docs: docs/conf.py $(RST_FILES)
Expand All @@ -64,4 +61,4 @@ fmt:
clean:
rm -rf tslib/types/pkg tslib/storage/pkg tslib/react/pkg tslib/react/types
rm -rf optuna_dashboard/public/ doc/_build/
rm -rf rustlib/pkg standalone_app/public/ vscode/assets/ vscode/*.vsix
rm -rf rustlib/pkg vscode/assets/ vscode/*.vsix
Loading

0 comments on commit 6347ef8

Please sign in to comment.