Skip to content

Commit

Permalink
Merge pull request #163 from mila-iqia/disable-self-cluster-association
Browse files Browse the repository at this point in the history
Disable(/Hide) account self-association from the settings page
  • Loading branch information
gyom authored Aug 23, 2023
2 parents a35e951 + 6f539e3 commit 4d3b9bc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
20 changes: 11 additions & 9 deletions clockwork_web/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ <h1>{{ gettext("User settings %(mila_email_username)s", mila_email_username=mila
<div class="col-12">

<dl class="row">
<!--
<dt class="col-6">
<form>
Expand All @@ -123,16 +124,17 @@ <h1>{{ gettext("User settings %(mila_email_username)s", mila_email_username=mila
<a href="new_key">change key</a>
</dt>
<dd class="col-6">
{# If the user has no associated account on a cluster, propose a pairing option #}
{% if cc_account_username is none %}
{% if cc_account_update_key is not none %}
<p><strong>Run this command to register your account:</strong></p>
<pre>sbatch --time=1 --wrap=true --comment=clockwork_register_account:{{ cc_account_update_key }}</pre>
<dd class="col-6">
{# If the user has no associated account on a cluster, propose a pairing option #}
{% if cc_account_username is none %}
{% if cc_account_update_key is not none %}
<p><strong>Run this command to register your account:</strong></p>
<pre>sbatch --time=1 --wrap=true --comment=clockwork_register_account:{{ cc_account_update_key }}</pre>
{% endif %}
<a href="new_update_key">Get update account key</a>
{% endif %}
<a href="new_update_key">Get update account key</a>
{% endif %}
</dd>
</dd>
-->

<!-- Dark mode -->
<dt class="col-6"><label for="dark_mode_toggle">{{ gettext("Dark mode") }}</label></dt>
Expand Down
7 changes: 5 additions & 2 deletions slurm_state/mongo_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,10 @@ def get_jobs_updates_and_insertions(
)

# -- Account association -- #
L_users_updates = associate_account(LD_sacct)
# L_users_updates = associate_account(LD_sacct)

return (L_updates_to_do, L_users_updates, L_data_for_dump_file)
# return (L_updates_to_do, L_users_updates, L_data_for_dump_file)
return (L_updates_to_do, [], L_data_for_dump_file)


def get_nodes_updates(I_clockwork_nodes):
Expand Down Expand Up @@ -428,6 +429,7 @@ def get_nodes_updates(I_clockwork_nodes):
return (L_updates_to_do, L_data_for_dump_file)


"""
def associate_account(LD_sacct_jobs):
L_user_updates = []
for D_job in LD_sacct_jobs:
Expand Down Expand Up @@ -499,6 +501,7 @@ def associate_account(LD_sacct_jobs):
)
return L_user_updates
"""


def main_read_users_and_update_collection(
Expand Down

0 comments on commit 4d3b9bc

Please sign in to comment.