From 93ba65c28873d0ff1da95382fc2b851296ff9b07 Mon Sep 17 00:00:00 2001
From: Matthew Defenderfer <mdefende@uab.edu>
Date: Thu, 6 Mar 2025 16:19:41 -0600
Subject: [PATCH] change to using installed PyCharm modules

---
 form.yml.erb           | 30 ++++++++++++++----------------
 template/script.sh.erb |  8 +-------
 2 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/form.yml.erb b/form.yml.erb
index b11912e..19bf685 100644
--- a/form.yml.erb
+++ b/form.yml.erb
@@ -14,17 +14,17 @@
 cluster: "SLURM_CLUSTER"
 
 # Title of the app displayed in the Dashboard
-title: "PyCharmCE Singularity"
+title: "PyCharmCE"
 
 # Description of the app displayed in the Dashboard (can use multi-line string
 # and Markdown syntax)
 description: |
-  This app will launch a JupyterLab server on one or more cores from a given Singularity container.
+  This app will launch the PyCharm IDE in a VNC window.
 
 # Define attribute values that aren't meant to be modified by the user within
 # the Dashboard form
 attributes:
-  # Set the corresponding modules that need to be loaded for Jupyter to run
+  # Set the corresponding modules that need to be loaded for PyCharm to run
   #
   # @note It is called within the batch job as `module load <modules>` if
   #   defined
@@ -42,17 +42,7 @@ attributes:
     value: |
       # load any other modules you may need here such as CUDA
       # DO NOT LOAD Anaconda3 or Singularity, these are already 
-      # taken care of
-
-  # User needs to set the path to the container
-  container_path:
-    widget: text_field
-    label: Path to Container File
-
-  # Any extra command line arguments to pass to `singularity exec ...`
-  extra_singularity_args:
-    widget: text_field
-    label: Extra Singularity arguments
+      # available.
 
   bc_num_hours:
     value: 1
@@ -88,6 +78,15 @@ attributes:
     <%- partitions.each do |p| -%>
       - [ "<%= p %>", "<%= p %>" ]
     <%- end -%>
+  
+  version:
+    widget: select
+    label: "PyCharm version"
+    help: "This defines the version of PyCharm you want to load."
+    options:
+      - [ "2022.3.2", "PyCharm/2022.3.2"]
+      - [ "2019.3.1", "PyCharm/2019.3.1"]
+
 
 # All of the attributes that make up the Dashboard form (in respective order),
 # and made available to the submit configuration file and the template ERB
@@ -100,8 +99,7 @@ attributes:
 #   Dashboard
 form:
   - custom_environment
-  - container_path
-  - extra_singularity_args
+  - version
   - bc_num_hours
   - bc_partition
   - bc_num_gpus
diff --git a/template/script.sh.erb b/template/script.sh.erb
index f645283..54854f5 100755
--- a/template/script.sh.erb
+++ b/template/script.sh.erb
@@ -24,8 +24,6 @@ cd "${HOME}"
 # Start Pycharm
 #
 
-# export SINGULARITY_BINDPATH='/data,/scratch,/local,/share'
-
 # Load Anaconda3
 module load Anaconda3
 
@@ -36,11 +34,7 @@ module list
 
 # Launch PyCharm
 set -x
-# singularity exec --env \"DISPLAY=$DISPLAY\" -B \"/tmp/.X11-unix:/tmp/.X11-unix\" \
-#     <%= context.extra_singularity_args %> \
-#     <%= context.container_path %> \
-#     pycharm
 
-module --ignore-cache load PyCharm/2022.3.2
+module load <%= context.version %>
 
 pycharm.sh
\ No newline at end of file
-- 
GitLab