Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-trial-compare
Browse files Browse the repository at this point in the history
  • Loading branch information
hrntsm committed Jan 20, 2025
2 parents 4f5c5fe + 82ed5d4 commit 0f398cf
Show file tree
Hide file tree
Showing 16 changed files with 4,088 additions and 4,214 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/jupyterlab-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: tests
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/jupyterlab-tests.yml'
- '**.py'
- '**.ts'
- '**.tsx'
- 'optuna_dashboard/package.json'
- 'optuna_dashboard/package-lock.json'
- 'tslib/react/package.json'
- 'tslib/react/package-lock.json'
- 'tslib/storage/package.json'
- 'tslib/storage/package-lock.json'
- 'jupyterlab/pyproject.toml'
- 'jupyterlab/package.json'
- 'jupyterlab/yarn.lock'
jobs:
test-build:
name: Test build for JupyterLab extension
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64

- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools build
pip install --progress-bar off jupyterlab
pip install --progress-bar off .
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- run: make tslib

- name: Build JavaScript dependencies
working-directory: optuna_dashboard
run: |
npm install
npm run build:pkg
# Without a following step, it will be failed to build the jupyter lab extension by the below error
# Type Error Cannot read properties of undefined (reading .../jupyterlab/.pnp.cjs)
- name: Mysterious hack to fix the build error
working-directory: jupyterlab
run: yarn install

- name: Build package
working-directory: jupyterlab
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: python -m build --sdist

7 changes: 7 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ jobs:

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# Temporary workaround to bypass Twine's bug with attestation support
# See /~https://github.com/pypa/gh-action-pypi-publish/issues/283
# TODO(c-bata): Once a new version of twine is released, delete this line.
# /~https://github.com/pypa/twine/pull/1172
attestations: false

11 changes: 6 additions & 5 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
build-python-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Python
Expand All @@ -50,7 +50,7 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
optuna-version: ['optuna>=3.1.0']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -71,7 +71,7 @@ jobs:
test-with-optuna-master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -90,7 +90,7 @@ jobs:
test-with-optuna-oldest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -106,3 +106,4 @@ jobs:
- name: Run python unit tests
run: |
pytest python_tests
2 changes: 2 additions & 0 deletions .github/workflows/typescript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- 'optuna_dashboard/package-lock.json'
- 'vscode/package.json'
- 'vscode/package-lock.json'
- 'standalone_app/package.json'
- 'standalone_app/package-lock.json'
- 'tslib/react/package.json'
- 'tslib/react/package-lock.json'
- 'tslib/storage/package.json'
Expand Down
37 changes: 27 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
FROM node:20 AS front-builder
WORKDIR /usr/src/optuna_dashboard

WORKDIR /usr/src/tslib/storage
ADD ./tslib/storage/package.json /usr/src/tslib/storage/package.json
ADD ./tslib/storage/package-lock.json /usr/src/tslib/storage/package-lock.json
RUN npm install

WORKDIR /usr/src/tslib/types
ADD ./tslib/types/package.json /usr/src/tslib/types/package.json
ADD ./tslib/types/package-lock.json /usr/src/tslib/types/package-lock.json
RUN npm install

WORKDIR /usr/src/tslib/react
ADD ./tslib/react/package.json /usr/src/tslib/react/package.json
ADD ./tslib/react/package-lock.json /usr/src/tslib/react/package-lock.json
RUN npm install

WORKDIR /usr/src/optuna_dashboard
ADD ./optuna_dashboard/package.json /usr/src/optuna_dashboard/package.json
ADD ./optuna_dashboard/package-lock.json /usr/src/optuna_dashboard/package-lock.json
RUN npm install

ADD ./optuna_dashboard/tsconfig.json /usr/src/optuna_dashboard/tsconfig.json
ADD ./optuna_dashboard/webpack.config.js /usr/src/optuna_dashboard/webpack.config.js
ADD ./optuna_dashboard/ts/ /usr/src/optuna_dashboard/ts
RUN mkdir -p /usr/src/optuna_dashboard/public
RUN npm run build:prd
WORKDIR /usr/src/
ADD ./tslib /usr/src/tslib
RUN make tslib

WORKDIR /usr/src/optuna_dashboard
ADD ./optuna_dashboard /usr/src/optuna_dashboard
RUN NODE_OPTIONS="--max-old-space-size=4096" npm run build:prd

FROM python:3.12-buster AS python-builder
FROM python:3.12-bookworm AS python-builder

WORKDIR /usr/src
RUN pip install --upgrade pip setuptools
RUN pip install --progress-bar off PyMySQL[rsa] psycopg2-binary gunicorn optuna-fast-fanova
RUN pip install --progress-bar off PyMySQL[rsa] psycopg2-binary gunicorn

ADD ./pyproject.toml /usr/src/pyproject.toml
ADD ./optuna_dashboard /usr/src/optuna_dashboard
COPY --from=front-builder /usr/src/optuna_dashboard/public/ /usr/src/optuna_dashboard/public/
RUN pip install --progress-bar off .

FROM python:3.11-slim-buster as runner
FROM python:3.12-slim-bookworm as runner

COPY --from=python-builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=python-builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=python-builder /usr/local/bin/optuna-dashboard /usr/local/bin/optuna-dashboard

RUN mkdir /app
Expand Down
77 changes: 46 additions & 31 deletions jupyterlab/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jupyterlab-optuna",
"version": "0.1.0",
"version": "0.2.0",
"description": "A JupyterLab extension for Optuna",
"keywords": [
"jupyter",
Expand Down Expand Up @@ -47,52 +47,67 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@emotion/react": "^11.10.8",
"@emotion/styled": "^11.10.8",
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/launcher": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@mui/icons-material": "^6.1.1",
"@mui/lab": "^6.0.0-beta.10",
"@mui/material": "^6.1.1",
"@optuna/optuna-dashboard": "link:../optuna_dashboard",
"@types/chroma-js": "^2.4.1",
"@types/signals": "^1.0.2",
"elkjs": "^0.8.2",
"ngl": "^2.1.1",
"notistack": "^3.0.1",
"plotly.js-dist-min": "^2.22.0",
"react": "link:../tslib/react/node_modules/react",
"react-dom": "^18.2.0",
"react-markdown": "^8.0.4",
"react-router-dom": "6.11.0",
"react-syntax-highlighter": "^15.5.0",
"reactflow": "^11.8.3",
"recoil": "^0.7.7",
"rehype-mathjax": "^4.0.2",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1"
"@optuna/optuna-dashboard": "link:../optuna_dashboard"
},
"devDependencies": {
"@emotion/react": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@jupyterlab/application": "^4.3.4",
"@jupyterlab/apputils": "^4.4.4",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/coreutils": "^6.3.4",
"@jupyterlab/launcher": "^4.3.4",
"@jupyterlab/services": "^7.3.4",
"@mui/icons-material": "^6.1.1",
"@mui/lab": "^6.0.0-beta.10",
"@mui/material": "^6.1.1",
"@mui/system": "^6.1.1",
"@optuna/types": "link:../tslib/types",
"@react-three/drei": "^9.96.4",
"@react-three/fiber": "^8.15.15",
"@tanstack/react-query": "^5.18.1",
"@tanstack/react-table": "^8.17.3",
"@tanstack/react-virtual": "^3.1.2",
"@types/chroma-js": "^2.4.1",
"@types/json-schema": "^7.0.11",
"@types/plotly.js": "^2.12.11",
"@types/react": "link:../tslib/react/node_modules/@types/react",
"@types/react-dom": "^18.0.10",
"@types/react": "18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-syntax-highlighter": "^15.5.5",
"@types/signals": "^1.0.2",
"axios": "^1.7.4",
"css-loader": "^6.8.1",
"elkjs": "^0.9.1",
"mkdirp": "^1.0.3",
"ngl": "^2.1.1",
"notistack": "^3.0.1",
"npm-run-all": "^4.1.5",
"papaparse": "^5.4.1",
"plotly.js-dist-min": "^2.28.0",
"prettier": "^2.8.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^9.0.1",
"react-router-dom": "^6.21.3",
"react-syntax-highlighter": "^15.5.0",
"reactflow": "^11.10.3",
"recoil": "^0.7.7",
"rehype-mathjax": "^6.0.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"rimraf": "^4.4.1",
"source-map-loader": "^1.0.2",
"style-loader": "^3.3.3",
"typescript": "~5.0.2",
"three": "^0.160.1",
"typescript": "~5.1.6",
"usehooks-ts": "^3.0.2",
"wavesurfer.js": "^7.7.0",
"yjs": "^13.5.0"
},
"resolutions": {
"@types/react": "18.3.3"
},
"sideEffects": [
"style/*.css",
"style/index.js"
Expand Down
Loading

0 comments on commit 0f398cf

Please sign in to comment.