Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for allocation and partition specification in SDK #93

Open
wants to merge 4 commits into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions cybergis_compute_client/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,11 @@ def renderSlurm(self):
if self.slurm[i] is not None:
w.append(self.slurm[i])
self.slurm['vbox'] = widgets.VBox(w)
self.slurm['allocation'] = widgets.Text(placeholder='(Optional) Specify Allocation', style=self.style)
self.slurm['partition'] = widgets.Text(placeholder='(Optional) Specify Partition', style=self.style)

# settings end
self.slurm['accordion'] = widgets.Accordion(children=(widgets.VBox(children=(self.slurm['description'], self.slurm['vbox'])),), selected_index=None)
self.slurm['accordion'] = widgets.Accordion(children=(widgets.VBox(children=(self.slurm['description'], self.slurm['vbox'], widgets.Label("In most cases, specifying an allocation and partition is unnecessary. Do not input anything unless you have a non-default allocation and/or partition to specify."), widgets.HBox([widgets.Label("Allocation: "), self.slurm['allocation']]), widgets.HBox([widgets.Label("Partition: "), self.slurm['partition']]))),), selected_index=None)
self.slurm['accordion'].set_title(0, 'Slurm Computing Configurations')
with self.slurm['output']:
display(self.slurm['accordion'])
Expand Down Expand Up @@ -1023,13 +1025,21 @@ def get_data(self):
dict : Information about the job submitted (template,
computing resource used, slurm rules, param rules, user email)
"""
allocation = None
if self.slurm['allocation'].value != '':
allocation = self.slurm['allocation'].value
partition = None
if self.slurm['partition'].value != '':
partition = self.slurm['partition'].value
out = {
'job_template': self.jobTemplate['dropdown'].value,
'computing_resource': self.computingResource['dropdown'].value,
'slurm': {
'time': '01:00:00',
'num_of_task': 1,
'cpu_per_task': 1
'cpu_per_task': 1,
'allocation': allocation,
'partition': partition
},
'param': {},
'email': self.email['text'].value if self.email[
Expand Down
Loading