Skip to content

Commit

Permalink
changes to other hub interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Paulen committed Jan 19, 2025
1 parent adecdfb commit 8bc371b
Show file tree
Hide file tree
Showing 21 changed files with 1,393 additions and 267 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ npm run storybook
To build the project for production, use the following command:

```bash
npm run build
npm run build:{build_target}
```

## Creating ConfigMaps
Expand All @@ -73,7 +73,7 @@ You can also modify the script if you only want to generate files locally instea
Then execute the script:

```bash
./create_config_maps.sh
./create_config_maps.sh {build_target} or {namespace}
```


23 changes: 6 additions & 17 deletions c9088/js/FormPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,11 @@ const StepOne = ({ setFormData }) => {
title="Persistent Notebook Home"
infoText="Persistent home means that even when notebook is deleted, the data will persist and can be used again."
>
<DropDownButton
key={0}
isActive={true}
primary={false}
title="New"
>
<SliderCheckBox
title="Erase if home exists"
onChange={handleErase}
id="phCheckId"
></SliderCheckBox>
<div>
Mounted to
<code>/home/jovyan</code>
</div>
</DropDownButton>
<SliderCheckBox
title="Erase if home exists"
onChange={handleErase}
id="phCheckId"
> Take care of checking this button, it removes whole home directory and previous data will be lost. Use in case only when notebook is broken so it does not start, in other cases, remove data from terminal. </SliderCheckBox>
</FieldHeader>
</div>
);
Expand Down Expand Up @@ -139,7 +128,7 @@ const StepThree = ({ setFormData }) => {
setFormData={handleMemSelect}
title="Memory"
selectionText={"Select memory limit (in GB):"}
numberOptions={[4, 8, 16, 32, 64, 128, 256]}
numberOptions={[4, 8, 12, 16, 32, 64]}
></TileSelector>
</div>
);
Expand Down
247 changes: 247 additions & 0 deletions cas/custom-images/bioconductor_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 5 additions & 16 deletions cas/js/FormPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,11 @@ const StepOne = ({ setFormData }) => {
title="Persistent Notebook Home"
infoText="Persistent home means that even when notebook is deleted, the data will persist and can be used again."
>
<DropDownButton
key={0}
isActive={true}
primary={false}
title="New"
>
<SliderCheckBox
title="Erase if home exists"
onChange={handleErase}
id="phCheckId"
></SliderCheckBox>
<div>
Mounted to
<code>/home/jovyan</code>
</div>
</DropDownButton>
<SliderCheckBox
title="Erase if home exists"
onChange={handleErase}
id="phCheckId"
> Consider thoroughly checking this option - it removes whole home directory and all data located there (/home/jovyan/). Use only when notebook is broken so it does not start. In other cases, remove data from terminal inside the notebook. </SliderCheckBox>
</FieldHeader>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions cas/js/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function LoginPage({ buttonText, imagePath, link }) {
<div className="wrapper">
<div className="login">
{imagePath && <img src={imagePath} height={"100px"} />}
<p> It is necessary to be a valid member of bioconductor group to access the service. If you are not a member, you will be automatically presented an application upon login. The application will be reviewed by course professors or instructors. </p>
<Button title={buttonText} link={link}></Button>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions cas/js/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AnouncmentMessage from "../../src/components/AnouncmentMessage/Anouncment
import { createRoot } from "react-dom/client";
import "@fontsource/montserrat/600.css";
import "./index.css";
import bio_logo from "../custom-images/bioconductor_logo.svg"

const root = createRoot(document.getElementById("root"));
root.render(
Expand All @@ -19,6 +20,7 @@ root.render(
{/*</AnouncmentMessage>*/}
<LoginPage
buttonText="Sign in with MUNI"
imagePath={bio_logo}
link="/hub/oauth_login?next="
/>
</div>,
Expand Down
42 changes: 32 additions & 10 deletions create_config_maps.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,55 @@
#!/bin/bash

if [ "$#" -ne 1 ]; then
echo "Usage: $0 namespace_of_hub"
echo "Usage: $0 namespace_or_build_target"
echo "Example: $0 jupyterhub-dev-ns"
exit 1
fi

NAMESPACE=$1
INPUT=$1

npm install
npm run build
# Define default namespace and valid build targets
DEFAULT_NAMESPACE="jupyterhub-dev-ns"
VALID_BUILD_TARGETS=("cas" "c9088" "hub" "elter")

#NAMESPACE="jupyterhub-dev-ns"
BASE_DIR="./dist"
# Determine if the input is a namespace or build target
if [[ " ${VALID_BUILD_TARGETS[@]} " =~ " $INPUT " ]]; then
BUILD_TARGET=$INPUT
NAMESPACE=$DEFAULT_NAMESPACE
else
BUILD_TARGET="hub"
NAMESPACE=$INPUT
fi


BASE_DIR="./dist_$BUILD_TARGET"

# Run npm commands
if [ -n "$BUILD_TARGET" ]; then
echo "Running build for target: $BUILD_TARGET"
npm install
npm run build:$BUILD_TARGET
else
echo "Using namespace: $NAMESPACE"
npm install
npm run build
fi

# Create ConfigMaps
create_configmap() {
local name=$1
local path=$2

# don't delete configmaps from cluster automatically! if ns changes, it could lead to catastrophe
if [ "$NAMESPACE" = "jupyterhub-dev-ns" ]; then
# Don't delete ConfigMaps from the cluster automatically
if [ "$NAMESPACE" = "$DEFAULT_NAMESPACE" ]; then
kubectl delete configmap $name --namespace $NAMESPACE --ignore-not-found
kubectl create configmap $name --from-file=$path --namespace $NAMESPACE
else
# creating the ConfigMaps locally
# Creating the ConfigMaps locally
kubectl create configmap $name --from-file=$path --dry-run=client -o json > $name.json
kubectl patch --local -f $name.json --type=json -p='[{"op": "remove", "path": "/metadata/creationTimestamp"}]' -o yaml > $name.yaml
rm $name.json
fi

}

create_configmap "static-files" "$BASE_DIR"
Expand Down
30 changes: 15 additions & 15 deletions elter-ri/data/formData.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
export const images = {
simple: {
"cerit.io/hubs/minimalnb:31-08-2023": "Minimal NB",
"cerit.io/hubs/minimalnb:26-09-2024-ssh": "Minimal NB with SSH access",
"cerit.io/hubs/datasciencenb:31-08-2023": "DataScience NB",
"minimalnb:31-08-2023": "Minimal NB",
"minimalnb:26-09-2024-ssh": "Minimal NB with SSH access",
"datasciencenb:31-08-2023": "DataScience NB",
},
r: {
"cerit.io/hubs/jupyterhubronly:05-02-2024": "Python 3.11 and R 4.3.1 kernels",
"cerit.io/hubs/rstudio:11-08-2022-7": "RStudio with R 4.2.1",
"cerit.io/hubs/rstudio:4.2.1-rsat": "RStudio with R 4.2.1 and RSAT",
"cerit.io/hubs/rstudio:4.3.1": "RStudio with R 4.3.1",
"cerit.io/hubs/rstudio:4.4.0": "RStudio with R 4.4.0",
"jupyterhubronly:05-02-2024": "Python 3.11 and R 4.3.1 kernels",
"rstudio:11-08-2022-7": "RStudio with R 4.2.1",
"rstudio:4.2.1-rsat": "RStudio with R 4.2.1 and RSAT",
"rstudio:4.3.1": "RStudio with R 4.3.1",
"rstudio:4.4.0": "RStudio with R 4.4.0",
},
tf: {
"cerit.io/hubs/tensorflownb:31-08-2023": "TensorFlow 2.10 (CPU only)",
"cerit.io/hubs/tensorflowgpu:2.11.1": "TensorFlow 2.11.1 with GPU and TensorBoard",
"cerit.io/hubs/tensorflowgpu:2.12.1": "TensorFlow 2.12.1 with GPU and TensorBoard",
"cerit.io/hubs/tensorflowgpu:2.15.0": "TensorFlow 2.15.1 with GPU and TensorBoard",
"tensorflownb:31-08-2023": "TensorFlow 2.10 (CPU only)",
"tensorflowgpu:2.11.1": "TensorFlow 2.11.1 with GPU and TensorBoard",
"tensorflowgpu:2.12.1": "TensorFlow 2.12.1 with GPU and TensorBoard",
"tensorflowgpu:2.15.0": "TensorFlow 2.15.1 with GPU and TensorBoard",
},
matlab: {
"cerit.io/hubs/matlab:r2022b": "MATLAB R2022b",
"cerit.io/hubs/matlab:r2023a": "MATLAB R2023a",
"matlab:r2022b": "MATLAB R2022b",
"matlab:r2023a": "MATLAB R2023a",
},
various: {
"cerit.io/hubs/cuda-ubuntu:12.0-24.04": "CUDA 12.0",
"cuda-ubuntu:12.0-24.04": "CUDA 12.0",
},
};

Expand Down
Loading

0 comments on commit 8bc371b

Please sign in to comment.