Skip to content

Commit

Permalink
feat: bump to madwizard 1.0.0
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this version of madwizard updates the profile keys in a way that renders prior profiles invalid.

BREAKING CHANGE: this version of madwizared necessitates guidebook to use import rather than inlining for sub-guidebooks that offer the user a choice. this is done so that each choice can be easily scoped based on the filepath of that guidebook within the store hierarchy.
  • Loading branch information
starpit committed Sep 26, 2022
1 parent a424db4 commit 9a566c8
Show file tree
Hide file tree
Showing 19 changed files with 471 additions and 475 deletions.
2 changes: 1 addition & 1 deletion bin/codeflare
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ trap 'pkill -P $$; exit 1;' TERM INT

# otherwise, we launch the UI version
export CODEFLARE_HEADLESS=$HEADLESS
"$NODE" "$HEADLESS"/codeflare.min.js -- codeflare $EXTRAPREFIX "$@"
"$NODE" "$HEADLESS"/codeflare.min.js -- ${CMD-codeflare} $EXTRAPREFIX "$@"
629 changes: 324 additions & 305 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@
}
},
"devDependencies": {
"@kui-shell/builder": "12.1.0",
"@kui-shell/proxy": "12.1.0",
"@kui-shell/react": "12.1.0",
"@kui-shell/webpack": "12.1.0",
"@kui-shell/builder": "12.1.0-dev-20220926-124940",
"@kui-shell/proxy": "12.1.0-dev-20220926-124940",
"@kui-shell/react": "12.1.0-dev-20220926-124940",
"@kui-shell/webpack": "12.1.0-dev-20220926-124940",
"@playwright/test": "^1.25.2",
"@types/debug": "^4.1.7",
"@types/needle": "^2.5.3",
Expand All @@ -148,7 +148,7 @@
"@typescript-eslint/parser": "^5.37.0",
"concurrently": "7.4.0",
"cross-env": "^7.0.3",
"electron": "20.1.3",
"electron": "20.2.0",
"eslint": "^8.23.1",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
Expand All @@ -159,16 +159,16 @@
},
"dependencies": {
"@kui-shell/client": "file:./plugins/plugin-client-default",
"@kui-shell/core": "12.1.0",
"@kui-shell/plugin-bash-like": "12.1.0",
"@kui-shell/plugin-client-common": "12.1.0",
"@kui-shell/core": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-bash-like": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-client-common": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-codeflare": "file:./plugins/plugin-codeflare",
"@kui-shell/plugin-core-support": "12.1.0",
"@kui-shell/plugin-electron-components": "12.1.0",
"@kui-shell/plugin-kubectl": "12.1.0",
"@kui-shell/plugin-core-support": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-electron-components": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-kubectl": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-madwizard": "file:./plugins/plugin-madwizard",
"@kui-shell/plugin-patternfly4-themes": "12.1.0",
"@kui-shell/plugin-proxy-support": "12.1.0",
"@kui-shell/plugin-s3": "12.1.0"
"@kui-shell/plugin-patternfly4-themes": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-proxy-support": "12.1.0-dev-20220926-124940",
"@kui-shell/plugin-s3": "12.1.0-dev-20220926-124940"
}
}
11 changes: 7 additions & 4 deletions plugins/plugin-codeflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
},
"dependencies": {
"@logdna/tail-file": "^3.0.0",
"@patternfly/react-charts": "^6.84.8",
"@patternfly/react-core": "^4.231.8",
"allotment": "^1.16.0",
"@patternfly/react-charts": "^6.92.0",
"@patternfly/react-core": "^4.239.0",
"allotment": "^1.17.0",
"asciinema-player": "^3.0.1",
"chokidar": "^3.5.3",
"needle": "^3.1.0",
Expand All @@ -36,6 +36,9 @@
"split2": "^4.1.0",
"strip-ansi": "6.0.0",
"tmp": "^0.2.1",
"xterm-addon-search": "^0.9.0"
"xterm": "^5.0.0",
"xterm-addon-fit": "^0.6.0",
"xterm-addon-search": "^0.10.0",
"xterm-addon-webgl": "^0.13.0"
}
}
18 changes: 12 additions & 6 deletions plugins/plugin-codeflare/src/components/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import React from "react"
import { Events } from "@kui-shell/core"
import { ITheme, Terminal } from "xterm"
import { FitAddon } from "xterm-addon-fit"
import { WebglAddon } from "xterm-addon-webgl"
import { SearchAddon, ISearchOptions } from "xterm-addon-search"
import { Toolbar, ToolbarContent, ToolbarItem, SearchInput } from "@patternfly/react-core"

Expand Down Expand Up @@ -76,6 +77,7 @@ export default class XTerm extends React.PureComponent<Props, State> {
private terminal: Terminal = new Terminal({
convertEol: true,
scrollback: 5000,
allowProposedApi: true,
})

private searchAddon = new SearchAddon()
Expand Down Expand Up @@ -172,6 +174,10 @@ export default class XTerm extends React.PureComponent<Props, State> {

this.terminal.open(xtermContainer)

const webgl = new WebglAddon()
webgl.onContextLoss(() => webgl.dispose())
this.terminal.loadAddon(webgl)

const doResize = () => {
try {
fitAddon.fit()
Expand Down Expand Up @@ -222,7 +228,7 @@ export default class XTerm extends React.PureComponent<Props, State> {
foreground: val("text-01"),
background: val("sidecar-background-02"),
cursor: val("support-01"),
selection: this.alpha(val("selection-background"), 0.3),
selectionBackground: this.alpha(val("selection-background"), 0.3),

black: val("black"),
red: val("red"),
Expand All @@ -244,19 +250,19 @@ export default class XTerm extends React.PureComponent<Props, State> {
}

// debug('itheme for xterm', itheme)
xterm.setOption("theme", itheme)
xterm.setOption("fontFamily", val("monospace", "font"))
xterm.options.theme = itheme
xterm.options.fontFamily = val("monospace", "font")

try {
const standIn = document.querySelector("body .repl")
if (standIn) {
const fontTheme = getComputedStyle(standIn)
xterm.setOption("fontSize", parseInt(fontTheme.fontSize.replace(/px$/, ""), 10))
xterm.options.fontSize = parseInt(fontTheme.fontSize.replace(/px$/, ""), 10)
// terminal.setOption('lineHeight', )//parseInt(fontTheme.lineHeight.replace(/px$/, ''), 10))

// FIXME. not tied to theme
xterm.setOption("fontWeight", 400)
xterm.setOption("fontWeightBold", 600)
xterm.options.fontWeight = 400
xterm.options.fontWeightBold = 600
}
} catch (err) {
console.error("Error setting terminal font size", err)
Expand Down
4 changes: 2 additions & 2 deletions plugins/plugin-madwizard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"access": "public"
},
"dependencies": {
"madwizard": "^0.23.1",
"@guidebooks/store": "^0.12.6"
"madwizard": "^1.0.3",
"@guidebooks/store": "^0.14.0"
}
}
24 changes: 11 additions & 13 deletions tests/kind/profiles/gpu1/keep-it-simple
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
{
"name": "keep-it-simple",
"creationTime": 1660657756574,
"lastModifiedTime": 1660658307175,
"lastUsedTime": 1660742079201,
"lastModifiedTime": 1664204582770,
"lastUsedTime": 1664204346367,
"choices": {
"madwizard/apriori/use-gpu": "don't use gpus",
"madwizard/apriori/arch": "x64",
"madwizard/apriori/platform": "darwin",
"madwizard/apriori/mac-installer": "Homebrew",
"madwizard/apriori/in-terminal": "HTML",
"Start a new Run####Connect Dashboard to an existing Run####Boot up a Cloud Computer####Shut down a Cloud Computer": "Start a new Run",
"Run with CodeFlare Model Architecture####Bring Your Own Code####Demos": "Bring Your Own Code",
"Location of your working directory": "{\"Location of your working directory\":\"tests/kind/inputs/ray-tune-tutorial\"}",
"Provide custom base image, if any": "{\"Provide custom base image, if any\":\"rayproject/ray-ml:1.13.1-py37-gpu\"}",
"AWS####IBM####My data is not stored in S3": "My data is not stored in S3",
"Run Locally####Run on a Kubernetes Cluster": "Run on a Kubernetes Cluster",
"My Cluster is Running Locally####My Cluster is Running on Kubernetes": "My Cluster is Running on Kubernetes",
"expand((kubectl config get-contexts -o name | grep -E . >& /dev/null && kubectl config get-contexts -o name) || (kubectl version | grep Server >& /dev/null && echo \"${KUBE_CONTEXT_FOR_TEST-In-cluster}\" || exit 1), Kubernetes contexts)": "kind-codeflare-test",
"expand([ -z ${KUBE_CONTEXT} ] && exit 1 || X=$([ -n \"$KUBE_NS_FOR_TEST\" ] && echo $KUBE_NS_FOR_TEST || kubectl get ${KUBE_CONTEXT_ARG} ns -o name || oc ${KUBE_CONTEXT_ARG} get projects -o name); echo \"$X\" | sed -E 's#(namespace|project.project.openshift.io)/##' | grep -Ev 'openshift|kube-', Kubernetes namespaces)####Create a namespace": "default",
"Number of CPUs####Number of GPUs####Minimum Workers####Maximum Workers####Worker Memory####Head Memory": "{\"Number of CPUs\":\"1\",\"Number of GPUs\":\"1\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"5Gi\",\"Head Memory\":\"1.5Gi\"}",
"Keep It Simple####Use the Ray Autoscaler####Use the Multi-user Enhanced Kubernetes Scheduler": "Keep It Simple"
"ml/codeflare": "Start a new Run",
"ml/codeflare/run": "Bring Your Own Code",
"ml/codeflare/training/byoc/working-directory": "{\"Location of your working directory\":\"tests/kind/inputs/ray-tune-tutorial\"}",
"ml/codeflare/training/byoc/base-ray-image": "{\"Provide custom base image, if any\":\"rayproject/ray-ml:1.13.1-py37-gpu\"}",
"s3/choose/instance-maybe": "My data is not stored in S3",
"ml/ray/start/resources": "{\"Number of CPUs\":\"1\",\"Number of GPUs\":\"1\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"5Gi\",\"Head Memory\":\"1.5Gi\"}",
"kubernetes/context": "kind-codeflare-test",
"kubernetes/choose/ns-with-context": "default",
"ml/ray/cluster/kubernetes/choose-pod-scheduler": "Keep It Simple"
}
}
27 changes: 12 additions & 15 deletions tests/kind/profiles/non-gpu1/keep-it-simple
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
{
"name": "keep-it-simple",
"creationTime": 1660657756574,
"lastModifiedTime": 1660658307175,
"lastUsedTime": 1661620649166,
"creationTime": 1664149787016,
"lastModifiedTime": 1664149821230,
"lastUsedTime": 1664149787016,
"choices": {
"madwizard/apriori/use-gpu": "don't use gpus",
"madwizard/apriori/arch": "x64",
"madwizard/apriori/platform": "darwin",
"madwizard/apriori/mac-installer": "Homebrew",
"madwizard/apriori/in-terminal": "HTML",
"Start a new Run####Connect Dashboard to an existing Run####Boot up a Cloud Computer####Shut down a Cloud Computer": "Start a new Run",
"Run with CodeFlare Model Architecture####Bring Your Own Code####Demos": "Bring Your Own Code",
"BERT####MLFlow Demo####Tensorboard Demo": "MLFlow Demo",
"Location of your working directory": "{\"Location of your working directory\":\"tests/kind/inputs/qiskit\"}",
"Provide custom base image, if any": "{\"Provide custom base image, if any\":\"rayproject/ray:1.13.1-py37\"}",
"AWS####IBM####My data is not stored in S3": "My data is not stored in S3",
"Run Locally####Run on a Kubernetes Cluster": "Run on a Kubernetes Cluster",
"My Cluster is Running Locally####My Cluster is Running on Kubernetes": "My Cluster is Running on Kubernetes",
"expand((kubectl config get-contexts -o name | grep -E . >& /dev/null && kubectl config get-contexts -o name) || (kubectl version | grep Server >& /dev/null && echo \"${KUBE_CONTEXT_FOR_TEST-In-cluster}\" || exit 1), Kubernetes contexts)": "kind-codeflare-test",
"expand([ -z ${KUBE_CONTEXT} ] && exit 1 || X=$([ -n \"$KUBE_NS_FOR_TEST\" ] && echo $KUBE_NS_FOR_TEST || kubectl get ${KUBE_CONTEXT_ARG} ns -o name || oc ${KUBE_CONTEXT_ARG} get projects -o name); echo \"$X\" | sed -E 's#(namespace|project.project.openshift.io)/##' | grep -Ev 'openshift|kube-', Kubernetes namespaces)####Create a namespace": "default",
"Number of CPUs####Number of GPUs####Minimum Workers####Maximum Workers####Worker Memory####Head Memory": "{\"Number of CPUs\":\"500m\",\"Number of GPUs\":\"0\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"2Gi\",\"Head Memory\":\"2Gi\"}",
"Keep It Simple####Use the Ray Autoscaler####Use the Multi-user Enhanced Kubernetes Scheduler": "Keep It Simple"
"ml/codeflare": "Start a new Run",
"ml/codeflare/run": "Bring Your Own Code",
"ml/codeflare/training/byoc/working-directory": "{\"Location of your working directory\":\"tests/kind/inputs/qiskit\"}",
"ml/codeflare/training/byoc/base-ray-image": "{\"Provide custom base image, if any\":\"rayproject/ray:1.13.1-py37\"}",
"s3/choose/instance-maybe": "My data is not stored in S3",
"ml/ray/start/resources": "{\"Number of CPUs\":\"500m\",\"Number of GPUs\":\"0\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"2Gi\",\"Head Memory\":\"2Gi\"}",
"kubernetes/context": "kind-codeflare-test",
"kubernetes/choose/ns-with-context": "default",
"ml/ray/cluster/kubernetes/choose-pod-scheduler": "Keep It Simple"
}
}
29 changes: 13 additions & 16 deletions tests/kind/profiles/non-gpu1/mcad-coscheduler
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
{
"name": "mcad-coscheduler",
"name": "zzz",
"creationTime": 1660657756574,
"lastModifiedTime": 1660747919298,
"lastUsedTime": 1660755725660,
"lastModifiedTime": 1664150418757,
"lastUsedTime": 1664150668384,
"choices": {
"madwizard/apriori/use-gpu": "don't use gpus",
"madwizard/apriori/arch": "x64",
"madwizard/apriori/platform": "darwin",
"madwizard/apriori/mac-installer": "Homebrew",
"madwizard/apriori/in-terminal": "HTML",
"Start a new Run####Connect Dashboard to an existing Run####Boot up a Cloud Computer####Shut down a Cloud Computer": "Start a new Run",
"Run with CodeFlare Model Architecture####Bring Your Own Code####Demos": "Bring Your Own Code",
"BERT####MLFlow Demo####Tensorboard Demo": "MLFlow Demo",
"Location of your working directory": "{\"Location of your working directory\":\"tests/kind/inputs/qiskit\"}",
"Provide custom base image, if any": "{\"Provide custom base image, if any\":\"rayproject/ray:1.13.1-py37\"}",
"AWS####IBM####My data is not stored in S3": "My data is not stored in S3",
"Run Locally####Run on a Kubernetes Cluster": "Run on a Kubernetes Cluster",
"My Cluster is Running Locally####My Cluster is Running on Kubernetes": "My Cluster is Running on Kubernetes",
"expand((kubectl config get-contexts -o name | grep -E . >& /dev/null && kubectl config get-contexts -o name) || (kubectl version | grep Server >& /dev/null && echo \"${KUBE_CONTEXT_FOR_TEST-In-cluster}\" || exit 1), Kubernetes contexts)": "kind-codeflare-test",
"expand([ -z ${KUBE_CONTEXT} ] && exit 1 || X=$([ -n \"$KUBE_NS_FOR_TEST\" ] && echo $KUBE_NS_FOR_TEST || kubectl get ${KUBE_CONTEXT_ARG} ns -o name || oc ${KUBE_CONTEXT_ARG} get projects -o name); echo \"$X\" | sed -E 's#(namespace|project.project.openshift.io)/##' | grep -Ev 'openshift|kube-', Kubernetes namespaces)####Create a namespace": "default",
"Number of CPUs####Number of GPUs####Minimum Workers####Maximum Workers####Worker Memory####Head Memory": "{\"Number of CPUs\":\"250m\",\"Number of GPUs\":\"0\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"2Gi\",\"Head Memory\":\"2Gi\"}",
"Keep It Simple####Use the Ray Autoscaler####Use the Multi-user Enhanced Kubernetes Scheduler": "Use the Multi-user Enhanced Kubernetes Scheduler",
"My administrator has already installed and configured MCAD####MCAD with the Advanced Coscheduler####MCAD with the Default Kubernetes Scheduler": "MCAD with the Advanced Coscheduler"
"ml/codeflare": "Start a new Run",
"ml/codeflare/run": "Bring Your Own Code",
"ml/codeflare/training/byoc/working-directory": "{\"Location of your working directory\":\"tests/kind/inputs/qiskit\"}",
"ml/codeflare/training/byoc/base-ray-image": "{\"Provide custom base image, if any\":\"rayproject/ray:1.13.1-py37\"}",
"s3/choose/instance-maybe": "My data is not stored in S3",
"ml/ray/start/resources": "{\"Number of CPUs\":\"200m\",\"Number of GPUs\":\"0\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"1750Mi\",\"Head Memory\":\"1750Mi\"}",
"kubernetes/context": "kind-codeflare-test",
"kubernetes/choose/ns-with-context": "default",
"ml/ray/cluster/kubernetes/choose-pod-scheduler": "Use the Multi-user Enhanced Kubernetes Scheduler",
"kubernetes/mcad/choose/scheduler": "MCAD with the Advanced Coscheduler"
}
}
27 changes: 12 additions & 15 deletions tests/kind/profiles/non-gpu1/mcad-default
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@
"name": "mcad-default",
"creationTime": 1660657756574,
"lastModifiedTime": 1660747919298,
"lastUsedTime": 1660753306596,
"lastUsedTime": 1664200310244,
"choices": {
"madwizard/apriori/use-gpu": "don't use gpus",
"madwizard/apriori/arch": "x64",
"madwizard/apriori/platform": "darwin",
"madwizard/apriori/mac-installer": "Homebrew",
"madwizard/apriori/in-terminal": "HTML",
"Start a new Run####Connect Dashboard to an existing Run####Boot up a Cloud Computer####Shut down a Cloud Computer": "Start a new Run",
"Run with CodeFlare Model Architecture####Bring Your Own Code####Demos": "Bring Your Own Code",
"BERT####MLFlow Demo####Tensorboard Demo": "MLFlow Demo",
"Location of your working directory": "{\"Location of your working directory\":\"tests/kind/inputs/qiskit\"}",
"Provide custom base image, if any": "{\"Provide custom base image, if any\":\"rayproject/ray:1.13.1-py37\"}",
"AWS####IBM####My data is not stored in S3": "My data is not stored in S3",
"Run Locally####Run on a Kubernetes Cluster": "Run on a Kubernetes Cluster",
"My Cluster is Running Locally####My Cluster is Running on Kubernetes": "My Cluster is Running on Kubernetes",
"expand((kubectl config get-contexts -o name | grep -E . >& /dev/null && kubectl config get-contexts -o name) || (kubectl version | grep Server >& /dev/null && echo \"${KUBE_CONTEXT_FOR_TEST-In-cluster}\" || exit 1), Kubernetes contexts)": "kind-codeflare-test",
"expand([ -z ${KUBE_CONTEXT} ] && exit 1 || X=$([ -n \"$KUBE_NS_FOR_TEST\" ] && echo $KUBE_NS_FOR_TEST || kubectl get ${KUBE_CONTEXT_ARG} ns -o name || oc ${KUBE_CONTEXT_ARG} get projects -o name); echo \"$X\" | sed -E 's#(namespace|project.project.openshift.io)/##' | grep -Ev 'openshift|kube-', Kubernetes namespaces)####Create a namespace": "default",
"Number of CPUs####Number of GPUs####Minimum Workers####Maximum Workers####Worker Memory####Head Memory": "{\"Number of CPUs\":\"250m\",\"Number of GPUs\":\"0\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"2Gi\",\"Head Memory\":\"2Gi\"}",
"Keep It Simple####Use the Ray Autoscaler####Use the Multi-user Enhanced Kubernetes Scheduler": "Use the Multi-user Enhanced Kubernetes Scheduler",
"My administrator has already installed and configured MCAD####MCAD with the Advanced Coscheduler####MCAD with the Default Kubernetes Scheduler": "MCAD with the Default Kubernetes Scheduler"
"ml/codeflare": "Start a new Run",
"ml/codeflare/run": "Bring Your Own Code",
"ml/codeflare/training/byoc/working-directory": "{\"Location of your working directory\":\"tests/kind/inputs/qiskit\"}",
"ml/codeflare/training/byoc/base-ray-image": "{\"Provide custom base image, if any\":\"rayproject/ray:1.13.1-py37\"}",
"s3/choose/instance-maybe": "My data is not stored in S3",
"ml/ray/start/resources": "{\"Number of CPUs\":\"200m\",\"Number of GPUs\":\"0\",\"Minimum Workers\":\"1\",\"Maximum Workers\":\"1\",\"Worker Memory\":\"1750Mi\",\"Head Memory\":\"1750Mi\"}",
"kubernetes/context": "kind-codeflare-test",
"kubernetes/choose/ns-with-context": "default",
"ml/ray/cluster/kubernetes/choose-pod-scheduler": "Use the Multi-user Enhanced Kubernetes Scheduler",
"kubernetes/mcad/choose/scheduler": "MCAD with the Default Kubernetes Scheduler"
}
}
}
Loading

0 comments on commit 9a566c8

Please sign in to comment.