From ccde9befff7245c1c5aa0850f43c56171e9ecfbd Mon Sep 17 00:00:00 2001
From: diedpigs <louistw@uab.edu>
Date: Fri, 9 Sep 2022 14:28:06 -0500
Subject: [PATCH] Add custom_env in form (#5)

---
 form.yml.erb           | 12 ++++++++++++
 template/script.sh.erb |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/form.yml.erb b/form.yml.erb
index 0ca53d1..8527d5d 100644
--- a/form.yml.erb
+++ b/form.yml.erb
@@ -1,6 +1,17 @@
 ---
 cluster: "SLURM_CLUSTER" 
 attributes:
+  custom_environment:
+    widget: text_area
+    label: Environment Setup
+    value: |
+      # If you would like to load other modules
+      # or add other things in your environment please list below
+      #
+      # format:
+      # module load example_module/VERSION example_module2
+      # export PATH=....
+
   bc_num_hours:
     value: 1
 
@@ -57,6 +68,7 @@ attributes:
   cuda_toolkit: "cuda10.0/toolkit"
 
 form:
+  - custom_environment
   - version
   - bc_num_hours
   - bc_partition
diff --git a/template/script.sh.erb b/template/script.sh.erb
index 8884fa8..961fdf6 100755
--- a/template/script.sh.erb
+++ b/template/script.sh.erb
@@ -30,6 +30,8 @@ module load <%= context.cuda_toolkit %>
 <%- end -%>
 # Load the required environment
 module load <%= context.version %>
+
+<%= context.custom_environment %>
 # Launch MATLAB
 module list
 set -x
-- 
GitLab