Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rc/bc_uab_matlab
  • louistw/bc_uab_matlab
2 results
Show changes
Commits on Source (42)
variables:
# older versions of git have issues fetching.
GIT_STRATEGY: clone
OOD_PACKAGING_DEBUG: 'true'
OOD_PACKAGING_GPG_PRIVATE_KEY: /systems/osc_certs/gpg/ondemand/ondemand.sec
OOD_PACKAGING_GPG_PASSPHRASE: /systems/osc_certs/gpg/ondemand/.gpgpass
before_script:
- docker info
- '[ -d tmp ] || mkdir tmp'
- git clone https://github.com/OSC/ondemand-packaging.git tmp/ondemand-packaging
- cp /systems/osc_certs/gpg/ondemand/.gpgpass $CI_PROJECT_DIR/tmp/ondemand-packaging/
- cp /systems/osc_certs/gpg/ondemand/ondemand.sec $CI_PROJECT_DIR/tmp/ondemand-packaging/
- git clone --branch main https://github.com/OSC/ondemand-packaging.git tmp/ondemand-packaging
stages:
- build
- deploy
rpm-build:
stage: build
only:
- tags
rules:
- if: $CI_COMMIT_TAG
- if: '$CI_PIPELINE_SOURCE == "external_pull_request_event"'
script:
- ./tmp/ondemand-packaging/build.sh -w $CI_PROJECT_DIR/tmp/work -o $CI_PROJECT_DIR/tmp/output -V $CI_COMMIT_TAG -u -v $CI_PROJECT_DIR/packaging
- ./tmp/ondemand-packaging/bin/ood_packaging -w $CI_PROJECT_DIR/tmp/work -o $CI_PROJECT_DIR/tmp/output -V $CI_COMMIT_TAG -T $CI_PROJECT_DIR
parallel:
matrix:
- OOD_PACKAGING_DIST: [el7, el8]
artifacts:
paths:
- tmp/output
name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
rpm-deploy-ci:
stage: deploy
only:
- tags
script:
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c ci ./tmp/output/*
rpm-deploy:
stage: deploy
only:
- tags
except:
variables:
- $CI_COMMIT_TAG =~ /.*_.*/
rules:
- if: $CI_COMMIT_TAG
script:
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c main ./tmp/output/*
......@@ -5,6 +5,27 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.11.0] - 2022-04-04
### Added
- Adds a new Matlab default version of 2022a
## [0.10.0] - 2021-12-10
### Added
- [15](https://github.com/OSC/bc_osc_matlab/pull/15)
- Enabled the Pitzer Cluster in Matlab along with the related selection configurations.
- Migrated all select functionality to the new Dynamic JS select functionality.
## [0.9.0] - 2021-01-20
### Added
- [13](https://github.com/OSC/bc_osc_matlab/pull/13)
- removed owens-slurm and torque related configurations
- changed account to be a select widget with only valid groups as options
## [0.8.0] - 2020-11-18
### Added
- Added owens-slurm cluster to being migrating Owens to Slurm in
[11](https://github.com/OSC/bc_osc_matlab/pull/11)
## [0.7.0] - 2019-12-10
### Added
- Adds a new Matlab default version of 2019b
......@@ -71,8 +92,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Initial release!
[Unreleased]: https://github.com/OSC/bc_osc_matlab/compare/v0.7.0...HEAD
[0.6.1]: https://github.com/OSC/bc_osc_matlab/compare/v0.6.1...v0.7.0
[Unreleased]:
https://github.com/OSC/bc_osc_matlab/compare/v0.11.0...HEAD
[0.11.0]: https://github.com/OSC/bc_osc_matlab/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/OSC/bc_osc_matlab/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/OSC/bc_osc_matlab/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/OSC/bc_osc_matlab/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/OSC/bc_osc_matlab/compare/v0.6.1...v0.7.0
[0.6.1]: https://github.com/OSC/bc_osc_matlab/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/OSC/bc_osc_matlab/compare/v0.5.1...v0.6.0
[0.5.1]: https://github.com/OSC/bc_osc_matlab/compare/v0.5.0...v0.5.1
......
'use strict'
/**
* Fix num cores, allowing blanks to remain
*/
function fix_num_cores() {
let node_type_input = $('#batch_connect_session_context_node_type');
let node_type = node_type_input.val();
let num_cores_input = $('#num_cores');
const table = {
"interactive": { "max_cpu": 48, "max_hour": 2, "max_gpu": 0 },
"express": { "max_cpu": 48, "max_hour": 2, "max_gpu": 0 },
"short": { "max_cpu": 48, "max_hour": 12, "max_gpu": 0 },
"pascalnodes": { "max_cpu": 28, "max_hour": 12, "max_gpu": 4 },
"pascalnodes-medium": { "max_cpu": 28, "max_hour": 48, "max_gpu": 4 },
"medium": { "max_cpu": 48, "max_hour": 50, "max_gpu": 0 },
"long": { "max_cpu": 48, "max_hour": 150, "max_gpu": 0 },
"intel-dcb": { "max_cpu": 24, "max_hour": 150, "max_gpu": 0 },
"amd-hdr100": { "max_cpu": 128, "max_hour": 150, "max_gpu": 0 },
"largemem": { "max_cpu": 24, "max_hour": 50, "max_gpu": 0 },
"largemem-long": { "max_cpu": 24, "max_hour": 150, "max_gpu": 0 },
"amperenodes": { "max_cpu": 128, "max_hour": 12, "max_gpu": 2 },
"amperenodes-medium": { "max_cpu": 128, "max_hour": 48, "max_gpu": 2 },
}
if(num_cores_input.val() === '') {
return;
}
const gpu_part_regex = /pascal|ampere/;
if(node_type === 'hugemem') {
set_ppn_owens_hugemem(num_cores_input);
} else {
set_ppn_owens_regular(num_cores_input);
}
function set_max_value(form_id, value) {
const form_element = $(form_id);
form_element.attr({'max': value});
if (form_element.val() > value)
form_element.val(value)
}
/**
* Sets the PPN limits available for Owens hugemem nodes.
*
* hugemem reservations are always assigned the full node
*
* @param {element} num_cores_input The input for num_cores
*/
function set_ppn_owens_hugemem(num_cores_input) {
const NUM_CORES = 48;
num_cores_input.attr('max', NUM_CORES);
num_cores_input.attr('min', NUM_CORES);
num_cores_input.val(NUM_CORES);
function set_partition_change_handler() {
let partition_select = $("#batch_connect_session_context_bc_partition");
partition_select.change( function(e) {
toggle_gpu_visibility(e);
});
}
/**
* Sets the PPN limits available for non hugemem Owens nodes.
*
* @param {element} num_cores_input The input for num_cores
*/
function set_ppn_owens_regular(num_cores_input) {
const NUM_CORES = 28;
num_cores_input.attr('max', NUM_CORES);
num_cores_input.attr('min', 1);
num_cores_input.val(Math.min(NUM_CORES, num_cores_input.val()));
function toggle_gpu_visibility(event) {
const partition = event.target.value;
const cpu_selector = '#batch_connect_session_context_bc_num_slots';
const gpu_selector = '#batch_connect_session_context_bc_num_gpus';
const hour_selector = '#batch_connect_session_context_bc_num_hours';
toggle_visibilty_of_form_group(gpu_selector, gpu_part_regex.test(partition));
set_max_value(cpu_selector, table[partition]["max_cpu"]);
set_max_value(gpu_selector, table[partition]["max_gpu"]);
set_max_value(hour_selector, table[partition]["max_hour"]);
}
function toggle_visibilty_of_form_group(form_id, show) {
let form_element = $(form_id);
let parent = form_element;
/**
* Change the maximum number of cores selected.
*/
function set_node_type_change_handler() {
let node_type_input = $('#batch_connect_session_context_node_type');
node_type_input.change(node_type_input, fix_num_cores);
while (
(! parent[0].classList.contains('form-group')) &&
(! parent.is('html')) // ensure that we don't loop infinitely
) {
parent = parent.parent();
}
// If parent is HTML then something has gone wrong and visibility should not be changed
if ( parent.is('html') ) {
return;
}
if(show) {
parent.show();
} else {
parent.hide();
}
}
$(document).ready(function() {
// Set the max value to be what was set in the last session
fix_num_cores();
set_node_type_change_handler();
});
\ No newline at end of file
toggle_gpu_visibility(
// Fake the event
{ target: document.querySelector('#batch_connect_session_context_bc_partition') }
);
set_partition_change_handler();
---
cluster:
- "owens"
- "owens-slurm"
form:
- version
- bc_account
- bc_num_hours
- bc_num_slots
- num_cores
- node_type
- bc_vnc_resolution
- bc_email_on_started
attributes:
num_cores:
widget: "number_field"
label: "Number of cores"
value: 1
help: |
Number of cores on node type (4 GB per core unless requesting whole
node). Leave blank if requesting full node.
min: 0
max: 48
step: 1
id: 'num_cores'
bc_num_slots: "1"
bc_vnc_resolution:
required: true
bc_account:
label: "Project"
help: "You can leave this blank if **not** in multiple projects."
node_type:
widget: select
label: "Node type"
help: |
- **any** - (*1-28 cores*) Use any available Owens node. This reduces the
wait time as there are no node requirements.
- **hugemem** - (*48 cores*) Use an Owens node that has 1.5TB of
available RAM as well as 48 cores. There are 16 of these nodes on
Owens. Requesting hugemem nodes allocates entire nodes.
- **vis** - (*1-28 cores*) Use an Owens node that has an [NVIDIA Tesla P100
GPU](http://www.nvidia.com/object/tesla-p100.html) with an X server
running in the background. This utilizes the GPU for hardware
accelerated 3D visualization. There are 160 of these nodes on Owens.
options:
- "any"
- "hugemem"
- "vis"
version:
widget: select
label: "MATLAB version"
help: "This defines the version of MATLAB you want to load."
options:
- [ "R2019b", "matlab/r2019b" ]
- [ "R2018b", "matlab/r2018b" ]
- [ "R2018a", "matlab/r2018a" ]
- [ "R2017a", "matlab/r2017a" ]
- [ "R2016b", "matlab/r2016b" ]
- [ "R2015b", "matlab/r2015b" ]
<%-
partitions = OodAppkit.clusters[:SLURM_CLUSTER].custom_config[:partitions]
-%>
---
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
bc_num_slots:
widget: "number_field"
label: Number of CPU
value: 1
min: 1
max: 24
step: 1
bc_num_mems:
widget: "number_field"
label: Memory per CPU (GB)
value: 4
min: 1
max: 128
step: 1
bc_num_gpus:
widget: "number_field"
label: Number of GPUs
value: 1
min: 0
max: 4
step: 1
bc_partition:
widget: select
label: Partition
options:
<%- partitions.each do |p| -%>
- [ "<%= p %>", "<%= p %>" ]
<%- end -%>
version:
widget: select
label: "MATLAB version"
help: "This defines the version of MATLAB you want to load."
options:
- [ "R2023a", "rc/matlab/R2023a"]
- [ "R2022a", "rc/matlab/R2022a"]
- [ "R2021b", "rc/matlab/R2021b"]
- [ "R2021a", "rc/matlab/R2021a"]
- [ "R2020a", "rc/matlab/R2020a"]
- [ "R2019b", "rc/matlab/R2019b"]
- [ "R2019a", "rc/matlab/R2019a"]
- [ "R2018a", "rc/matlab/R2018a"]
- [ "R2017b", "rc/matlab/R2017b"]
- [ "R2017a", "rc/matlab/R2017a"]
- [ "R2016b", "rc/matlab/R2016b"]
- [ "R2016a", "rc/matlab/R2016a"]
- [ "R2015a", "rc/matlab/R2015a"]
- [ "R2013a", "rc/matlab/R2013a"]
- [ "R2012a", "rc/matlab/R2012a"]
cuda_toolkit: "cuda10.0/toolkit"
form:
- custom_environment
- version
- bc_num_hours
- bc_partition
- bc_num_gpus
- bc_num_slots
- bc_num_mems
- bc_email_on_started
- cuda_toolkit
......@@ -4,8 +4,8 @@ category: Interactive Apps
subcategory: GUIs
role: batch_connect
description: |
This app will launch a [MATLAB] GUI on the [Owens cluster]. You will be able
This app will launch a [MATLAB] GUI on the [Cheaha cluster]. You will be able
to interact with the MATLAB GUI through a VNC session.
[MATLAB]: https://www.mathworks.com/products/matlab.html
[Owens cluster]: https://www.osc.edu/resources/technical_support/supercomputers/owens
[Cheaha cluster]: https://uabrc.github.io
......@@ -34,14 +34,9 @@ DESCRIPTION
%install
export PASSENGER_APP_ENV=production
export PASSENGER_BASE_URI=/pun/sys/%{app_name}
mkdir -p %{buildroot}%{_localstatedir}/www/ood/apps/sys/%{app_name}
if [ -x bin/setup ]; then
bin/setup
fi
cp -a ./. %{buildroot}%{_localstatedir}/www/ood/apps/sys/%{app_name}/
echo v%{version} > %{buildroot}%{_localstatedir}/www/ood/apps/sys/%{app_name}/VERSION
%files
%defattr(-,root,root)
......
#!/usr/bin/env bash
# Set working directory to home directory
cd "${HOME}"
#
# Launch Xfce Window Manager and Panel
#
(
export SEND_256_COLORS_TO_REMOTE=1
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"
export XDG_CACHE_HOME="$(mktemp -d)"
module reset
set -x
xfwm4 --compositor=off --daemon --sm-client-disable
xsetroot -solid "#D3D3D3"
xfsettingsd --sm-client-disable
xfce4-panel --sm-client-disable
) &
#
# Start MATLAB
#
<%- if context.bc_partition == "pascalnodes" -%>
# Load CUDA toolkit
module load <%= context.cuda_toolkit %>
<%- end -%>
# Load the required environment
module load <%= context.version %>
# Launch MATLAB
module list
set -x
matlab -desktop
<%-
ppn = num_cores.blank? ? 28 : num_cores.to_i
nodes = bc_num_slots.blank? ? 1 : bc_num_slots.to_i
torque_cluster = OodAppkit.clusters[cluster].job_config[:adapter] == 'torque'
case node_type
when "hugemem"
ppn = 48
partition = bc_num_slots.to_i > 1 ? "hugemem-parallel" : "hugemem"
slurm_args = [ "--nodes", "#{nodes}", "--ntasks-per-node", "#{ppn}", "--partition", partition ]
torque_args = "#{nodes}:ppn=#{ppn}:#{node_type}"
when "vis"
slurm_args = ["--nodes", "#{nodes}", "--ntasks-per-node", "#{ppn}", "--gpus-per-node", "1", "--gres", "vis" ]
torque_args = "#{nodes}:ppn=#{ppn}:#{node_type}:gpus=1"
else
slurm_args = ["--nodes", "#{nodes}", "--ntasks-per-node", "#{ppn}" ]
torque_args = "#{nodes}:ppn=#{ppn}"
email = ENV['USER']
if !email.include? '@'
email = email + '@uab.edu'
end
%>
-%>
---
batch_connect:
template: vnc
template: "vnc"
script:
job_environment:
USER: "<%= ENV['USER'] %>"
native:
<%- if torque_cluster %>
resources:
nodes: "<%= torque_args %>"
<%- else %>
<%- slurm_args.each do |arg| %>
- "<%= arg %>"
<%- end %>
<%- end %>
- "-N 1"
- "-n <%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"
- "--mem-per-cpu=<%= bc_num_mems.blank? ? 4 : bc_num_mems.to_i %>G"
- "--partition=<%= bc_partition %>"
- "--time=<%= bc_num_hours.blank? ? 1 : bc_num_hours.to_i %>:00:00"
- "--job-name=ood-matlab-<%= version.split("/")[-1] %>"
<%- if bc_partition.include? "pascalnodes" or bc_partition.include? "amperenodes" -%>
- "--gres=gpu:<%= bc_num_gpus.blank? ? 1 : bc_num_gpus.to_i %>"
<%- end -%>
<%- if bc_email_on_started == "1" -%>
- "--mail-type=BEGIN"
- "--mail-user=<%= email %>"
<%- end -%>
#!/usr/bin/env bash
<%- gpu = context.node_type.include?("vis") -%>
# Clean the environment
module purge
# Set working directory to home directory
cd "${HOME}"
......@@ -17,7 +12,7 @@ cd "${HOME}"
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"
export XDG_CACHE_HOME="$(mktemp -d)"
module restore
module reset
set -x
xfwm4 --compositor=off --daemon --sm-client-disable
xsetroot -solid "#D3D3D3"
......@@ -29,17 +24,15 @@ cd "${HOME}"
# Start MATLAB
#
<%- if context.bc_partition == "pascalnodes" -%>
# Load CUDA toolkit
module load <%= context.cuda_toolkit %>
<%- end -%>
# Load the required environment
module load xalt/latest <%= context.version %>
module load <%= context.version %>
<%= context.custom_environment.gsub(/\r\n?/, "\n") %>
# Launch MATLAB
<%- if gpu -%>
module load intel/16.0.3 virtualgl
module list
set -x
vglrun matlab -desktop -nosoftwareopengl
<%- else -%>
module list
set -x
matlab -desktop
<%- end -%>