Skip to content

Course/apcomp297r#9

Open
kgray-hu wants to merge 23 commits intomainfrom
course/apcomp297R
Open

Course/apcomp297r#9
kgray-hu wants to merge 23 commits intomainfrom
course/apcomp297R

Conversation

@kgray-hu
Copy link
Copy Markdown
Contributor

@kgray-hu kgray-hu commented Feb 3, 2026

Overview

The purpose of this PR is to create 2 IPython Jupyterlab based course enviornments for APCOMP297r, a capstone course in order to provide an interactive python cpu environment and GPU environment, this leverages the GPU/CPU setup for cs1090b.

Changes

  • Added local/apcomp297r-cpu.yml.erb for CPU
  • Added local/apcomp297r-gpu.yml.erb for GPU
  • Both reference cs1090b-cpu and cs1090b-gpu mamba environments (reused from CS 1090b)

Notes

Key differences between APCOMP 297R GPU differs from CS 1090b GPU:

  • Canvas ID, environment mode (hard-coded global vs. widget), core count (8 staging vs. 12 prod)
diff: apcomp297r-gpu.yml.erb vs. cs1090b-gpu.yml.erb
--- a/local/cs1090b-gpu.yml.erb
+++ b/local/apcomp297r-gpu.yml.erb
@@ -20,7 +20,7 @@
   # Cannot have multiple enabled groups if a spack installation in the course 
   # shared folder is in use. This is because the course installation uses the 
   # course shared folder, which is not accessible to users outside of that 
   # course.
-  "163602"
+  "162018" #APCOMP 297R
 ]
 
 def arrays_have_common_element(array1, array2)
@@ -44,14 +44,14 @@
 # a non-existant cluster.
 cluster: "<%= cluster %>"
 
-title: "Jupyter Lab - CS 1090B(GPU)"
+title: "Jupyter Lab - APCOMP 297R (GPU)"
 description: |
-  This app is configured for GPU access for CS 1090B.
+  This app is configured for GPU access for APCOMP 297R.
 
 cacheable: false
 
 attributes:
-  course: "163602"
+  course: "162018"
   spack: "mamba-gpu"
   mamba: "cs1090b-gpu"
   bc_queue: "gpu"
@@ -60,18 +60,7 @@
   # In this case, this form option toggles between using the global Spack 
   # installation and a spack installation in the course shared folder. If the 
   # course has no intention of managing their own Spack environments, this can 
   # be hard-coded to "global".
-  environment:
-    widget: "radio_button"
-    value: "course"
-    help: |
-      Choose the environment used to launch Jupyter Lab. The "Course"
-      environment is managed by the teaching staff and has the latest
-      dependencies, while the "Global" environment is managed at the system
-      level and provides the initial set of dependencies. Each session will have 1 GPU allocated, 12 CPU cores and 48GB of memory.
-    options:
-      - ["Course (course managed)", "course"]
-      - ["Global (system managed)", "global"]
+  environment: "global"
 
   # How many CPU cores to include in the slurm job submission
-  custom_num_cores: 12
+  custom_num_cores: 8  # For Stage Testing: 8, For Production: 12
   # How many GPU GRES resources to include in the job submission.
   custom_num_gpus: 1

References

APCOMP 297r Course Setup Outline

@kgray-hu kgray-hu changed the title Course/apcomp297 r Course/apcomp297r Mar 9, 2026
@kgray-hu kgray-hu marked this pull request as ready for review March 9, 2026 16:56
Copy link
Copy Markdown
Contributor

@jaguillette jaguillette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see reusing the existing environment for CS 1090b works well for this. I was able to validate in prod from a development app that the CPU app has the regular packages available, and that the GPU app has those packages and appropriate access to a GPU. Thanks!

Copy link
Copy Markdown
Member

@arthurian arthurian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

spack: "mamba"

# mamba environment to activate from inside the Spack environment
mamba: "cs1090b-cpu" # Assuming this mamba environment is built and already created in the spack mamba environment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea to reuse the cs1090b environments.

spack: "mamba-gpu"

# mamba environment to activate from inside the Spack environment
mamba: "cs1090b-gpu"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to successfully launch the Jupyter Lab - APCOMP 297R (GPU) app in my sandbox apps from this branch and confirmed I was able to load tensorflow and see a GPU.

import tensorflow as tf
gpus = tf.config.list_physical_devices('GPU')
print(f"Detected GPUs: {gpus}")

Output:

Detected GPUs: [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants