https://docs.alliancecan.ca/mediawiki/api.php?action=feedcontributions&user=Plstonge&feedformat=atomAlliance Doc - User contributions [en]2024-03-29T15:54:44ZUser contributionsMediaWiki 1.39.6https://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149696Visual Studio Code2024-02-02T16:18:41Z<p>Plstonge: Marked this version for translation</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
[[File:VSCode SSH Passphrase Prompt.png|thumb|SSH Passphrase prompt]]<br />
Note : <b>you will be prompted many times for your SSH key passphrase.</b><br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
===Connection with MFA enabled=== <!--T:18--><br />
[[File:VSCode Detail Link.png|thumb|When connecting, click on "details" to see the prompt for the 2nd factor in the Terminal]]<br />
<br />
<!--T:12--><br />
If the [[Multifactor authentication|multifactor authentication]] is enabled,<br />
you will need to check the "details" of the connection, which will bring you to the<br />
VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
=Closing your connection= <!--T:19--><br />
<br />
<!--T:20--><br />
When closing the local VS Code window, the remote process of VS Code Server may keep running in background, which tends to accumulate orphan processes on that login node. Not only that, but your next connection may connect to a different login node, which can cause issues and confusion. '''To cleanly close a connection, click on the bottom-left corner of VS Code and select ''Close Remote Connection'' on top of the window.'''<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=Troubleshooting= <!--T:21--><br />
<br />
==The remote session does not work anymore== <!--T:22--><br />
<br />
<!--T:23--><br />
{{Warning<br />
|title=As of February 1st, 2024<br />
|content=<br />
The newest versions of [https://code.visualstudio.com/docs/remote/linux#_remote-host-container-wsl-linux-prerequisites VS Code Server no longer support CentOS 7], which affects connections to <b>Béluga</b>, <b>Cedar</b>, <b>Graham</b> and <b>Niagara</b>. Users are invited to develop on their local computer and upload their code manually to the cluster.<br />
<br />
<!--T:24--><br />
* Note 1: Béluga will get upgraded in the upcoming months.<br />
* Note 2: an older version of VS Code still works through [[JupyterHub#VS_Code|JupyterHub]].<br />
}}<br />
<br />
<!--T:25--><br />
Because VS Code is intended for a different use case than developing on our clusters, having several instances of VS Code Server running on different login nodes can lead to issues. To fix them:<br />
<br />
<!--T:26--><br />
* Connect to all login nodes and stop (with <code>kill <PID></code>) all VS Code processes you see in the output of <code>ps aux | grep $USER</code> or <code>top -u $USER</code>.<br />
* If the above does not fix the problem, carefully delete the content of the <code>~/.vscode-server</code> directory, and then reconnect for a fresh installation of VS Code Server.<br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149682Visual Studio Code2024-02-01T22:20:15Z<p>Plstonge: CentOS 7 issue</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
[[File:VSCode SSH Passphrase Prompt.png|thumb|SSH Passphrase prompt]]<br />
Note : <b>you will be prompted many times for your SSH key passphrase.</b><br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
===Connection with MFA enabled=== <!--T:18--><br />
[[File:VSCode Detail Link.png|thumb|When connecting, click on "details" to see the prompt for the 2nd factor in the Terminal]]<br />
<br />
<!--T:12--><br />
If the [[Multifactor authentication|multifactor authentication]] is enabled,<br />
you will need to check the "details" of the connection, which will bring you to the<br />
VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
=Closing your connection=<br />
<br />
When closing the local VS Code window, the remote process of VS Code Server may keep running in background, which tends to accumulate orphan processes on that login node. Not only that, but your next connection may connect to a different login node, which can cause issues and confusion. '''To cleanly close a connection, click on the bottom-left corner of VS Code and select ''Close Remote Connection'' on top of the window.'''<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=Troubleshooting=<br />
<br />
==The remote session does not work anymore==<br />
<br />
{{Warning<br />
|title=As of February 1st, 2024<br />
|content=<br />
The newest versions of [https://code.visualstudio.com/docs/remote/linux#_remote-host-container-wsl-linux-prerequisites VS Code Server no longer support CentOS 7], which affects connections to <b>Béluga</b>, <b>Cedar</b>, <b>Graham</b> and <b>Niagara</b>. Users are invited to develop on their local computer and upload their code manually to the cluster.<br />
<br />
* Note 1: Béluga will get upgraded in the upcoming months.<br />
* Note 2: an older version of VS Code still works through [[JupyterHub#VS_Code|JupyterHub]].<br />
}}<br />
<br />
Because VS Code is intended for a different use case than developing on our clusters, having several instances of VS Code Server running on different login nodes can lead to issues. To fix them:<br />
<br />
* Connect to all login nodes and stop (with <code>kill <PID></code>) all VS Code processes you see in the output of <code>ps aux | grep $USER</code> or <code>top -u $USER</code>.<br />
* If the above does not fix the problem, carefully delete the content of the <code>~/.vscode-server</code> directory, and then reconnect for a fresh installation of VS Code Server.<br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149681Visual Studio Code2024-02-01T21:27:19Z<p>Plstonge: CentOS 7 issue</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
[[File:VSCode SSH Passphrase Prompt.png|thumb|SSH Passphrase prompt]]<br />
Note : <b>you will be prompted many times for your SSH key passphrase.</b><br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
===Connection with MFA enabled=== <!--T:18--><br />
[[File:VSCode Detail Link.png|thumb|When connecting, click on "details" to see the prompt for the 2nd factor in the Terminal]]<br />
<br />
<!--T:12--><br />
If the [[Multifactor authentication|multifactor authentication]] is enabled,<br />
you will need to check the "details" of the connection, which will bring you to the<br />
VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
=Closing your connection=<br />
<br />
When closing the local VS Code window, the remote process of VS Code Server may keep running in background, which tends to accumulate orphan processes on that login node. Not only that, but your next connection may connect to a different login node, which can cause issues and confusion. '''To cleanly close a connection, click on the bottom-left corner of VS Code and select ''Close Remote Connection'' on top of the window.'''<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=Troubleshooting=<br />
<br />
==The remote session does not work anymore==<br />
<br />
{{box|<b>As of February 1st, 2024</b><br><br />
VS Code Server has stopped working on Béluga because the operating system is no longer supported. Users are invited to develop on their local computer or on other clusters. Béluga will get upgraded in the upcoming months.<br />
<br />
Note: VS Code still works through [[JupyterHub#VS_Code|JupyterHub]] on Béluga.}}<br />
<br />
Because VS Code is intended for a different use case than developing on our clusters, having several instances of VS Code Server running on different login nodes can lead to issues. To fix them:<br />
<br />
* Connect to all login nodes and stop (with <code>kill <PID></code>) all VS Code processes you see in the output of <code>ps aux | grep $USER</code> or <code>top -u $USER</code>.<br />
* If the above does not fix the problem, carefully delete the content of the <code>~/.vscode-server</code> directory, and then reconnect for a fresh installation of VS Code Server.<br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=JupyterHub&diff=149680JupyterHub2024-02-01T21:17:14Z<p>Plstonge: New code-server version</p>
<hr />
<div><languages /><br />
<translate><br />
<!--T:2--><br />
<i>JupyterHub is the best way to serve Jupyter Notebook for multiple users. It can be used in a class of students, a corporate data science group or scientific research group.</i><br />
<ref>http://jupyterhub.readthedocs.io/en/latest/index.html</ref><br />
<br />
<!--T:3--><br />
JupyterHub provides a preconfigured version of JupyterLab and/or Jupyter Notebook; for more configuration options, please check the [[Jupyter]] page.<br />
<br />
= Alliance initiatives = <!--T:4--><br />
<br />
<!--T:5--><br />
Some regional initiatives offer access to computing resources through JupyterHub.<br />
<br />
== JupyterHub on clusters == <!--T:11--><br />
<br />
<!--T:8--><br />
On the following clusters[[#clusters_note|<sup>‡</sup>]], use your Alliance username and password to connect to JupyterHub:<br />
{| class="wikitable"<br />
|-<br />
! JupyterHub !! Comments<br />
|-<br />
| <b>[https://jupyterhub.beluga.alliancecan.ca/ Béluga]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Béluga/en|Béluga]] cluster. <br />
|-<br />
| <b>[https://jupyterhub.cedar.computecanada.ca/ Cedar]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Cedar]] cluster. <br />
|-<br />
| <b>[https://jupyterhub.narval.alliancecan.ca/ Narval]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Narval/en|Narval]] cluster.<br />
|-<br />
| <b>[https://jupyter.scinet.utoronto.ca/ Niagara]</b> || This is a node which has been designated as a Jupyter Hub and it can run Jupyter Notebook sessions. To learn more, see the [https://docs.scinet.utoronto.ca/index.php/Jupyter_Hub SciNet JupyterHub wiki page].<br />
|-<br />
| <b>[https://jupyterhub.sharcnet.ca/ Graham]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Graham]] cluster.<br />
|}<br />
<br />
<!--T:18--><br />
<b><sup id="clusters_note">‡</sup> Note that the compute nodes running the Jupyter kernels do not have internet access</b>. This means that you can only transfer files from/to your own computer; you cannot download code or data from the internet (e.g. cannot do "git clone", cannot do "pip install" if the wheel is absent from our [[Available Python wheels|wheelhouse]]). You may also have problems if your code performs downloads or uploads (e.g. in machine learning where downloading data from the code is often done).<br />
<br />
== JupyterHub for universities and schools == <!--T:12--><br />
<br />
<!--T:6--><br />
* The [https://www.pims.math.ca Pacific Institute for the Mathematical Sciences] in collaboration with the Alliance and [http://www.cybera.ca Cybera] offer cloud-based hubs to universities and schools. Each institution can have its own hub where users authenticate with their credentials from that institution. The hubs are hosted on Alliance [[Cloud|clouds]] and are essentially for training purposes. Institutions interested in obtaining their own hub can visit [http://syzygy.ca Syzygy].<br />
<br />
= Server options = <!--T:13--><br />
<br />
<!--T:14--><br />
[[File:JupyterHub_Server_Options.png|thumb|<i>Server Options</i> form on Béluga's JupyterHub]]<br />
Once logged in, depending on the configuration of JupyterHub, the user's web browser is redirected to either<br />
<b>a)</b> a previously launched Jupyter server,<br />
<b>b)</b> a new Jupyter server with default options, or<br />
<b>c)</b> a form that allows a user to set different options for their Jupyter server before pressing the <i>Start</i> button.<br />
In all cases, it is equivalent to accessing requested resources via an [[Running_jobs#Interactive_jobs|interactive job]] on the corresponding cluster.<br />
<br />
<!--T:64--><br />
<b>Important:</b> On each cluster, only one interactive job at a time gets a priority increase in order to start in a few seconds or minutes. That includes <code>salloc</code>, <code>srun</code> and JupyterHub jobs. If you already have another interactive job running on the cluster hosting JupyterHub, your new Jupyter session may never start before the time limit of 5 minutes.<br />
<br />
== Compute resources == <!--T:15--><br />
<br />
<!--T:16--><br />
For example, <i>Server Options</i> available on [https://jupyterhub.beluga.computecanada.ca/ Béluga's JupyterHub] are:<br />
* <i>Account</i> to be used: any <code>def-*</code>, <code>rrg-*</code>, <code>rpp-*</code> or <code>ctb-*</code> account a user has access to<br />
* <i>Time (hours)</i> required for the session<br />
* <i>Number of (CPU) cores</i> that will be reserved on a single node<br />
* <i>Memory (MB)</i> limit for the entire session<br />
* (Optional) <i>GPU configuration</i>: at least one GPU<br />
* <i>[[JupyterHub#User_Interface|User interface]]</i> (see below)<br />
<br />
== User interface == <!--T:9--><br />
<br />
<!--T:17--><br />
While JupyterHub allows each user to use one Jupyter server at a time on each hub, there can be multiple options under <i>User interface</i>:<br />
* Jupyter Notebook (classic interface): Even though it offers many functionalities, the community is moving towards [[JupyterHub#JupyterLab|JupyterLab]], which is a better platform that offers many more features.<br />
* <b>[[JupyterHub#JupyterLab|JupyterLab]]</b> (modern interface): This is the most recommended Jupyter user interface for interactive prototyping and data visualization.<br />
* Terminal (for a single terminal only): It gives access to a terminal connected to a remote account, which is comparable to connecting to a server through an SSH connection.<br />
<br />
<!--T:10--><br />
Note: JupyterHub could also have been configured to force a specific user interface. This is usually done for special events.<br />
<br />
= JupyterLab = <!--T:19--><br />
<br />
<!--T:20--><br />
JupyterLab is now the recommended general-purpose user interface to use on a JupyterHub.<br />
From a JupyterLab server, you can manage your remote files and folders,<br />
and you can launch Jupyter applications like a terminal, (Python 3) notebooks, RStudio and a Linux desktop.<br />
<br />
== The JupyterLab interface == <!--T:21--><br />
<br />
<!--T:22--><br />
When JupyterLab is ready to be used, the interface has multiple panels.<br />
[[File:JupyterLab_HomeTab.png|thumb|Default home tab when JupyterLab is loaded]]<br />
<br />
=== Menu bar on top === <!--T:23--><br />
<br />
<!--T:24--><br />
* In the <i>File</i> menu:<br />
** <i>Hub Control Panel</i>: if you want to manually stop the JupyterLab server and the corresponding job on the cluster. This is useful when you want to start a new JupyterLab server with more or less resources.<br />
** <i>Log Out</i>: the JupyterHub session will end, which will also stop the JupyterLab server and the corresponding job on the cluster.<br />
* Most other menu items are related to notebooks and Jupyter applications.<br />
<br />
=== Tool selector on left === <!--T:25--><br />
<br />
<!--T:26--><br />
* <i>File Browser</i> (folder icon):<br />
** This is where you can browse in your home, project and scratch spaces.<br />
** It is also possible to upload files.<br />
* <i>Running Terminals and Kernels</i> (stop icon):<br />
** To stop kernel sessions and terminal sessions<br />
* <i>Commands</i><br />
* <i>Property Inspector</i><br />
* <i>Open Tabs</i>:<br />
** To navigate between application tabs.<br />
** To close application tabs (the corresponding kernels remain active).<br />
[[File:JupyterLab_Softwares.png|thumb|Loaded modules and available modules]]<br />
* <b><i>Software</i></b> (blue diamond sign):<br />
** Alliance modules can be loaded and unloaded in the JupyterLab session. Depending on the modules loaded, icons directing to the corresponding [[#Prebuilt_applications|Jupyter applications]] will appear in the <i>Launcher</i> tab.<br />
** The search box can search for any [[Available software|available module]] and show the result in the <i>Available Modules</i> subpanel. Note: Some modules are hidden until their dependency is loaded: we recommend that you first look for a specific module with <code>module spider module_name</code> from a terminal.<br />
** The next subpanel is the list of <i>Loaded Modules</i> in the whole JupyterLab session. Note: While <code>python</code> and <code>ipython-kernel</code> modules are loaded by default, additional modules must be loaded before launching some other applications or notebooks. For example: <code>scipy-stack</code>.<br />
** The last subpanel is the list of <i>Available modules</i>, similar to the output of <code>module avail</code>. By clicking on a module's name, detailed information about the module is displayed. By clicking on the <i>Load</i> link, the module will be loaded and added to the <i>Loaded Modules</i> list.<br />
<br />
=== Applications area on right === <!--T:27--><br />
<br />
<!--T:28--><br />
* The <i>Launcher</i> tab is open by default.<br />
** It contains all available [[#Prebuilt_applications|Jupyter applications and notebooks]], depending on which modules are loaded<br />
<br />
=== Status bar at the bottom === <!--T:29--><br />
<br />
<!--T:30--><br />
* By clicking on the icons, this brings you to the <i>Running Terminals and Kernels</i> tool.<br />
<br />
== Prebuilt applications == <!--T:31--><br />
<br />
<!--T:32--><br />
JupyterLab offers access to a terminal, an IDE (Desktop), a Python console and different options to create text and markdown files. This section presents only the main supported Jupyter applications that work with our software stack.<br />
<br />
=== Command line interpreters === <!--T:33--><br />
<br />
<!--T:34--><br />
[[File:JupyterLab_Launcher_Julia.png|thumb|Julia console launcher button]]<br />
[[File:JupyterLab_Launcher_Python.png|thumb|Python console launcher button]]<br />
[[File:JupyterLab_Launcher_Terminal.png|thumb|Terminal launcher button]]<br />
<br />
==== Julia console ==== <!--T:35--><br />
<br />
<!--T:36--><br />
To enable the <i>Julia 1.x</i> console launcher, an <code>ijulia-kernel</code> module needs to be loaded. When launched, a Julia interpreter is presented in a new JupyterLab tab.<br />
<br />
==== Python console ==== <!--T:37--><br />
<br />
<!--T:38--><br />
The <i>Python 3.x</i> console launcher is available by default in a new JupyterLab session. When launched, a Python 3 interpreter is presented in a new JupyterLab tab.<br />
<br />
==== Terminal ==== <!--T:39--><br />
<br />
<!--T:40--><br />
This application launcher will open a terminal in a new JupyterLab tab:<br />
* The terminal runs a (Bash) shell on the remote compute node without the need of an SSH connection.<br />
** Gives access to the remote filesystems (<code>/home</code>, <code>/project</code>, <code>/scratch</code>).<br />
** Allows running compute tasks.<br />
* The terminal allows copy-and-paste operations of text:<br />
** Copy operation: select the text, then press Ctrl+C.<br />
*** Note: Usually, Ctrl+C is used to send a SIGINT signal to a running process, or to cancel the current command. To get this behaviour in JupyterLab's terminal, click on the terminal to deselect any text before pressing Ctrl+C.<br />
** Paste operation: press Ctrl+V.<br />
<br />
=== Available notebook kernels === <!--T:41--><br />
<br />
==== Julia notebook ==== <!--T:42--><br />
<br />
<!--T:43--><br />
To enable the <i>Julia 1.x</i> notebook launcher, an <code>ijulia-kernel</code> module needs to be loaded. When launched, a Julia notebook is presented in a new JupyterLab tab.<br />
<br />
==== Python notebook ==== <!--T:44--><br />
<br />
<!--T:45--><br />
[[File:JupyterLab_Softwares_ScipyStack.png|thumb|Searching for scipy-stack modules]]<br />
If any of the following scientific Python packages is required by your notebook, before you open this notebook, you must load the <code>scipy-stack</code> module from the JupyterLab <i>Softwares</i> tool:<br />
* <code>ipython</code>, <code>ipython_genutils</code>, <code>ipykernel</code>, <code>ipyparallel</code><br />
* <code>matplotlib</code><br />
* <code>numpy</code><br />
* <code>pandas</code><br />
* <code>scipy</code><br />
* Other notable packages are <code>Cycler</code>, <code>futures</code>, <code>jupyter_client</code>, <code>jupyter_core</code>, <code>mpmath</code>, <code>pathlib2</code>, <code>pexpect</code>, <code>pickleshare</code>, <code>ptyprocess</code>, <code>pyzmq</code>, <code>simplegeneric</code>, <code>sympy</code>, <code>tornado</code>, <code>traitlets</code>.<br />
* And many more (click on the <code>scipy-stack</code> module to see all <i>Included extensions</i>).<br />
<br />
<!--T:46--><br />
Note: You may also install needed packages by running for example the following command inside a cell: <code>!pip install --no-index numpy</code>.<br />
* For some packages (like <code>plotly</code>, for example), you may need to restart the notebook's kernel before importing the package.<br />
* The installation of packages in the default Python kernel environment is temporary to the lifetime of the JupyterLab session; you will have to reinstall these packages the next time you start a new JupyterLab session. For a persistent Python environment, you must configure a <b>[[Advanced_Jupyter_configuration#Python_kernel|custom Python kernel]]</b>.<br />
<br />
<!--T:47--><br />
To open an existing Python notebook:<br />
* Go back to the <i>File Browser</i>.<br />
* Browse to the location of the <code>*.ipynb</code> file.<br />
* Double-click on the <code>*.ipynb</code> file.<br />
** This will open the Python notebook in a new JupyterLab tab.<br />
** An IPython kernel will start running in the background for this notebook.<br />
<br />
<!--T:48--><br />
To open a new Python notebook in the current <i>File Browser</i> directory:<br />
* Click on the <i>Python 3.x</i> launcher under the <i>Notebook</i> section.<br />
** This will open a new Python 3 notebook in a new JupyterLab tab.<br />
** A new IPython kernel will start running in the background for this notebook.<br />
<br />
=== Other applications === <!--T:49--><br />
<br />
==== OpenRefine ==== <!--T:50--><br />
<br />
<!--T:51--><br />
[[File:JupyterLab_Launcher_OpenRefine.png|thumb|OpenRefine launcher button]]<br />
To enable the <i>OpenRefine</i> application launcher, an <code>openrefine</code> module needs to be loaded. Depending on the software environment version, the latest version of OpenRefine should be loaded:<br />
* with <code>StdEnv/2020</code>, load module: <code>openrefine/3.4.1</code><br />
* with <code>StdEnv/2018.3</code>, load module: <code>openrefine/3.3</code><br />
<br />
<!--T:52--><br />
This <i>OpenRefine</i> launcher will open or reopen an OpenRefine interface in a new web browser tab.<br />
* It is possible to reopen an active OpenRefine session after the web browser tab was closed.<br />
* The OpenRefine session will end when the JupyterLab session will end.<br />
<br />
==== RStudio ==== <!--T:53--><br />
<br />
<!--T:54--><br />
[[File:JupyterLab_Launcher_RStudio.png|thumb|RStudio launcher button]]<br />
To enable the <i>RStudio</i> application launcher in <code>StdEnv/2020</code>, load the module: <code>rstudio-server</code><br />
<br />
<!--T:55--><br />
With older software environment, you should load the following two modules (<code>r</code> is loaded automatically):<br />
* with <code>StdEnv/2018.3</code>, load modules: <code>gcc/7.3.0</code>, <code>rstudio-server/1.2.1335</code><br />
* with <code>StdEnv/2016.4</code>, load modules: <code>gcc/7.3.0</code>, <code>rstudio-server/1.2.1335</code><br />
<br />
<!--T:56--><br />
This <i>RStudio</i> launcher will open or reopen an RStudio interface in a new web browser tab.<br />
* It is possible to reopen an active RStudio session after the web browser tab was closed.<br />
* The RStudio session will end when the JupyterLab session will end.<br />
<br />
==== VS Code ==== <!--T:57--><br />
<br />
<!--T:58--><br />
[[File:JupyterLab_Launcher_VSCode.png|thumb|VS Code launcher button]]<br />
To enable the <i>VS Code</i> (Visual Studio Code) application launcher, a <code>code-server</code> module needs to be loaded. Depending on the software environment version, the latest version of VS Code should be loaded:<br />
* with <code>StdEnv/2020</code>, load module: <code>code-server/3.12.0</code><br />
* with <code>StdEnv/2018.3</code>, load module: <code>code-server/3.4.1</code><br />
<br />
<!--T:59--><br />
This <i>VS Code</i> launcher will open or reopen the VS Code interface in a new web browser tab.<br />
* For a new session, the <i>VS Code</i> session can take up to 3 minutes to complete its startup.<br />
* It is possible to reopen an active VS Code session after the web browser tab was closed.<br />
* The VS Code session will end when the JupyterLab session will end.<br />
<br />
==== Desktop ==== <!--T:60--><br />
<br />
<!--T:61--><br />
[[File:JupyterLab_Launcher_Desktop.png|thumb|Desktop launcher button]]<br />
This <i>Desktop</i> launcher will open or reopen a remote Linux desktop interface in a new web browser tab:<br />
* This is equivalent to running a [[VNC#Compute_Nodes|VNC server on a compute node]], then creating an [[SSH_tunnelling|SSH tunnel]] and finally using a [[VNC#Setup|VNC client]], but you need nothing of all this with JupyterLab!<br />
* It is possible to reopen an active desktop session after the web browser tab was closed.<br />
* The desktop session will end when the JupyterLab session will end.<br />
<br />
= Possible error messages = <!--T:62--><br />
<br />
<!--T:63--><br />
Most JupyterHub errors are caused by the underlying job scheduler which is either unresponsive or not able to find appropriate resources for your session. For example:<br />
* A "time-out" error message when starting a JupyterLab session:<br />
** Just like any interactive job on any cluster, a longer requested time can cause a longer wait time in queue.<br />
** There may be no available interactive node at the moment; try again later.<br />
<br />
= References = <!--T:7--><br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149679Visual Studio Code2024-02-01T20:47:57Z<p>Plstonge: The remote session does not work anymore</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
[[File:VSCode SSH Passphrase Prompt.png|thumb|SSH Passphrase prompt]]<br />
Note : <b>you will be prompted many times for your SSH key passphrase.</b><br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
===Connection with MFA enabled=== <!--T:18--><br />
[[File:VSCode Detail Link.png|thumb|When connecting, click on "details" to see the prompt for the 2nd factor in the Terminal]]<br />
<br />
<!--T:12--><br />
If the [[Multifactor authentication|multifactor authentication]] is enabled,<br />
you will need to check the "details" of the connection, which will bring you to the<br />
VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
=Closing your connection=<br />
<br />
When closing the local VS Code window, the remote process of VS Code Server may keep running in background, which tends to accumulate orphan processes on that login node. Not only that, but your next connection may connect to a different login node, which can cause issues and confusion. '''To cleanly close a connection, click on the bottom-left corner of VS Code and select ''Close Remote Connection'' on top of the window.'''<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=Troubleshooting=<br />
<br />
==The remote session does not work anymore==<br />
<br />
Because VS Code is intended for a different use case than developing on our clusters, having several instances of VS Code Server running on different login nodes can lead to issues. To fix them:<br />
<br />
* Connect to all login nodes and stop (with <code>kill <PID></code>) all VS Code processes you see in the output of <code>ps aux | grep $USER</code> or <code>top -u $USER</code>.<br />
* If the above does not fix the problem, carefully delete the content of the <code>~/.vscode-server</code> directory, and then reconnect for a fresh installation of VS Code Server.<br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication/fr&diff=149520Multifactor authentication/fr2024-01-30T20:46:42Z<p>Plstonge: </p>
<hr />
<div><languages /><br />
<br />
<br />
L’authentification multifacteur permet de protéger votre compte avec plus qu’un simple mot de passe. Une fois que votre compte est configuré pour utiliser cette fonctionnalité, vous devrez entrer votre mot de passe comme d’habitude, mais en plus effectuer une deuxième action (le <i>deuxième facteur</i>), pour avoir accès à la plupart de nos services.<br />
<br />
Sélectionnez cette deuxième étape d’authentification parmi ces facteurs&nbsp;:<br />
*accepter une notification sur votre appareil intelligent dans l’application Duo Mobile;<br />
*entrer un code généré sur demande;<br />
*presser un bouton sur une clé matérielle (YubiKey).<br><br />
<br />
L’authentification multifacteur sera déployée graduellement. Cette fonctionnalité ne sera donc pas disponible immédiatement pour tous nos services.<br />
<br />
= Webinaires à voir =<br />
Ces deux webinaires ont été enregistrés en octobre 2023 : <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (en français)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (en anglais)<br />
<br />
= Enregistrement des facteurs =<br />
== Enregistrer plusieurs facteurs ==<br />
Lorsque vous activez l'authentification multifacteur pour votre compte, nous vous <b>recommandons fortement</b> d’enregistrer au moins deux options pour votre deuxième facteur. Vous pouvez par exemple vous servir de votre téléphone et de codes à usage unique; de votre téléphone et d’une clé YubiKey; ou encore de deux clés YubiKey. De cette façon, si une de ces options ne peut pas être employée, vous aurez un autre facteur pour accéder à votre compte.<br />
<br />
== Utiliser un téléphone ou une tablette ==<br />
<br />
#Installez l'application Duo Mobile à partir du [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] ou de [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Assurez-vous d'avoir la bonne application (voir l'icône ci-dessous). Les applications TOTP comme Aegis, Google Authenticator et Microsoft Authenticator <b>ne sont pas compatibles</b> avec Duo et ne peuvent pas balayer le code QR.<br />
#Connectez-vous à votre compte et cliquez sur <i>Mon compte → [https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
#Sous <i>Enregistrer un appareil</i>, cliquez sur <i>Duo Mobile</i>.<br />
#Entrez un nom pour identifier votre appareil. Cliquez sur <i>Continuer</i> pour faire afficher un code QR. <br />
#Dans l'application Duo Mobile, cliquez sur le signe <b>+</b> ou sur <i>Ajouter un compte</i>.<br />
#Touchez <i>Utiliser un code QR</i>.<br />
#Balayez le code QR qui est affiché dans CCDB. <b>Important : Pour balayer le code QR, votre appareil doit avoir accès à l'internet par wi-fi ou par réseau cellulaire.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Étape 1<br />
File:Duo-mobile-option.png|Étape 3<br />
File:Naming-duo-mobile-device.png|Étape 4<br />
File:Duo-mobile-add-account.png|Étape 5<br />
File:Duo-mobile-scan-qr-code.png|Étape 6<br />
File:Scanning-CCDB-QR-code.jpg|Étape 7<br />
</gallery><br />
<br />
== Utiliser une clé YubiKey 5 ==<br />
Les YubiKey sont des clés matérielles produites par [https://www.yubico.com/ Yubico]. Si vous n'avez pas de téléphone intelligent ou de tablette, si vous ne voulez pas employer ces appareils pour l'authentification multifacteur, ou s'il vous est souvent impossible de les utiliser, une clé YubiKey 5 serait votre meilleur choix.<br />
<br />
<b>Notez que certains modèles [https://help.duo.com/s/article/2166?language=en_US ne sont pas compatibles]; nous recommandons YubiKey, série 5.</b><br />
<br />
De la taille d’une petite clé USB, les clés YubiKey 5 coûtent entre 50 et 100 dollars. Différents modèles sont compatibles avec les ports USB-A, USB-C et Lightning et certaines permettent la communication en champ proche (NFC) avec un téléphone ou une tablette.<br />
<br />
YubiKeys supporte plusieurs protocoles. Nos grappes utilisent Yubico OTP (<i>one-time password</i>). Une fois que votre clé est enregistrée à votre compte comme facteur d'authentification, quand vous tenterez de vous connecter à une de nos grappes, on vous demandera d'entrer un mot de passe à utilisation unique (OTP). Vous appuyez alors sur le bouton de la clé, ce qui génère une chaîne de 32 caractères qui forme un mot de passe à entrer. Vous n'avez pas besoin du clavier; la clé se connecte à votre ordinateur et entre elle-même la chaîne de 32 caractères quand vous touchez le bouton.<br />
<br />
Pour enregistrer votre YubiKey, entrez son identifiant public, son identifiant privé et sa clé secrète dans la page <i>[https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>. Si ces renseignements ne sont pas disponibles, configurez votre clé comme suit.<br />
<br />
=== Configurer votre YubiKey pour Yubico OTP ===<br />
<br />
# Téléchargez et installez YubiKey Manager à partir du [https://www.yubico.com/support/download/yubikey-manager/ site Web de Yubico].<br />
# Insérez la clé YubiKey et lancez YubiKey Manager.<br />
# Dans YubiKey Manager, cliquez sur <i>Applications</i> puis sur <i>OTP</i> (voir les images ci-dessous).<br />
# Vous pouvez ici configurer l'une de deux options. <i>Short Touch (Slot 1)</i> identifie une touche brève (de 1 à 2,5 secondes) et <i>Long Touch (Slot 2)</i> correspond à une touche plus longue (de 3 à 5 secondes). L'option numéro 1 est généralement préenregistrée pour Yubico Cloud. Si vous utilisez déjà cette option pour d'autres services, configurez plutôt l'option 2, ou cliquez sur <i>Swap</i> pour transférer la configuration de l'option 1 vers l'option 2, puis configurer l'option 1. <br />
# Sélectionnez <i>Yubico OTP</i>.<br />
# Sélectionnez <i>Use serial</i> pour générer un identifiant privé et une clé secrète. <b>Faites une copie des deux identifiants et de la clé secrète avant de cliquer sur <i>Finish</i> parce que vous en aurez besoin à la prochaine étape</b>. Gardez cette fenêtre ouverte.<br />
# <b>IMPORTANT: Assurez-vous d'avoir cliqué sur <i>Finish</i> à l'étape précédente.</b><br />
# Connectez-vous à la CCDB et cliquez sur <i>Mon compte → [https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i> pour entrer les données pour votre clé.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Étape 3<br />
File:Yubico Manager OTP configuration.png|Étape 4<br />
File:Select Yubico OTP.png|Étape 5<br />
File:Generate Yubikey IDs.png|Étapes 6 et 7<br />
CCDB Yubikeys.png|Étape 8<br />
</gallery><br />
<br />
= Authentification =<br />
== Pour vous connecter à une grappe via SSH == <br />
Si l'authentification multifacteur est activée pour votre compte et que vous vous connectez via SSH à une grappe qui supporte cette fonctionnalité, vous devez d’abord passer la première authentification avec votre mot de passe ou avec votre [[SSH Keys/fr|clé SSH]]. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):}}<br />
<br />
Vous pouvez maintenant indiquer le téléphone ou la tablette qui recevra une notification de la part de Duo. Si vous avez enregistré plusieurs appareils, une liste sera affichée, dans laquelle vous pouvez sélectionner l'appareil de votre choix. Vous n'avez qu'à accepter la notification pour confirmer votre deuxième authentification.<br />
<br />
Si vous utilisez une YubiKey ou un code préalablement sauvegardé, ou encore si vous préférez entrer le mot de passe unique valide pour une durée limitée que Duo Mobile affiche, ne sélectionnez pas une option, mais entrez le code, par exemple <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Passer outre à la deuxième authentification===<br />
Si vous vous connectez avec OpenSSH, vous pouvez configurer votre client SSH pour diminuer la fréquence à laquelle vous devez utiliser la deuxième authentification. Modifiez <code>.ssh/config</code> en ajoutant les lignes suivantes&nbsp;:<br />
<br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
Remplacez <code>HOSTNAME</code> par le hostname du serveur que vous voulez configurer.<br />
<br />
Si vous utilisez Windows, vous pouvez installer OpenSSH en suivant les [https://learn.microsoft.com/fr-ca/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui directives pour installer OpenSSH]. Vous n'avez besoin d'installer que le client.<br />
<br />
== Pour vous connecter à votre compte ==<br />
Si l'authentification multifacteur est activée pour votre compte, vous devez d’abord passer la première authentification avec votre nom d'utilisateur et votre mot de passe. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
<br><br />
(Remarque : <i>Ceci n'est pas la fenêtre finale</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuration de clients SSH courants =<br />
Les clients ligne de commande prennent généralement en charge l'authentification multifacteur sans plus de configuration. Par contre, ce n'est souvent pas le cas pour les clients graphiques. Vous trouverez ci-dessous des directives spécifiques à quelques-uns d’entre eux. <br />
<br />
== FileZilla == <br />
FileZilla demande le mot de passe et le deuxième facteur chaque fois qu'un transfert est initié puisque par défaut, les transferts utilisent des connexions distinctes qui sont automatiquement fermées après un certain temps d'inactivité.<br />
<br />
Pour ne pas avoir à saisir plusieurs fois le mot de passe et le deuxième facteur, vous pouvez limiter le nombre de connexions à chaque site à «&nbsp;1&nbsp;» dans <i>Site Manager => Paramètres de transfert</i>; prenez note que vous perdrez ainsi la possibilité de parcourir le serveur lors des transferts.<br />
<br />
# Lancez FileZilla et sélectionnez <i>Gestionnaire de Sites</i>.<br />
# Dans <i>Gestionnaire de Sites</i>, modifiez un site existant ou créez un nouveau site.<br />
# Sous l'onglet <i>Général</i>, entrez les choix suivants&nbsp;:<br />
#* <i>Protocole : SFTP – SSH File Transfer Protocol</i><br />
#* <i>Hôte :</i> [nom de l'hôte pour la grappe de connexion]<br />
#* <i>Type d'authentification : Interactive</i><br />
#* <i>Identifiant :</i> [votre nom d'utilisateur]<br />
# Sous l'onglet <i>Paramètres de transfert</i>&nbsp;:<br />
#* cochez la case <i>Limiter le nombre de connexions simultanées</i> <br />
#* <i>Nombre maximum de connexions : 1</i><br />
# Cliquez sur <i>OK</i> pour sauvegarder la connexion.<br />
# Testez la connexion.<br />
<br />
== MobaXTerm == <br />
Installez la version 23.1 ou une version plus récente.<br />
<br />
Pour rejoindre un serveur distant, MobaXTerm établit par défaut deux connexions&nbsp;: une première pour le terminal et une seconde pour naviguer dans les fichiers à distance. Puisque le navigateur utilise par défaut le <i>protocole SFTP</i>, votre deuxième facteur d'authentification vous est demandé une seconde fois. Pour éviter ceci, dans l'éditeur SSH, sous l'onglet <i>SSH-browser type</i>, sélectionnez <i>SCP (enhanced speed)</i> ou <i>SCP (normal speed)</i>.<br />
<br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<br />
== PuTTY ==<br />
Installez la version 0.72 ou une version plus récente. <br />
<br />
== WinSCP == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]]. <br />
<br />
== PyCharm == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]].<br />
<br />
== Cyberduck ==<br />
Par défaut, Cyberduck ouvre une nouvelle connexion pour chaque transfert de fichier et vous demande chaque fois votre deuxième facteur. Pour modifier ceci, utilisez les préférences, sous <i>Transferts</i>, onglet <i>Général</i> et dans le denu déroulant de <i>Transférer des fichiers</i>, sélectionnez <i>Utiliser la connexion du navigateur</i>.<br />
<br />
Assurez-vous de ne pas cocher la case pour <i>Téléchargements segmentés avec plusieurs connexions par fichier</i>.<br />
<br />
[[File:CyberduckFRN.png|400px|Configuration pour l'authentification multifacteur]]<br />
<br />
= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo :<br />
<br />
* Pour Android 8 et 9, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* Pour Android 10, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
<br />
Pour validation, les sommes de hachage [https://duo.com/docs/checksums#duo-mobile SHA-256 officielles sont listées ici].<br />
<br />
Pour les instructions d'installation, [https://help.duo.com/s/article/2211?language=en_US voir les détails ici].<br />
<br />
== Je veux désactiver l'authentification multifacteur. Comment dois-je procéder? ==<br />
Cette fonctionnalité sera sous peu obligatoire et elle ne peut pas être désactivée. Nous accordons des exceptions uniquement dans le cas de processus automatisés. Si l'authentification multifacteur vous dérange, nous vous suggérons d'employer une des configurations décrites ci-dessus, selon le client SSH que vous utilisez. Vous trouverez d'autres suggestions dans [[Multifactor_authentication/fr#Webinaires_à_voir|ces webinaires]]. <br />
<br />
== Je n'ai pas de tablette ni de téléphone intelligent assez récent. Comment puis-je utiliser l'authentification multifacteur? ==<br />
Vous pouvez [[Multifactor authentication/fr#Pour_utiliser_une_clé_YubiKey|utiliser une clé YubiKey]].<br />
<br />
== J’ai perdu un appareil que j’utilisais comme deuxième facteur. Que puis-je faire? ==<br />
* Si vous avez configuré plusieurs appareils ou si vous avez généré des codes de contournement, utilisez cette autre méthode pour [https://ccdb.alliancecan.ca/multi_factor_authentications accéder à votre compte]. Dans la liste des appareils enregistrés, supprimez celui que vous avez perdu et enregistrez le nouvel appareil.<br />
* Si vous n’avez sauvegardé aucun code de contournement et que vous n’avez plus aucun des appareils que vous avez configurés, copiez la liste suivante et ajoutez-y le plus de détails possible. Faites parvenir cette information à support@tech.alliancecan.ca. <br />
<br />
Quelle est l’adresse de courriel principale enregistrée dans votre compte?<br />
Depuis combien de temps détenez-vous un compte actif avec nous?<br />
Quel est votre champ de recherche?<br />
Quelle est votre adresse IP? (pour connaître votre adresse IP, [https://whatismyipaddress.com/ cliquez sur ce lien])<br />
Quel est le nom de la chercheuse principale ou du chercheur principal qui vous parraine?<br />
Qui sont les membres de votre groupe?<br />
Avec qui pouvons-nous communiquer au sujet de votre demande?<br />
Quelles sont les grappes que vous utilisez le plus?<br />
Quels sont les modules que vous chargez le plus souvent?<br />
À quand remonte la dernière tâche que vous avez soumise?<br />
Mentionnez les identifiants de certaines de vos tâches les plus récentes.<br />
Décrivez les sujets et donnez les identifiants de vos plus récentes demandes de soutien technique.<br />
<br />
== Quels sont les clients SSH qu'on peut utiliser quand l'authentification multifacteur est configurée? ==<br />
* La plupart des clients SSH en ligne de commande, tels que ceux disponibles sur Linux ou Mac OS<br />
* MobaXTerm (voir les directives ci-dessus)<br />
* PuTTY (voir les directives ci-dessus)<br />
* Termius sur iOS<br />
* FileZilla (voir les directives ci-dessus)<br />
* JuiceSSH sur Android<br />
* WinSCP (voir les directives ci-dessus)<br />
* PyCharm (voir les directives ci-dessus)<br />
* VSCode<br />
* CyberDuck (voir les directives ci-dessus)<br />
<br />
== J'ai besoin de connexions qui se font automatiquement aux grappes à partir de mon compte; est-ce que je peux utiliser l'authentification multifacteur? ==<br />
Cette option est à l'étude, mais aucune solution générale n'est encore implémentée. Si c'est votre cas, évitez de vous inscrire au service d'authentification multifacteur et écrivez au [[Technical support/fr|soutien technique]].<br />
<br />
== Message <i>Access denied. Duo Security does not provide services in your current location</i> ==<br />
Ceci est dû au fait que Duo est un produit des États-Unis (voir [https://help.duo.com/s/article/7544?language=en_US Duo help]). Pour contourner ceci, vous devez utiliser une connexion VPN et faire comme si vous étiez d'un pays à partir duquel l'accès est permis.<br />
<br />
= Fonctions avancées =<br />
== Configurer votre YubiKey pour Yubico OTP via la ligne de commande (<code>ykman</code>)==<br />
# Installez le logiciel de ligne de commande YubiKey Manager (<code>ykman</code>) en suivant les directives pour votre système d'exploitation dans le [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman guide ykman].<br />
# Entrez votre YubiKey et prenez connaissance de l'information sur la clé avec la commande <code>ykman info</code>.<br />
# Prenez connaissance de l'information sur OTP avec la commande <code>ykman otp info</code>.<br />
# Choisissez entre Slot 1 et Slot 2 et lancez la commande <code>ykman otp yubiotp</code> pour programmer l'option.<br />
# <b>Dans un endroit sécuritaire, conservez une copie de l’identifiant public, l’identifiant privé et la clé secrète; ils seront nécessaires à la prochaine étape.</b><br />
# Connectez-vous à la CCDB pour enregistrer votre clé dans la page <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
<br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Multifactor_authentication/52/fr&diff=149519Translations:Multifactor authentication/52/fr2024-01-30T20:46:30Z<p>Plstonge: </p>
<hr />
<div>* Pour Android 8 et 9, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* Pour Android 10, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=149516Multifactor authentication2024-01-30T20:45:50Z<p>Plstonge: Android 8</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approve a notification on a smart device through the Duo Mobile application.<br />
*Enter a code generated on demand.<br />
*Push a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be gradually deployed and will not be immediately available for all of our services.<br />
<br />
= Recorded webinars = <!--T:50--><br />
Two webinars were presented in October 2023. Their recordings are available here: <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (French)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (English)<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== Use a smartphone or tablet == <!--T:3--><br />
<br />
<!--T:46--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Make sure to get the correct application (see icon below). TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are <b>not</b> compatible with Duo and will not scan the QR code.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], log in to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device. Click on <i>Continue</i>. A QR code will be displayed.<br />
#In the Duo Mobile application, tap <i>Set up account</i> or the “+” sign.<br />
#Tap <i>Use a QR code</i>.<br />
#Scan the QR code shown to you in CCDB. <b>Important: Make sure that your mobile device is connected to the internet (over wi-fi or cellular data) while you are scanning the QR code.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Step 1<br />
File:Duo-mobile-option.png|Step 3<br />
File:Naming-duo-mobile-device.png|Step 4<br />
File:Duo-mobile-add-account.png|Step 5<br />
File:Duo-mobile-scan-qr-code.png|Step 6<br />
File:Scanning-CCDB-QR-code.jpg|Step 7<br />
</gallery><br />
<br />
== Use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey is your best option.<br />
<br />
<!--T:45--><br />
<b>Note that some YubiKey models are [https://help.duo.com/s/article/2166?language=en_US not compatible]. We recommend using the YubiKey 5 Series.</b><br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Multiple protocols are supported by YubiKeys. Our clusters use the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates a string of 32 characters to complete your authentication. Using a YubiKey does not require any typing on the keyboard: the YubiKey connected to your computer “types” the 32-character string when you touch its button.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1 to 2.5 seconds), while slot 2 is a long touch on the key (pressing for 3 to 5 seconds). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce how frequently you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui install OpenSSH]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specific to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or later.<br />
<br />
<!--T:43--><br />
When connecting to a remote server, MobaXterm establishes two connections by default:<br />
the first for the terminal and the second for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
<br />
</translate><br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<translate><br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or later. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
== Cyberduck == <!--T:47--><br />
By default, Cyberduck opens a new connection for every file transfer, prompting you for your second factor each time. To change this, go in the application's preferences, under <i>Transfers</i>, in the <i>General</i> section, use the drop-down menu beside the <i>Transfer Files</i> item and select <i>Use browser connection</i>.<br />
<br />
<!--T:48--><br />
Then, ensure that the box beside <i>Segmented downloads with multiple connections per file</i> is not checked. It should look like the picture below.<br />
<br />
<!--T:49--><br />
[[File:CyberDuck configuration for multifactor authentication.png|400px|Cyberduck configuration for multifactor authentication]]<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an older Android phone and I cannot download the Duo Mobile application from the Google Play site. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website:<br />
<br />
<!--T:52--><br />
* For Android 8 and 9, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* For Android 10, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
<br />
<!--T:53--><br />
For validation, official [https://duo.com/docs/checksums#duo-mobile SHA-256 checksums are listed here].<br />
<br />
<!--T:54--><br />
For installation instructions, [https://help.duo.com/s/article/2211?language=en_US see this page].<br />
<br />
== I want to disable multifactor authentication. How do I do this? == <!--T:51--><br />
Multifactor authentication will become mandatory in the near future; therefore, users cannot disable it. Exceptions can only be granted for automation purposes. If you find that multifactor authentication is annoying, we recommend applying one of the configurations listed above, depending on the SSH client you are using. Our [[Multifactor_authentication#Recorded_webinars|recorded webinars]] also contain many tips on how to make MFA less burdensome to use. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
* CyberDuck (see instructions above)<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering options to implement for automation, but we do not have a solution yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
== What should I do when I receive the message "Access denied. Duo Security does not provide services in your current location" ? == <!--T:44--><br />
This is a consequence of Duo being a US product: [https://help.duo.com/s/article/7544?language=en_US Duo help]. You'll need to use a VPN to circumvent this, to make it appear you're coming from an unaffected country.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication/fr&diff=149515Multifactor authentication/fr2024-01-30T20:39:09Z<p>Plstonge: Created page with "* Pour Android 9, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk] * Pour Android 10, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]"</p>
<hr />
<div><languages /><br />
<br />
<br />
L’authentification multifacteur permet de protéger votre compte avec plus qu’un simple mot de passe. Une fois que votre compte est configuré pour utiliser cette fonctionnalité, vous devrez entrer votre mot de passe comme d’habitude, mais en plus effectuer une deuxième action (le <i>deuxième facteur</i>), pour avoir accès à la plupart de nos services.<br />
<br />
Sélectionnez cette deuxième étape d’authentification parmi ces facteurs&nbsp;:<br />
*accepter une notification sur votre appareil intelligent dans l’application Duo Mobile;<br />
*entrer un code généré sur demande;<br />
*presser un bouton sur une clé matérielle (YubiKey).<br><br />
<br />
L’authentification multifacteur sera déployée graduellement. Cette fonctionnalité ne sera donc pas disponible immédiatement pour tous nos services.<br />
<br />
= Webinaires à voir =<br />
Ces deux webinaires ont été enregistrés en octobre 2023 : <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (en français)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (en anglais)<br />
<br />
= Enregistrement des facteurs =<br />
== Enregistrer plusieurs facteurs ==<br />
Lorsque vous activez l'authentification multifacteur pour votre compte, nous vous <b>recommandons fortement</b> d’enregistrer au moins deux options pour votre deuxième facteur. Vous pouvez par exemple vous servir de votre téléphone et de codes à usage unique; de votre téléphone et d’une clé YubiKey; ou encore de deux clés YubiKey. De cette façon, si une de ces options ne peut pas être employée, vous aurez un autre facteur pour accéder à votre compte.<br />
<br />
== Utiliser un téléphone ou une tablette ==<br />
<br />
#Installez l'application Duo Mobile à partir du [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] ou de [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Assurez-vous d'avoir la bonne application (voir l'icône ci-dessous). Les applications TOTP comme Aegis, Google Authenticator et Microsoft Authenticator <b>ne sont pas compatibles</b> avec Duo et ne peuvent pas balayer le code QR.<br />
#Connectez-vous à votre compte et cliquez sur <i>Mon compte → [https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
#Sous <i>Enregistrer un appareil</i>, cliquez sur <i>Duo Mobile</i>.<br />
#Entrez un nom pour identifier votre appareil. Cliquez sur <i>Continuer</i> pour faire afficher un code QR. <br />
#Dans l'application Duo Mobile, cliquez sur le signe <b>+</b> ou sur <i>Ajouter un compte</i>.<br />
#Touchez <i>Utiliser un code QR</i>.<br />
#Balayez le code QR qui est affiché dans CCDB. <b>Important : Pour balayer le code QR, votre appareil doit avoir accès à l'internet par wi-fi ou par réseau cellulaire.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Étape 1<br />
File:Duo-mobile-option.png|Étape 3<br />
File:Naming-duo-mobile-device.png|Étape 4<br />
File:Duo-mobile-add-account.png|Étape 5<br />
File:Duo-mobile-scan-qr-code.png|Étape 6<br />
File:Scanning-CCDB-QR-code.jpg|Étape 7<br />
</gallery><br />
<br />
== Utiliser une clé YubiKey 5 ==<br />
Les YubiKey sont des clés matérielles produites par [https://www.yubico.com/ Yubico]. Si vous n'avez pas de téléphone intelligent ou de tablette, si vous ne voulez pas employer ces appareils pour l'authentification multifacteur, ou s'il vous est souvent impossible de les utiliser, une clé YubiKey 5 serait votre meilleur choix.<br />
<br />
<b>Notez que certains modèles [https://help.duo.com/s/article/2166?language=en_US ne sont pas compatibles]; nous recommandons YubiKey, série 5.</b><br />
<br />
De la taille d’une petite clé USB, les clés YubiKey 5 coûtent entre 50 et 100 dollars. Différents modèles sont compatibles avec les ports USB-A, USB-C et Lightning et certaines permettent la communication en champ proche (NFC) avec un téléphone ou une tablette.<br />
<br />
YubiKeys supporte plusieurs protocoles. Nos grappes utilisent Yubico OTP (<i>one-time password</i>). Une fois que votre clé est enregistrée à votre compte comme facteur d'authentification, quand vous tenterez de vous connecter à une de nos grappes, on vous demandera d'entrer un mot de passe à utilisation unique (OTP). Vous appuyez alors sur le bouton de la clé, ce qui génère une chaîne de 32 caractères qui forme un mot de passe à entrer. Vous n'avez pas besoin du clavier; la clé se connecte à votre ordinateur et entre elle-même la chaîne de 32 caractères quand vous touchez le bouton.<br />
<br />
Pour enregistrer votre YubiKey, entrez son identifiant public, son identifiant privé et sa clé secrète dans la page <i>[https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>. Si ces renseignements ne sont pas disponibles, configurez votre clé comme suit.<br />
<br />
=== Configurer votre YubiKey pour Yubico OTP ===<br />
<br />
# Téléchargez et installez YubiKey Manager à partir du [https://www.yubico.com/support/download/yubikey-manager/ site Web de Yubico].<br />
# Insérez la clé YubiKey et lancez YubiKey Manager.<br />
# Dans YubiKey Manager, cliquez sur <i>Applications</i> puis sur <i>OTP</i> (voir les images ci-dessous).<br />
# Vous pouvez ici configurer l'une de deux options. <i>Short Touch (Slot 1)</i> identifie une touche brève (de 1 à 2,5 secondes) et <i>Long Touch (Slot 2)</i> correspond à une touche plus longue (de 3 à 5 secondes). L'option numéro 1 est généralement préenregistrée pour Yubico Cloud. Si vous utilisez déjà cette option pour d'autres services, configurez plutôt l'option 2, ou cliquez sur <i>Swap</i> pour transférer la configuration de l'option 1 vers l'option 2, puis configurer l'option 1. <br />
# Sélectionnez <i>Yubico OTP</i>.<br />
# Sélectionnez <i>Use serial</i> pour générer un identifiant privé et une clé secrète. <b>Faites une copie des deux identifiants et de la clé secrète avant de cliquer sur <i>Finish</i> parce que vous en aurez besoin à la prochaine étape</b>. Gardez cette fenêtre ouverte.<br />
# <b>IMPORTANT: Assurez-vous d'avoir cliqué sur <i>Finish</i> à l'étape précédente.</b><br />
# Connectez-vous à la CCDB et cliquez sur <i>Mon compte → [https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i> pour entrer les données pour votre clé.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Étape 3<br />
File:Yubico Manager OTP configuration.png|Étape 4<br />
File:Select Yubico OTP.png|Étape 5<br />
File:Generate Yubikey IDs.png|Étapes 6 et 7<br />
CCDB Yubikeys.png|Étape 8<br />
</gallery><br />
<br />
= Authentification =<br />
== Pour vous connecter à une grappe via SSH == <br />
Si l'authentification multifacteur est activée pour votre compte et que vous vous connectez via SSH à une grappe qui supporte cette fonctionnalité, vous devez d’abord passer la première authentification avec votre mot de passe ou avec votre [[SSH Keys/fr|clé SSH]]. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):}}<br />
<br />
Vous pouvez maintenant indiquer le téléphone ou la tablette qui recevra une notification de la part de Duo. Si vous avez enregistré plusieurs appareils, une liste sera affichée, dans laquelle vous pouvez sélectionner l'appareil de votre choix. Vous n'avez qu'à accepter la notification pour confirmer votre deuxième authentification.<br />
<br />
Si vous utilisez une YubiKey ou un code préalablement sauvegardé, ou encore si vous préférez entrer le mot de passe unique valide pour une durée limitée que Duo Mobile affiche, ne sélectionnez pas une option, mais entrez le code, par exemple <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Passer outre à la deuxième authentification===<br />
Si vous vous connectez avec OpenSSH, vous pouvez configurer votre client SSH pour diminuer la fréquence à laquelle vous devez utiliser la deuxième authentification. Modifiez <code>.ssh/config</code> en ajoutant les lignes suivantes&nbsp;:<br />
<br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
Remplacez <code>HOSTNAME</code> par le hostname du serveur que vous voulez configurer.<br />
<br />
Si vous utilisez Windows, vous pouvez installer OpenSSH en suivant les [https://learn.microsoft.com/fr-ca/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui directives pour installer OpenSSH]. Vous n'avez besoin d'installer que le client.<br />
<br />
== Pour vous connecter à votre compte ==<br />
Si l'authentification multifacteur est activée pour votre compte, vous devez d’abord passer la première authentification avec votre nom d'utilisateur et votre mot de passe. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
<br><br />
(Remarque : <i>Ceci n'est pas la fenêtre finale</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuration de clients SSH courants =<br />
Les clients ligne de commande prennent généralement en charge l'authentification multifacteur sans plus de configuration. Par contre, ce n'est souvent pas le cas pour les clients graphiques. Vous trouverez ci-dessous des directives spécifiques à quelques-uns d’entre eux. <br />
<br />
== FileZilla == <br />
FileZilla demande le mot de passe et le deuxième facteur chaque fois qu'un transfert est initié puisque par défaut, les transferts utilisent des connexions distinctes qui sont automatiquement fermées après un certain temps d'inactivité.<br />
<br />
Pour ne pas avoir à saisir plusieurs fois le mot de passe et le deuxième facteur, vous pouvez limiter le nombre de connexions à chaque site à «&nbsp;1&nbsp;» dans <i>Site Manager => Paramètres de transfert</i>; prenez note que vous perdrez ainsi la possibilité de parcourir le serveur lors des transferts.<br />
<br />
# Lancez FileZilla et sélectionnez <i>Gestionnaire de Sites</i>.<br />
# Dans <i>Gestionnaire de Sites</i>, modifiez un site existant ou créez un nouveau site.<br />
# Sous l'onglet <i>Général</i>, entrez les choix suivants&nbsp;:<br />
#* <i>Protocole : SFTP – SSH File Transfer Protocol</i><br />
#* <i>Hôte :</i> [nom de l'hôte pour la grappe de connexion]<br />
#* <i>Type d'authentification : Interactive</i><br />
#* <i>Identifiant :</i> [votre nom d'utilisateur]<br />
# Sous l'onglet <i>Paramètres de transfert</i>&nbsp;:<br />
#* cochez la case <i>Limiter le nombre de connexions simultanées</i> <br />
#* <i>Nombre maximum de connexions : 1</i><br />
# Cliquez sur <i>OK</i> pour sauvegarder la connexion.<br />
# Testez la connexion.<br />
<br />
== MobaXTerm == <br />
Installez la version 23.1 ou une version plus récente.<br />
<br />
Pour rejoindre un serveur distant, MobaXTerm établit par défaut deux connexions&nbsp;: une première pour le terminal et une seconde pour naviguer dans les fichiers à distance. Puisque le navigateur utilise par défaut le <i>protocole SFTP</i>, votre deuxième facteur d'authentification vous est demandé une seconde fois. Pour éviter ceci, dans l'éditeur SSH, sous l'onglet <i>SSH-browser type</i>, sélectionnez <i>SCP (enhanced speed)</i> ou <i>SCP (normal speed)</i>.<br />
<br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<br />
== PuTTY ==<br />
Installez la version 0.72 ou une version plus récente. <br />
<br />
== WinSCP == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]]. <br />
<br />
== PyCharm == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]].<br />
<br />
== Cyberduck ==<br />
Par défaut, Cyberduck ouvre une nouvelle connexion pour chaque transfert de fichier et vous demande chaque fois votre deuxième facteur. Pour modifier ceci, utilisez les préférences, sous <i>Transferts</i>, onglet <i>Général</i> et dans le denu déroulant de <i>Transférer des fichiers</i>, sélectionnez <i>Utiliser la connexion du navigateur</i>.<br />
<br />
Assurez-vous de ne pas cocher la case pour <i>Téléchargements segmentés avec plusieurs connexions par fichier</i>.<br />
<br />
[[File:CyberduckFRN.png|400px|Configuration pour l'authentification multifacteur]]<br />
<br />
= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo :<br />
<br />
* Pour Android 9, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* Pour Android 10, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
<br />
Pour validation, les sommes de hachage [https://duo.com/docs/checksums#duo-mobile SHA-256 officielles sont listées ici].<br />
<br />
Pour les instructions d'installation, [https://help.duo.com/s/article/2211?language=en_US voir les détails ici].<br />
<br />
== Je veux désactiver l'authentification multifacteur. Comment dois-je procéder? ==<br />
Cette fonctionnalité sera sous peu obligatoire et elle ne peut pas être désactivée. Nous accordons des exceptions uniquement dans le cas de processus automatisés. Si l'authentification multifacteur vous dérange, nous vous suggérons d'employer une des configurations décrites ci-dessus, selon le client SSH que vous utilisez. Vous trouverez d'autres suggestions dans [[Multifactor_authentication/fr#Webinaires_à_voir|ces webinaires]]. <br />
<br />
== Je n'ai pas de tablette ni de téléphone intelligent assez récent. Comment puis-je utiliser l'authentification multifacteur? ==<br />
Vous pouvez [[Multifactor authentication/fr#Pour_utiliser_une_clé_YubiKey|utiliser une clé YubiKey]].<br />
<br />
== J’ai perdu un appareil que j’utilisais comme deuxième facteur. Que puis-je faire? ==<br />
* Si vous avez configuré plusieurs appareils ou si vous avez généré des codes de contournement, utilisez cette autre méthode pour [https://ccdb.alliancecan.ca/multi_factor_authentications accéder à votre compte]. Dans la liste des appareils enregistrés, supprimez celui que vous avez perdu et enregistrez le nouvel appareil.<br />
* Si vous n’avez sauvegardé aucun code de contournement et que vous n’avez plus aucun des appareils que vous avez configurés, copiez la liste suivante et ajoutez-y le plus de détails possible. Faites parvenir cette information à support@tech.alliancecan.ca. <br />
<br />
Quelle est l’adresse de courriel principale enregistrée dans votre compte?<br />
Depuis combien de temps détenez-vous un compte actif avec nous?<br />
Quel est votre champ de recherche?<br />
Quelle est votre adresse IP? (pour connaître votre adresse IP, [https://whatismyipaddress.com/ cliquez sur ce lien])<br />
Quel est le nom de la chercheuse principale ou du chercheur principal qui vous parraine?<br />
Qui sont les membres de votre groupe?<br />
Avec qui pouvons-nous communiquer au sujet de votre demande?<br />
Quelles sont les grappes que vous utilisez le plus?<br />
Quels sont les modules que vous chargez le plus souvent?<br />
À quand remonte la dernière tâche que vous avez soumise?<br />
Mentionnez les identifiants de certaines de vos tâches les plus récentes.<br />
Décrivez les sujets et donnez les identifiants de vos plus récentes demandes de soutien technique.<br />
<br />
== Quels sont les clients SSH qu'on peut utiliser quand l'authentification multifacteur est configurée? ==<br />
* La plupart des clients SSH en ligne de commande, tels que ceux disponibles sur Linux ou Mac OS<br />
* MobaXTerm (voir les directives ci-dessus)<br />
* PuTTY (voir les directives ci-dessus)<br />
* Termius sur iOS<br />
* FileZilla (voir les directives ci-dessus)<br />
* JuiceSSH sur Android<br />
* WinSCP (voir les directives ci-dessus)<br />
* PyCharm (voir les directives ci-dessus)<br />
* VSCode<br />
* CyberDuck (voir les directives ci-dessus)<br />
<br />
== J'ai besoin de connexions qui se font automatiquement aux grappes à partir de mon compte; est-ce que je peux utiliser l'authentification multifacteur? ==<br />
Cette option est à l'étude, mais aucune solution générale n'est encore implémentée. Si c'est votre cas, évitez de vous inscrire au service d'authentification multifacteur et écrivez au [[Technical support/fr|soutien technique]].<br />
<br />
== Message <i>Access denied. Duo Security does not provide services in your current location</i> ==<br />
Ceci est dû au fait que Duo est un produit des États-Unis (voir [https://help.duo.com/s/article/7544?language=en_US Duo help]). Pour contourner ceci, vous devez utiliser une connexion VPN et faire comme si vous étiez d'un pays à partir duquel l'accès est permis.<br />
<br />
= Fonctions avancées =<br />
== Configurer votre YubiKey pour Yubico OTP via la ligne de commande (<code>ykman</code>)==<br />
# Installez le logiciel de ligne de commande YubiKey Manager (<code>ykman</code>) en suivant les directives pour votre système d'exploitation dans le [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman guide ykman].<br />
# Entrez votre YubiKey et prenez connaissance de l'information sur la clé avec la commande <code>ykman info</code>.<br />
# Prenez connaissance de l'information sur OTP avec la commande <code>ykman otp info</code>.<br />
# Choisissez entre Slot 1 et Slot 2 et lancez la commande <code>ykman otp yubiotp</code> pour programmer l'option.<br />
# <b>Dans un endroit sécuritaire, conservez une copie de l’identifiant public, l’identifiant privé et la clé secrète; ils seront nécessaires à la prochaine étape.</b><br />
# Connectez-vous à la CCDB pour enregistrer votre clé dans la page <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
<br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Multifactor_authentication/52/fr&diff=149514Translations:Multifactor authentication/52/fr2024-01-30T20:39:08Z<p>Plstonge: Created page with "* Pour Android 9, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk] * Pour Android 10, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]"</p>
<hr />
<div>* Pour Android 9, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* Pour Android 10, la dernière version compatible est [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication/fr&diff=149513Multifactor authentication/fr2024-01-30T20:38:38Z<p>Plstonge: Created page with "Pour validation, les sommes de hachage [https://duo.com/docs/checksums#duo-mobile SHA-256 officielles sont listées ici]."</p>
<hr />
<div><languages /><br />
<br />
<br />
L’authentification multifacteur permet de protéger votre compte avec plus qu’un simple mot de passe. Une fois que votre compte est configuré pour utiliser cette fonctionnalité, vous devrez entrer votre mot de passe comme d’habitude, mais en plus effectuer une deuxième action (le <i>deuxième facteur</i>), pour avoir accès à la plupart de nos services.<br />
<br />
Sélectionnez cette deuxième étape d’authentification parmi ces facteurs&nbsp;:<br />
*accepter une notification sur votre appareil intelligent dans l’application Duo Mobile;<br />
*entrer un code généré sur demande;<br />
*presser un bouton sur une clé matérielle (YubiKey).<br><br />
<br />
L’authentification multifacteur sera déployée graduellement. Cette fonctionnalité ne sera donc pas disponible immédiatement pour tous nos services.<br />
<br />
= Webinaires à voir =<br />
Ces deux webinaires ont été enregistrés en octobre 2023 : <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (en français)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (en anglais)<br />
<br />
= Enregistrement des facteurs =<br />
== Enregistrer plusieurs facteurs ==<br />
Lorsque vous activez l'authentification multifacteur pour votre compte, nous vous <b>recommandons fortement</b> d’enregistrer au moins deux options pour votre deuxième facteur. Vous pouvez par exemple vous servir de votre téléphone et de codes à usage unique; de votre téléphone et d’une clé YubiKey; ou encore de deux clés YubiKey. De cette façon, si une de ces options ne peut pas être employée, vous aurez un autre facteur pour accéder à votre compte.<br />
<br />
== Utiliser un téléphone ou une tablette ==<br />
<br />
#Installez l'application Duo Mobile à partir du [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] ou de [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Assurez-vous d'avoir la bonne application (voir l'icône ci-dessous). Les applications TOTP comme Aegis, Google Authenticator et Microsoft Authenticator <b>ne sont pas compatibles</b> avec Duo et ne peuvent pas balayer le code QR.<br />
#Connectez-vous à votre compte et cliquez sur <i>Mon compte → [https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
#Sous <i>Enregistrer un appareil</i>, cliquez sur <i>Duo Mobile</i>.<br />
#Entrez un nom pour identifier votre appareil. Cliquez sur <i>Continuer</i> pour faire afficher un code QR. <br />
#Dans l'application Duo Mobile, cliquez sur le signe <b>+</b> ou sur <i>Ajouter un compte</i>.<br />
#Touchez <i>Utiliser un code QR</i>.<br />
#Balayez le code QR qui est affiché dans CCDB. <b>Important : Pour balayer le code QR, votre appareil doit avoir accès à l'internet par wi-fi ou par réseau cellulaire.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Étape 1<br />
File:Duo-mobile-option.png|Étape 3<br />
File:Naming-duo-mobile-device.png|Étape 4<br />
File:Duo-mobile-add-account.png|Étape 5<br />
File:Duo-mobile-scan-qr-code.png|Étape 6<br />
File:Scanning-CCDB-QR-code.jpg|Étape 7<br />
</gallery><br />
<br />
== Utiliser une clé YubiKey 5 ==<br />
Les YubiKey sont des clés matérielles produites par [https://www.yubico.com/ Yubico]. Si vous n'avez pas de téléphone intelligent ou de tablette, si vous ne voulez pas employer ces appareils pour l'authentification multifacteur, ou s'il vous est souvent impossible de les utiliser, une clé YubiKey 5 serait votre meilleur choix.<br />
<br />
<b>Notez que certains modèles [https://help.duo.com/s/article/2166?language=en_US ne sont pas compatibles]; nous recommandons YubiKey, série 5.</b><br />
<br />
De la taille d’une petite clé USB, les clés YubiKey 5 coûtent entre 50 et 100 dollars. Différents modèles sont compatibles avec les ports USB-A, USB-C et Lightning et certaines permettent la communication en champ proche (NFC) avec un téléphone ou une tablette.<br />
<br />
YubiKeys supporte plusieurs protocoles. Nos grappes utilisent Yubico OTP (<i>one-time password</i>). Une fois que votre clé est enregistrée à votre compte comme facteur d'authentification, quand vous tenterez de vous connecter à une de nos grappes, on vous demandera d'entrer un mot de passe à utilisation unique (OTP). Vous appuyez alors sur le bouton de la clé, ce qui génère une chaîne de 32 caractères qui forme un mot de passe à entrer. Vous n'avez pas besoin du clavier; la clé se connecte à votre ordinateur et entre elle-même la chaîne de 32 caractères quand vous touchez le bouton.<br />
<br />
Pour enregistrer votre YubiKey, entrez son identifiant public, son identifiant privé et sa clé secrète dans la page <i>[https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>. Si ces renseignements ne sont pas disponibles, configurez votre clé comme suit.<br />
<br />
=== Configurer votre YubiKey pour Yubico OTP ===<br />
<br />
# Téléchargez et installez YubiKey Manager à partir du [https://www.yubico.com/support/download/yubikey-manager/ site Web de Yubico].<br />
# Insérez la clé YubiKey et lancez YubiKey Manager.<br />
# Dans YubiKey Manager, cliquez sur <i>Applications</i> puis sur <i>OTP</i> (voir les images ci-dessous).<br />
# Vous pouvez ici configurer l'une de deux options. <i>Short Touch (Slot 1)</i> identifie une touche brève (de 1 à 2,5 secondes) et <i>Long Touch (Slot 2)</i> correspond à une touche plus longue (de 3 à 5 secondes). L'option numéro 1 est généralement préenregistrée pour Yubico Cloud. Si vous utilisez déjà cette option pour d'autres services, configurez plutôt l'option 2, ou cliquez sur <i>Swap</i> pour transférer la configuration de l'option 1 vers l'option 2, puis configurer l'option 1. <br />
# Sélectionnez <i>Yubico OTP</i>.<br />
# Sélectionnez <i>Use serial</i> pour générer un identifiant privé et une clé secrète. <b>Faites une copie des deux identifiants et de la clé secrète avant de cliquer sur <i>Finish</i> parce que vous en aurez besoin à la prochaine étape</b>. Gardez cette fenêtre ouverte.<br />
# <b>IMPORTANT: Assurez-vous d'avoir cliqué sur <i>Finish</i> à l'étape précédente.</b><br />
# Connectez-vous à la CCDB et cliquez sur <i>Mon compte → [https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i> pour entrer les données pour votre clé.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Étape 3<br />
File:Yubico Manager OTP configuration.png|Étape 4<br />
File:Select Yubico OTP.png|Étape 5<br />
File:Generate Yubikey IDs.png|Étapes 6 et 7<br />
CCDB Yubikeys.png|Étape 8<br />
</gallery><br />
<br />
= Authentification =<br />
== Pour vous connecter à une grappe via SSH == <br />
Si l'authentification multifacteur est activée pour votre compte et que vous vous connectez via SSH à une grappe qui supporte cette fonctionnalité, vous devez d’abord passer la première authentification avec votre mot de passe ou avec votre [[SSH Keys/fr|clé SSH]]. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):}}<br />
<br />
Vous pouvez maintenant indiquer le téléphone ou la tablette qui recevra une notification de la part de Duo. Si vous avez enregistré plusieurs appareils, une liste sera affichée, dans laquelle vous pouvez sélectionner l'appareil de votre choix. Vous n'avez qu'à accepter la notification pour confirmer votre deuxième authentification.<br />
<br />
Si vous utilisez une YubiKey ou un code préalablement sauvegardé, ou encore si vous préférez entrer le mot de passe unique valide pour une durée limitée que Duo Mobile affiche, ne sélectionnez pas une option, mais entrez le code, par exemple <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Passer outre à la deuxième authentification===<br />
Si vous vous connectez avec OpenSSH, vous pouvez configurer votre client SSH pour diminuer la fréquence à laquelle vous devez utiliser la deuxième authentification. Modifiez <code>.ssh/config</code> en ajoutant les lignes suivantes&nbsp;:<br />
<br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
Remplacez <code>HOSTNAME</code> par le hostname du serveur que vous voulez configurer.<br />
<br />
Si vous utilisez Windows, vous pouvez installer OpenSSH en suivant les [https://learn.microsoft.com/fr-ca/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui directives pour installer OpenSSH]. Vous n'avez besoin d'installer que le client.<br />
<br />
== Pour vous connecter à votre compte ==<br />
Si l'authentification multifacteur est activée pour votre compte, vous devez d’abord passer la première authentification avec votre nom d'utilisateur et votre mot de passe. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
<br><br />
(Remarque : <i>Ceci n'est pas la fenêtre finale</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuration de clients SSH courants =<br />
Les clients ligne de commande prennent généralement en charge l'authentification multifacteur sans plus de configuration. Par contre, ce n'est souvent pas le cas pour les clients graphiques. Vous trouverez ci-dessous des directives spécifiques à quelques-uns d’entre eux. <br />
<br />
== FileZilla == <br />
FileZilla demande le mot de passe et le deuxième facteur chaque fois qu'un transfert est initié puisque par défaut, les transferts utilisent des connexions distinctes qui sont automatiquement fermées après un certain temps d'inactivité.<br />
<br />
Pour ne pas avoir à saisir plusieurs fois le mot de passe et le deuxième facteur, vous pouvez limiter le nombre de connexions à chaque site à «&nbsp;1&nbsp;» dans <i>Site Manager => Paramètres de transfert</i>; prenez note que vous perdrez ainsi la possibilité de parcourir le serveur lors des transferts.<br />
<br />
# Lancez FileZilla et sélectionnez <i>Gestionnaire de Sites</i>.<br />
# Dans <i>Gestionnaire de Sites</i>, modifiez un site existant ou créez un nouveau site.<br />
# Sous l'onglet <i>Général</i>, entrez les choix suivants&nbsp;:<br />
#* <i>Protocole : SFTP – SSH File Transfer Protocol</i><br />
#* <i>Hôte :</i> [nom de l'hôte pour la grappe de connexion]<br />
#* <i>Type d'authentification : Interactive</i><br />
#* <i>Identifiant :</i> [votre nom d'utilisateur]<br />
# Sous l'onglet <i>Paramètres de transfert</i>&nbsp;:<br />
#* cochez la case <i>Limiter le nombre de connexions simultanées</i> <br />
#* <i>Nombre maximum de connexions : 1</i><br />
# Cliquez sur <i>OK</i> pour sauvegarder la connexion.<br />
# Testez la connexion.<br />
<br />
== MobaXTerm == <br />
Installez la version 23.1 ou une version plus récente.<br />
<br />
Pour rejoindre un serveur distant, MobaXTerm établit par défaut deux connexions&nbsp;: une première pour le terminal et une seconde pour naviguer dans les fichiers à distance. Puisque le navigateur utilise par défaut le <i>protocole SFTP</i>, votre deuxième facteur d'authentification vous est demandé une seconde fois. Pour éviter ceci, dans l'éditeur SSH, sous l'onglet <i>SSH-browser type</i>, sélectionnez <i>SCP (enhanced speed)</i> ou <i>SCP (normal speed)</i>.<br />
<br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<br />
== PuTTY ==<br />
Installez la version 0.72 ou une version plus récente. <br />
<br />
== WinSCP == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]]. <br />
<br />
== PyCharm == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]].<br />
<br />
== Cyberduck ==<br />
Par défaut, Cyberduck ouvre une nouvelle connexion pour chaque transfert de fichier et vous demande chaque fois votre deuxième facteur. Pour modifier ceci, utilisez les préférences, sous <i>Transferts</i>, onglet <i>Général</i> et dans le denu déroulant de <i>Transférer des fichiers</i>, sélectionnez <i>Utiliser la connexion du navigateur</i>.<br />
<br />
Assurez-vous de ne pas cocher la case pour <i>Téléchargements segmentés avec plusieurs connexions par fichier</i>.<br />
<br />
[[File:CyberduckFRN.png|400px|Configuration pour l'authentification multifacteur]]<br />
<br />
= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo :<br />
<br />
<div lang="en" dir="ltr" class="mw-content-ltr"><br />
* For Android 9, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* For Android 10, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
</div><br />
<br />
Pour validation, les sommes de hachage [https://duo.com/docs/checksums#duo-mobile SHA-256 officielles sont listées ici].<br />
<br />
Pour les instructions d'installation, [https://help.duo.com/s/article/2211?language=en_US voir les détails ici].<br />
<br />
== Je veux désactiver l'authentification multifacteur. Comment dois-je procéder? ==<br />
Cette fonctionnalité sera sous peu obligatoire et elle ne peut pas être désactivée. Nous accordons des exceptions uniquement dans le cas de processus automatisés. Si l'authentification multifacteur vous dérange, nous vous suggérons d'employer une des configurations décrites ci-dessus, selon le client SSH que vous utilisez. Vous trouverez d'autres suggestions dans [[Multifactor_authentication/fr#Webinaires_à_voir|ces webinaires]]. <br />
<br />
== Je n'ai pas de tablette ni de téléphone intelligent assez récent. Comment puis-je utiliser l'authentification multifacteur? ==<br />
Vous pouvez [[Multifactor authentication/fr#Pour_utiliser_une_clé_YubiKey|utiliser une clé YubiKey]].<br />
<br />
== J’ai perdu un appareil que j’utilisais comme deuxième facteur. Que puis-je faire? ==<br />
* Si vous avez configuré plusieurs appareils ou si vous avez généré des codes de contournement, utilisez cette autre méthode pour [https://ccdb.alliancecan.ca/multi_factor_authentications accéder à votre compte]. Dans la liste des appareils enregistrés, supprimez celui que vous avez perdu et enregistrez le nouvel appareil.<br />
* Si vous n’avez sauvegardé aucun code de contournement et que vous n’avez plus aucun des appareils que vous avez configurés, copiez la liste suivante et ajoutez-y le plus de détails possible. Faites parvenir cette information à support@tech.alliancecan.ca. <br />
<br />
Quelle est l’adresse de courriel principale enregistrée dans votre compte?<br />
Depuis combien de temps détenez-vous un compte actif avec nous?<br />
Quel est votre champ de recherche?<br />
Quelle est votre adresse IP? (pour connaître votre adresse IP, [https://whatismyipaddress.com/ cliquez sur ce lien])<br />
Quel est le nom de la chercheuse principale ou du chercheur principal qui vous parraine?<br />
Qui sont les membres de votre groupe?<br />
Avec qui pouvons-nous communiquer au sujet de votre demande?<br />
Quelles sont les grappes que vous utilisez le plus?<br />
Quels sont les modules que vous chargez le plus souvent?<br />
À quand remonte la dernière tâche que vous avez soumise?<br />
Mentionnez les identifiants de certaines de vos tâches les plus récentes.<br />
Décrivez les sujets et donnez les identifiants de vos plus récentes demandes de soutien technique.<br />
<br />
== Quels sont les clients SSH qu'on peut utiliser quand l'authentification multifacteur est configurée? ==<br />
* La plupart des clients SSH en ligne de commande, tels que ceux disponibles sur Linux ou Mac OS<br />
* MobaXTerm (voir les directives ci-dessus)<br />
* PuTTY (voir les directives ci-dessus)<br />
* Termius sur iOS<br />
* FileZilla (voir les directives ci-dessus)<br />
* JuiceSSH sur Android<br />
* WinSCP (voir les directives ci-dessus)<br />
* PyCharm (voir les directives ci-dessus)<br />
* VSCode<br />
* CyberDuck (voir les directives ci-dessus)<br />
<br />
== J'ai besoin de connexions qui se font automatiquement aux grappes à partir de mon compte; est-ce que je peux utiliser l'authentification multifacteur? ==<br />
Cette option est à l'étude, mais aucune solution générale n'est encore implémentée. Si c'est votre cas, évitez de vous inscrire au service d'authentification multifacteur et écrivez au [[Technical support/fr|soutien technique]].<br />
<br />
== Message <i>Access denied. Duo Security does not provide services in your current location</i> ==<br />
Ceci est dû au fait que Duo est un produit des États-Unis (voir [https://help.duo.com/s/article/7544?language=en_US Duo help]). Pour contourner ceci, vous devez utiliser une connexion VPN et faire comme si vous étiez d'un pays à partir duquel l'accès est permis.<br />
<br />
= Fonctions avancées =<br />
== Configurer votre YubiKey pour Yubico OTP via la ligne de commande (<code>ykman</code>)==<br />
# Installez le logiciel de ligne de commande YubiKey Manager (<code>ykman</code>) en suivant les directives pour votre système d'exploitation dans le [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman guide ykman].<br />
# Entrez votre YubiKey et prenez connaissance de l'information sur la clé avec la commande <code>ykman info</code>.<br />
# Prenez connaissance de l'information sur OTP avec la commande <code>ykman otp info</code>.<br />
# Choisissez entre Slot 1 et Slot 2 et lancez la commande <code>ykman otp yubiotp</code> pour programmer l'option.<br />
# <b>Dans un endroit sécuritaire, conservez une copie de l’identifiant public, l’identifiant privé et la clé secrète; ils seront nécessaires à la prochaine étape.</b><br />
# Connectez-vous à la CCDB pour enregistrer votre clé dans la page <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
<br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Multifactor_authentication/53/fr&diff=149512Translations:Multifactor authentication/53/fr2024-01-30T20:38:25Z<p>Plstonge: Created page with "Pour validation, les sommes de hachage [https://duo.com/docs/checksums#duo-mobile SHA-256 officielles sont listées ici]."</p>
<hr />
<div>Pour validation, les sommes de hachage [https://duo.com/docs/checksums#duo-mobile SHA-256 officielles sont listées ici].</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication/fr&diff=149511Multifactor authentication/fr2024-01-30T20:37:42Z<p>Plstonge: Created page with "Pour les instructions d'installation, [https://help.duo.com/s/article/2211?language=en_US voir les détails ici]."</p>
<hr />
<div><languages /><br />
<br />
<br />
L’authentification multifacteur permet de protéger votre compte avec plus qu’un simple mot de passe. Une fois que votre compte est configuré pour utiliser cette fonctionnalité, vous devrez entrer votre mot de passe comme d’habitude, mais en plus effectuer une deuxième action (le <i>deuxième facteur</i>), pour avoir accès à la plupart de nos services.<br />
<br />
Sélectionnez cette deuxième étape d’authentification parmi ces facteurs&nbsp;:<br />
*accepter une notification sur votre appareil intelligent dans l’application Duo Mobile;<br />
*entrer un code généré sur demande;<br />
*presser un bouton sur une clé matérielle (YubiKey).<br><br />
<br />
L’authentification multifacteur sera déployée graduellement. Cette fonctionnalité ne sera donc pas disponible immédiatement pour tous nos services.<br />
<br />
= Webinaires à voir =<br />
Ces deux webinaires ont été enregistrés en octobre 2023 : <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (en français)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (en anglais)<br />
<br />
= Enregistrement des facteurs =<br />
== Enregistrer plusieurs facteurs ==<br />
Lorsque vous activez l'authentification multifacteur pour votre compte, nous vous <b>recommandons fortement</b> d’enregistrer au moins deux options pour votre deuxième facteur. Vous pouvez par exemple vous servir de votre téléphone et de codes à usage unique; de votre téléphone et d’une clé YubiKey; ou encore de deux clés YubiKey. De cette façon, si une de ces options ne peut pas être employée, vous aurez un autre facteur pour accéder à votre compte.<br />
<br />
== Utiliser un téléphone ou une tablette ==<br />
<br />
#Installez l'application Duo Mobile à partir du [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] ou de [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Assurez-vous d'avoir la bonne application (voir l'icône ci-dessous). Les applications TOTP comme Aegis, Google Authenticator et Microsoft Authenticator <b>ne sont pas compatibles</b> avec Duo et ne peuvent pas balayer le code QR.<br />
#Connectez-vous à votre compte et cliquez sur <i>Mon compte → [https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
#Sous <i>Enregistrer un appareil</i>, cliquez sur <i>Duo Mobile</i>.<br />
#Entrez un nom pour identifier votre appareil. Cliquez sur <i>Continuer</i> pour faire afficher un code QR. <br />
#Dans l'application Duo Mobile, cliquez sur le signe <b>+</b> ou sur <i>Ajouter un compte</i>.<br />
#Touchez <i>Utiliser un code QR</i>.<br />
#Balayez le code QR qui est affiché dans CCDB. <b>Important : Pour balayer le code QR, votre appareil doit avoir accès à l'internet par wi-fi ou par réseau cellulaire.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Étape 1<br />
File:Duo-mobile-option.png|Étape 3<br />
File:Naming-duo-mobile-device.png|Étape 4<br />
File:Duo-mobile-add-account.png|Étape 5<br />
File:Duo-mobile-scan-qr-code.png|Étape 6<br />
File:Scanning-CCDB-QR-code.jpg|Étape 7<br />
</gallery><br />
<br />
== Utiliser une clé YubiKey 5 ==<br />
Les YubiKey sont des clés matérielles produites par [https://www.yubico.com/ Yubico]. Si vous n'avez pas de téléphone intelligent ou de tablette, si vous ne voulez pas employer ces appareils pour l'authentification multifacteur, ou s'il vous est souvent impossible de les utiliser, une clé YubiKey 5 serait votre meilleur choix.<br />
<br />
<b>Notez que certains modèles [https://help.duo.com/s/article/2166?language=en_US ne sont pas compatibles]; nous recommandons YubiKey, série 5.</b><br />
<br />
De la taille d’une petite clé USB, les clés YubiKey 5 coûtent entre 50 et 100 dollars. Différents modèles sont compatibles avec les ports USB-A, USB-C et Lightning et certaines permettent la communication en champ proche (NFC) avec un téléphone ou une tablette.<br />
<br />
YubiKeys supporte plusieurs protocoles. Nos grappes utilisent Yubico OTP (<i>one-time password</i>). Une fois que votre clé est enregistrée à votre compte comme facteur d'authentification, quand vous tenterez de vous connecter à une de nos grappes, on vous demandera d'entrer un mot de passe à utilisation unique (OTP). Vous appuyez alors sur le bouton de la clé, ce qui génère une chaîne de 32 caractères qui forme un mot de passe à entrer. Vous n'avez pas besoin du clavier; la clé se connecte à votre ordinateur et entre elle-même la chaîne de 32 caractères quand vous touchez le bouton.<br />
<br />
Pour enregistrer votre YubiKey, entrez son identifiant public, son identifiant privé et sa clé secrète dans la page <i>[https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>. Si ces renseignements ne sont pas disponibles, configurez votre clé comme suit.<br />
<br />
=== Configurer votre YubiKey pour Yubico OTP ===<br />
<br />
# Téléchargez et installez YubiKey Manager à partir du [https://www.yubico.com/support/download/yubikey-manager/ site Web de Yubico].<br />
# Insérez la clé YubiKey et lancez YubiKey Manager.<br />
# Dans YubiKey Manager, cliquez sur <i>Applications</i> puis sur <i>OTP</i> (voir les images ci-dessous).<br />
# Vous pouvez ici configurer l'une de deux options. <i>Short Touch (Slot 1)</i> identifie une touche brève (de 1 à 2,5 secondes) et <i>Long Touch (Slot 2)</i> correspond à une touche plus longue (de 3 à 5 secondes). L'option numéro 1 est généralement préenregistrée pour Yubico Cloud. Si vous utilisez déjà cette option pour d'autres services, configurez plutôt l'option 2, ou cliquez sur <i>Swap</i> pour transférer la configuration de l'option 1 vers l'option 2, puis configurer l'option 1. <br />
# Sélectionnez <i>Yubico OTP</i>.<br />
# Sélectionnez <i>Use serial</i> pour générer un identifiant privé et une clé secrète. <b>Faites une copie des deux identifiants et de la clé secrète avant de cliquer sur <i>Finish</i> parce que vous en aurez besoin à la prochaine étape</b>. Gardez cette fenêtre ouverte.<br />
# <b>IMPORTANT: Assurez-vous d'avoir cliqué sur <i>Finish</i> à l'étape précédente.</b><br />
# Connectez-vous à la CCDB et cliquez sur <i>Mon compte → [https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i> pour entrer les données pour votre clé.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Étape 3<br />
File:Yubico Manager OTP configuration.png|Étape 4<br />
File:Select Yubico OTP.png|Étape 5<br />
File:Generate Yubikey IDs.png|Étapes 6 et 7<br />
CCDB Yubikeys.png|Étape 8<br />
</gallery><br />
<br />
= Authentification =<br />
== Pour vous connecter à une grappe via SSH == <br />
Si l'authentification multifacteur est activée pour votre compte et que vous vous connectez via SSH à une grappe qui supporte cette fonctionnalité, vous devez d’abord passer la première authentification avec votre mot de passe ou avec votre [[SSH Keys/fr|clé SSH]]. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):}}<br />
<br />
Vous pouvez maintenant indiquer le téléphone ou la tablette qui recevra une notification de la part de Duo. Si vous avez enregistré plusieurs appareils, une liste sera affichée, dans laquelle vous pouvez sélectionner l'appareil de votre choix. Vous n'avez qu'à accepter la notification pour confirmer votre deuxième authentification.<br />
<br />
Si vous utilisez une YubiKey ou un code préalablement sauvegardé, ou encore si vous préférez entrer le mot de passe unique valide pour une durée limitée que Duo Mobile affiche, ne sélectionnez pas une option, mais entrez le code, par exemple <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Passer outre à la deuxième authentification===<br />
Si vous vous connectez avec OpenSSH, vous pouvez configurer votre client SSH pour diminuer la fréquence à laquelle vous devez utiliser la deuxième authentification. Modifiez <code>.ssh/config</code> en ajoutant les lignes suivantes&nbsp;:<br />
<br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
Remplacez <code>HOSTNAME</code> par le hostname du serveur que vous voulez configurer.<br />
<br />
Si vous utilisez Windows, vous pouvez installer OpenSSH en suivant les [https://learn.microsoft.com/fr-ca/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui directives pour installer OpenSSH]. Vous n'avez besoin d'installer que le client.<br />
<br />
== Pour vous connecter à votre compte ==<br />
Si l'authentification multifacteur est activée pour votre compte, vous devez d’abord passer la première authentification avec votre nom d'utilisateur et votre mot de passe. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
<br><br />
(Remarque : <i>Ceci n'est pas la fenêtre finale</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuration de clients SSH courants =<br />
Les clients ligne de commande prennent généralement en charge l'authentification multifacteur sans plus de configuration. Par contre, ce n'est souvent pas le cas pour les clients graphiques. Vous trouverez ci-dessous des directives spécifiques à quelques-uns d’entre eux. <br />
<br />
== FileZilla == <br />
FileZilla demande le mot de passe et le deuxième facteur chaque fois qu'un transfert est initié puisque par défaut, les transferts utilisent des connexions distinctes qui sont automatiquement fermées après un certain temps d'inactivité.<br />
<br />
Pour ne pas avoir à saisir plusieurs fois le mot de passe et le deuxième facteur, vous pouvez limiter le nombre de connexions à chaque site à «&nbsp;1&nbsp;» dans <i>Site Manager => Paramètres de transfert</i>; prenez note que vous perdrez ainsi la possibilité de parcourir le serveur lors des transferts.<br />
<br />
# Lancez FileZilla et sélectionnez <i>Gestionnaire de Sites</i>.<br />
# Dans <i>Gestionnaire de Sites</i>, modifiez un site existant ou créez un nouveau site.<br />
# Sous l'onglet <i>Général</i>, entrez les choix suivants&nbsp;:<br />
#* <i>Protocole : SFTP – SSH File Transfer Protocol</i><br />
#* <i>Hôte :</i> [nom de l'hôte pour la grappe de connexion]<br />
#* <i>Type d'authentification : Interactive</i><br />
#* <i>Identifiant :</i> [votre nom d'utilisateur]<br />
# Sous l'onglet <i>Paramètres de transfert</i>&nbsp;:<br />
#* cochez la case <i>Limiter le nombre de connexions simultanées</i> <br />
#* <i>Nombre maximum de connexions : 1</i><br />
# Cliquez sur <i>OK</i> pour sauvegarder la connexion.<br />
# Testez la connexion.<br />
<br />
== MobaXTerm == <br />
Installez la version 23.1 ou une version plus récente.<br />
<br />
Pour rejoindre un serveur distant, MobaXTerm établit par défaut deux connexions&nbsp;: une première pour le terminal et une seconde pour naviguer dans les fichiers à distance. Puisque le navigateur utilise par défaut le <i>protocole SFTP</i>, votre deuxième facteur d'authentification vous est demandé une seconde fois. Pour éviter ceci, dans l'éditeur SSH, sous l'onglet <i>SSH-browser type</i>, sélectionnez <i>SCP (enhanced speed)</i> ou <i>SCP (normal speed)</i>.<br />
<br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<br />
== PuTTY ==<br />
Installez la version 0.72 ou une version plus récente. <br />
<br />
== WinSCP == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]]. <br />
<br />
== PyCharm == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]].<br />
<br />
== Cyberduck ==<br />
Par défaut, Cyberduck ouvre une nouvelle connexion pour chaque transfert de fichier et vous demande chaque fois votre deuxième facteur. Pour modifier ceci, utilisez les préférences, sous <i>Transferts</i>, onglet <i>Général</i> et dans le denu déroulant de <i>Transférer des fichiers</i>, sélectionnez <i>Utiliser la connexion du navigateur</i>.<br />
<br />
Assurez-vous de ne pas cocher la case pour <i>Téléchargements segmentés avec plusieurs connexions par fichier</i>.<br />
<br />
[[File:CyberduckFRN.png|400px|Configuration pour l'authentification multifacteur]]<br />
<br />
= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo :<br />
<br />
<div lang="en" dir="ltr" class="mw-content-ltr"><br />
* For Android 9, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* For Android 10, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
</div><br />
<br />
<div lang="en" dir="ltr" class="mw-content-ltr"><br />
For validation, official [https://duo.com/docs/checksums#duo-mobile SHA-256 checksums are listed here].<br />
</div><br />
<br />
Pour les instructions d'installation, [https://help.duo.com/s/article/2211?language=en_US voir les détails ici].<br />
<br />
== Je veux désactiver l'authentification multifacteur. Comment dois-je procéder? ==<br />
Cette fonctionnalité sera sous peu obligatoire et elle ne peut pas être désactivée. Nous accordons des exceptions uniquement dans le cas de processus automatisés. Si l'authentification multifacteur vous dérange, nous vous suggérons d'employer une des configurations décrites ci-dessus, selon le client SSH que vous utilisez. Vous trouverez d'autres suggestions dans [[Multifactor_authentication/fr#Webinaires_à_voir|ces webinaires]]. <br />
<br />
== Je n'ai pas de tablette ni de téléphone intelligent assez récent. Comment puis-je utiliser l'authentification multifacteur? ==<br />
Vous pouvez [[Multifactor authentication/fr#Pour_utiliser_une_clé_YubiKey|utiliser une clé YubiKey]].<br />
<br />
== J’ai perdu un appareil que j’utilisais comme deuxième facteur. Que puis-je faire? ==<br />
* Si vous avez configuré plusieurs appareils ou si vous avez généré des codes de contournement, utilisez cette autre méthode pour [https://ccdb.alliancecan.ca/multi_factor_authentications accéder à votre compte]. Dans la liste des appareils enregistrés, supprimez celui que vous avez perdu et enregistrez le nouvel appareil.<br />
* Si vous n’avez sauvegardé aucun code de contournement et que vous n’avez plus aucun des appareils que vous avez configurés, copiez la liste suivante et ajoutez-y le plus de détails possible. Faites parvenir cette information à support@tech.alliancecan.ca. <br />
<br />
Quelle est l’adresse de courriel principale enregistrée dans votre compte?<br />
Depuis combien de temps détenez-vous un compte actif avec nous?<br />
Quel est votre champ de recherche?<br />
Quelle est votre adresse IP? (pour connaître votre adresse IP, [https://whatismyipaddress.com/ cliquez sur ce lien])<br />
Quel est le nom de la chercheuse principale ou du chercheur principal qui vous parraine?<br />
Qui sont les membres de votre groupe?<br />
Avec qui pouvons-nous communiquer au sujet de votre demande?<br />
Quelles sont les grappes que vous utilisez le plus?<br />
Quels sont les modules que vous chargez le plus souvent?<br />
À quand remonte la dernière tâche que vous avez soumise?<br />
Mentionnez les identifiants de certaines de vos tâches les plus récentes.<br />
Décrivez les sujets et donnez les identifiants de vos plus récentes demandes de soutien technique.<br />
<br />
== Quels sont les clients SSH qu'on peut utiliser quand l'authentification multifacteur est configurée? ==<br />
* La plupart des clients SSH en ligne de commande, tels que ceux disponibles sur Linux ou Mac OS<br />
* MobaXTerm (voir les directives ci-dessus)<br />
* PuTTY (voir les directives ci-dessus)<br />
* Termius sur iOS<br />
* FileZilla (voir les directives ci-dessus)<br />
* JuiceSSH sur Android<br />
* WinSCP (voir les directives ci-dessus)<br />
* PyCharm (voir les directives ci-dessus)<br />
* VSCode<br />
* CyberDuck (voir les directives ci-dessus)<br />
<br />
== J'ai besoin de connexions qui se font automatiquement aux grappes à partir de mon compte; est-ce que je peux utiliser l'authentification multifacteur? ==<br />
Cette option est à l'étude, mais aucune solution générale n'est encore implémentée. Si c'est votre cas, évitez de vous inscrire au service d'authentification multifacteur et écrivez au [[Technical support/fr|soutien technique]].<br />
<br />
== Message <i>Access denied. Duo Security does not provide services in your current location</i> ==<br />
Ceci est dû au fait que Duo est un produit des États-Unis (voir [https://help.duo.com/s/article/7544?language=en_US Duo help]). Pour contourner ceci, vous devez utiliser une connexion VPN et faire comme si vous étiez d'un pays à partir duquel l'accès est permis.<br />
<br />
= Fonctions avancées =<br />
== Configurer votre YubiKey pour Yubico OTP via la ligne de commande (<code>ykman</code>)==<br />
# Installez le logiciel de ligne de commande YubiKey Manager (<code>ykman</code>) en suivant les directives pour votre système d'exploitation dans le [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman guide ykman].<br />
# Entrez votre YubiKey et prenez connaissance de l'information sur la clé avec la commande <code>ykman info</code>.<br />
# Prenez connaissance de l'information sur OTP avec la commande <code>ykman otp info</code>.<br />
# Choisissez entre Slot 1 et Slot 2 et lancez la commande <code>ykman otp yubiotp</code> pour programmer l'option.<br />
# <b>Dans un endroit sécuritaire, conservez une copie de l’identifiant public, l’identifiant privé et la clé secrète; ils seront nécessaires à la prochaine étape.</b><br />
# Connectez-vous à la CCDB pour enregistrer votre clé dans la page <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
<br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Multifactor_authentication/54/fr&diff=149510Translations:Multifactor authentication/54/fr2024-01-30T20:37:11Z<p>Plstonge: Created page with "Pour les instructions d'installation, [https://help.duo.com/s/article/2211?language=en_US voir les détails ici]."</p>
<hr />
<div>Pour les instructions d'installation, [https://help.duo.com/s/article/2211?language=en_US voir les détails ici].</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication/fr&diff=149509Multifactor authentication/fr2024-01-30T20:36:23Z<p>Plstonge: </p>
<hr />
<div><languages /><br />
<br />
<br />
L’authentification multifacteur permet de protéger votre compte avec plus qu’un simple mot de passe. Une fois que votre compte est configuré pour utiliser cette fonctionnalité, vous devrez entrer votre mot de passe comme d’habitude, mais en plus effectuer une deuxième action (le <i>deuxième facteur</i>), pour avoir accès à la plupart de nos services.<br />
<br />
Sélectionnez cette deuxième étape d’authentification parmi ces facteurs&nbsp;:<br />
*accepter une notification sur votre appareil intelligent dans l’application Duo Mobile;<br />
*entrer un code généré sur demande;<br />
*presser un bouton sur une clé matérielle (YubiKey).<br><br />
<br />
L’authentification multifacteur sera déployée graduellement. Cette fonctionnalité ne sera donc pas disponible immédiatement pour tous nos services.<br />
<br />
= Webinaires à voir =<br />
Ces deux webinaires ont été enregistrés en octobre 2023 : <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (en français)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (en anglais)<br />
<br />
= Enregistrement des facteurs =<br />
== Enregistrer plusieurs facteurs ==<br />
Lorsque vous activez l'authentification multifacteur pour votre compte, nous vous <b>recommandons fortement</b> d’enregistrer au moins deux options pour votre deuxième facteur. Vous pouvez par exemple vous servir de votre téléphone et de codes à usage unique; de votre téléphone et d’une clé YubiKey; ou encore de deux clés YubiKey. De cette façon, si une de ces options ne peut pas être employée, vous aurez un autre facteur pour accéder à votre compte.<br />
<br />
== Utiliser un téléphone ou une tablette ==<br />
<br />
#Installez l'application Duo Mobile à partir du [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] ou de [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Assurez-vous d'avoir la bonne application (voir l'icône ci-dessous). Les applications TOTP comme Aegis, Google Authenticator et Microsoft Authenticator <b>ne sont pas compatibles</b> avec Duo et ne peuvent pas balayer le code QR.<br />
#Connectez-vous à votre compte et cliquez sur <i>Mon compte → [https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
#Sous <i>Enregistrer un appareil</i>, cliquez sur <i>Duo Mobile</i>.<br />
#Entrez un nom pour identifier votre appareil. Cliquez sur <i>Continuer</i> pour faire afficher un code QR. <br />
#Dans l'application Duo Mobile, cliquez sur le signe <b>+</b> ou sur <i>Ajouter un compte</i>.<br />
#Touchez <i>Utiliser un code QR</i>.<br />
#Balayez le code QR qui est affiché dans CCDB. <b>Important : Pour balayer le code QR, votre appareil doit avoir accès à l'internet par wi-fi ou par réseau cellulaire.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Étape 1<br />
File:Duo-mobile-option.png|Étape 3<br />
File:Naming-duo-mobile-device.png|Étape 4<br />
File:Duo-mobile-add-account.png|Étape 5<br />
File:Duo-mobile-scan-qr-code.png|Étape 6<br />
File:Scanning-CCDB-QR-code.jpg|Étape 7<br />
</gallery><br />
<br />
== Utiliser une clé YubiKey 5 ==<br />
Les YubiKey sont des clés matérielles produites par [https://www.yubico.com/ Yubico]. Si vous n'avez pas de téléphone intelligent ou de tablette, si vous ne voulez pas employer ces appareils pour l'authentification multifacteur, ou s'il vous est souvent impossible de les utiliser, une clé YubiKey 5 serait votre meilleur choix.<br />
<br />
<b>Notez que certains modèles [https://help.duo.com/s/article/2166?language=en_US ne sont pas compatibles]; nous recommandons YubiKey, série 5.</b><br />
<br />
De la taille d’une petite clé USB, les clés YubiKey 5 coûtent entre 50 et 100 dollars. Différents modèles sont compatibles avec les ports USB-A, USB-C et Lightning et certaines permettent la communication en champ proche (NFC) avec un téléphone ou une tablette.<br />
<br />
YubiKeys supporte plusieurs protocoles. Nos grappes utilisent Yubico OTP (<i>one-time password</i>). Une fois que votre clé est enregistrée à votre compte comme facteur d'authentification, quand vous tenterez de vous connecter à une de nos grappes, on vous demandera d'entrer un mot de passe à utilisation unique (OTP). Vous appuyez alors sur le bouton de la clé, ce qui génère une chaîne de 32 caractères qui forme un mot de passe à entrer. Vous n'avez pas besoin du clavier; la clé se connecte à votre ordinateur et entre elle-même la chaîne de 32 caractères quand vous touchez le bouton.<br />
<br />
Pour enregistrer votre YubiKey, entrez son identifiant public, son identifiant privé et sa clé secrète dans la page <i>[https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>. Si ces renseignements ne sont pas disponibles, configurez votre clé comme suit.<br />
<br />
=== Configurer votre YubiKey pour Yubico OTP ===<br />
<br />
# Téléchargez et installez YubiKey Manager à partir du [https://www.yubico.com/support/download/yubikey-manager/ site Web de Yubico].<br />
# Insérez la clé YubiKey et lancez YubiKey Manager.<br />
# Dans YubiKey Manager, cliquez sur <i>Applications</i> puis sur <i>OTP</i> (voir les images ci-dessous).<br />
# Vous pouvez ici configurer l'une de deux options. <i>Short Touch (Slot 1)</i> identifie une touche brève (de 1 à 2,5 secondes) et <i>Long Touch (Slot 2)</i> correspond à une touche plus longue (de 3 à 5 secondes). L'option numéro 1 est généralement préenregistrée pour Yubico Cloud. Si vous utilisez déjà cette option pour d'autres services, configurez plutôt l'option 2, ou cliquez sur <i>Swap</i> pour transférer la configuration de l'option 1 vers l'option 2, puis configurer l'option 1. <br />
# Sélectionnez <i>Yubico OTP</i>.<br />
# Sélectionnez <i>Use serial</i> pour générer un identifiant privé et une clé secrète. <b>Faites une copie des deux identifiants et de la clé secrète avant de cliquer sur <i>Finish</i> parce que vous en aurez besoin à la prochaine étape</b>. Gardez cette fenêtre ouverte.<br />
# <b>IMPORTANT: Assurez-vous d'avoir cliqué sur <i>Finish</i> à l'étape précédente.</b><br />
# Connectez-vous à la CCDB et cliquez sur <i>Mon compte → [https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i> pour entrer les données pour votre clé.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Étape 3<br />
File:Yubico Manager OTP configuration.png|Étape 4<br />
File:Select Yubico OTP.png|Étape 5<br />
File:Generate Yubikey IDs.png|Étapes 6 et 7<br />
CCDB Yubikeys.png|Étape 8<br />
</gallery><br />
<br />
= Authentification =<br />
== Pour vous connecter à une grappe via SSH == <br />
Si l'authentification multifacteur est activée pour votre compte et que vous vous connectez via SSH à une grappe qui supporte cette fonctionnalité, vous devez d’abord passer la première authentification avec votre mot de passe ou avec votre [[SSH Keys/fr|clé SSH]]. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):}}<br />
<br />
Vous pouvez maintenant indiquer le téléphone ou la tablette qui recevra une notification de la part de Duo. Si vous avez enregistré plusieurs appareils, une liste sera affichée, dans laquelle vous pouvez sélectionner l'appareil de votre choix. Vous n'avez qu'à accepter la notification pour confirmer votre deuxième authentification.<br />
<br />
Si vous utilisez une YubiKey ou un code préalablement sauvegardé, ou encore si vous préférez entrer le mot de passe unique valide pour une durée limitée que Duo Mobile affiche, ne sélectionnez pas une option, mais entrez le code, par exemple <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Passer outre à la deuxième authentification===<br />
Si vous vous connectez avec OpenSSH, vous pouvez configurer votre client SSH pour diminuer la fréquence à laquelle vous devez utiliser la deuxième authentification. Modifiez <code>.ssh/config</code> en ajoutant les lignes suivantes&nbsp;:<br />
<br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
Remplacez <code>HOSTNAME</code> par le hostname du serveur que vous voulez configurer.<br />
<br />
Si vous utilisez Windows, vous pouvez installer OpenSSH en suivant les [https://learn.microsoft.com/fr-ca/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui directives pour installer OpenSSH]. Vous n'avez besoin d'installer que le client.<br />
<br />
== Pour vous connecter à votre compte ==<br />
Si l'authentification multifacteur est activée pour votre compte, vous devez d’abord passer la première authentification avec votre nom d'utilisateur et votre mot de passe. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
<br><br />
(Remarque : <i>Ceci n'est pas la fenêtre finale</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuration de clients SSH courants =<br />
Les clients ligne de commande prennent généralement en charge l'authentification multifacteur sans plus de configuration. Par contre, ce n'est souvent pas le cas pour les clients graphiques. Vous trouverez ci-dessous des directives spécifiques à quelques-uns d’entre eux. <br />
<br />
== FileZilla == <br />
FileZilla demande le mot de passe et le deuxième facteur chaque fois qu'un transfert est initié puisque par défaut, les transferts utilisent des connexions distinctes qui sont automatiquement fermées après un certain temps d'inactivité.<br />
<br />
Pour ne pas avoir à saisir plusieurs fois le mot de passe et le deuxième facteur, vous pouvez limiter le nombre de connexions à chaque site à «&nbsp;1&nbsp;» dans <i>Site Manager => Paramètres de transfert</i>; prenez note que vous perdrez ainsi la possibilité de parcourir le serveur lors des transferts.<br />
<br />
# Lancez FileZilla et sélectionnez <i>Gestionnaire de Sites</i>.<br />
# Dans <i>Gestionnaire de Sites</i>, modifiez un site existant ou créez un nouveau site.<br />
# Sous l'onglet <i>Général</i>, entrez les choix suivants&nbsp;:<br />
#* <i>Protocole : SFTP – SSH File Transfer Protocol</i><br />
#* <i>Hôte :</i> [nom de l'hôte pour la grappe de connexion]<br />
#* <i>Type d'authentification : Interactive</i><br />
#* <i>Identifiant :</i> [votre nom d'utilisateur]<br />
# Sous l'onglet <i>Paramètres de transfert</i>&nbsp;:<br />
#* cochez la case <i>Limiter le nombre de connexions simultanées</i> <br />
#* <i>Nombre maximum de connexions : 1</i><br />
# Cliquez sur <i>OK</i> pour sauvegarder la connexion.<br />
# Testez la connexion.<br />
<br />
== MobaXTerm == <br />
Installez la version 23.1 ou une version plus récente.<br />
<br />
Pour rejoindre un serveur distant, MobaXTerm établit par défaut deux connexions&nbsp;: une première pour le terminal et une seconde pour naviguer dans les fichiers à distance. Puisque le navigateur utilise par défaut le <i>protocole SFTP</i>, votre deuxième facteur d'authentification vous est demandé une seconde fois. Pour éviter ceci, dans l'éditeur SSH, sous l'onglet <i>SSH-browser type</i>, sélectionnez <i>SCP (enhanced speed)</i> ou <i>SCP (normal speed)</i>.<br />
<br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<br />
== PuTTY ==<br />
Installez la version 0.72 ou une version plus récente. <br />
<br />
== WinSCP == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]]. <br />
<br />
== PyCharm == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]].<br />
<br />
== Cyberduck ==<br />
Par défaut, Cyberduck ouvre une nouvelle connexion pour chaque transfert de fichier et vous demande chaque fois votre deuxième facteur. Pour modifier ceci, utilisez les préférences, sous <i>Transferts</i>, onglet <i>Général</i> et dans le denu déroulant de <i>Transférer des fichiers</i>, sélectionnez <i>Utiliser la connexion du navigateur</i>.<br />
<br />
Assurez-vous de ne pas cocher la case pour <i>Téléchargements segmentés avec plusieurs connexions par fichier</i>.<br />
<br />
[[File:CyberduckFRN.png|400px|Configuration pour l'authentification multifacteur]]<br />
<br />
= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo :<br />
<br />
<div lang="en" dir="ltr" class="mw-content-ltr"><br />
* For Android 9, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* For Android 10, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
</div><br />
<br />
<div lang="en" dir="ltr" class="mw-content-ltr"><br />
For validation, official [https://duo.com/docs/checksums#duo-mobile SHA-256 checksums are listed here].<br />
</div><br />
<br />
<div lang="en" dir="ltr" class="mw-content-ltr"><br />
For installation instructions, [https://help.duo.com/s/article/2211?language=en_US see this page].<br />
</div><br />
<br />
== Je veux désactiver l'authentification multifacteur. Comment dois-je procéder? ==<br />
Cette fonctionnalité sera sous peu obligatoire et elle ne peut pas être désactivée. Nous accordons des exceptions uniquement dans le cas de processus automatisés. Si l'authentification multifacteur vous dérange, nous vous suggérons d'employer une des configurations décrites ci-dessus, selon le client SSH que vous utilisez. Vous trouverez d'autres suggestions dans [[Multifactor_authentication/fr#Webinaires_à_voir|ces webinaires]]. <br />
<br />
== Je n'ai pas de tablette ni de téléphone intelligent assez récent. Comment puis-je utiliser l'authentification multifacteur? ==<br />
Vous pouvez [[Multifactor authentication/fr#Pour_utiliser_une_clé_YubiKey|utiliser une clé YubiKey]].<br />
<br />
== J’ai perdu un appareil que j’utilisais comme deuxième facteur. Que puis-je faire? ==<br />
* Si vous avez configuré plusieurs appareils ou si vous avez généré des codes de contournement, utilisez cette autre méthode pour [https://ccdb.alliancecan.ca/multi_factor_authentications accéder à votre compte]. Dans la liste des appareils enregistrés, supprimez celui que vous avez perdu et enregistrez le nouvel appareil.<br />
* Si vous n’avez sauvegardé aucun code de contournement et que vous n’avez plus aucun des appareils que vous avez configurés, copiez la liste suivante et ajoutez-y le plus de détails possible. Faites parvenir cette information à support@tech.alliancecan.ca. <br />
<br />
Quelle est l’adresse de courriel principale enregistrée dans votre compte?<br />
Depuis combien de temps détenez-vous un compte actif avec nous?<br />
Quel est votre champ de recherche?<br />
Quelle est votre adresse IP? (pour connaître votre adresse IP, [https://whatismyipaddress.com/ cliquez sur ce lien])<br />
Quel est le nom de la chercheuse principale ou du chercheur principal qui vous parraine?<br />
Qui sont les membres de votre groupe?<br />
Avec qui pouvons-nous communiquer au sujet de votre demande?<br />
Quelles sont les grappes que vous utilisez le plus?<br />
Quels sont les modules que vous chargez le plus souvent?<br />
À quand remonte la dernière tâche que vous avez soumise?<br />
Mentionnez les identifiants de certaines de vos tâches les plus récentes.<br />
Décrivez les sujets et donnez les identifiants de vos plus récentes demandes de soutien technique.<br />
<br />
== Quels sont les clients SSH qu'on peut utiliser quand l'authentification multifacteur est configurée? ==<br />
* La plupart des clients SSH en ligne de commande, tels que ceux disponibles sur Linux ou Mac OS<br />
* MobaXTerm (voir les directives ci-dessus)<br />
* PuTTY (voir les directives ci-dessus)<br />
* Termius sur iOS<br />
* FileZilla (voir les directives ci-dessus)<br />
* JuiceSSH sur Android<br />
* WinSCP (voir les directives ci-dessus)<br />
* PyCharm (voir les directives ci-dessus)<br />
* VSCode<br />
* CyberDuck (voir les directives ci-dessus)<br />
<br />
== J'ai besoin de connexions qui se font automatiquement aux grappes à partir de mon compte; est-ce que je peux utiliser l'authentification multifacteur? ==<br />
Cette option est à l'étude, mais aucune solution générale n'est encore implémentée. Si c'est votre cas, évitez de vous inscrire au service d'authentification multifacteur et écrivez au [[Technical support/fr|soutien technique]].<br />
<br />
== Message <i>Access denied. Duo Security does not provide services in your current location</i> ==<br />
Ceci est dû au fait que Duo est un produit des États-Unis (voir [https://help.duo.com/s/article/7544?language=en_US Duo help]). Pour contourner ceci, vous devez utiliser une connexion VPN et faire comme si vous étiez d'un pays à partir duquel l'accès est permis.<br />
<br />
= Fonctions avancées =<br />
== Configurer votre YubiKey pour Yubico OTP via la ligne de commande (<code>ykman</code>)==<br />
# Installez le logiciel de ligne de commande YubiKey Manager (<code>ykman</code>) en suivant les directives pour votre système d'exploitation dans le [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman guide ykman].<br />
# Entrez votre YubiKey et prenez connaissance de l'information sur la clé avec la commande <code>ykman info</code>.<br />
# Prenez connaissance de l'information sur OTP avec la commande <code>ykman otp info</code>.<br />
# Choisissez entre Slot 1 et Slot 2 et lancez la commande <code>ykman otp yubiotp</code> pour programmer l'option.<br />
# <b>Dans un endroit sécuritaire, conservez une copie de l’identifiant public, l’identifiant privé et la clé secrète; ils seront nécessaires à la prochaine étape.</b><br />
# Connectez-vous à la CCDB pour enregistrer votre clé dans la page <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
<br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Multifactor_authentication/19/fr&diff=149508Translations:Multifactor authentication/19/fr2024-01-30T20:36:15Z<p>Plstonge: </p>
<hr />
<div>= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo :</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=149501Multifactor authentication2024-01-30T20:34:26Z<p>Plstonge: Marked this version for translation</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approve a notification on a smart device through the Duo Mobile application.<br />
*Enter a code generated on demand.<br />
*Push a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be gradually deployed and will not be immediately available for all of our services.<br />
<br />
= Recorded webinars = <!--T:50--><br />
Two webinars were presented in October 2023. Their recordings are available here: <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (French)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (English)<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== Use a smartphone or tablet == <!--T:3--><br />
<br />
<!--T:46--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Make sure to get the correct application (see icon below). TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are <b>not</b> compatible with Duo and will not scan the QR code.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], log in to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device. Click on <i>Continue</i>. A QR code will be displayed.<br />
#In the Duo Mobile application, tap <i>Set up account</i> or the “+” sign.<br />
#Tap <i>Use a QR code</i>.<br />
#Scan the QR code shown to you in CCDB. <b>Important: Make sure that your mobile device is connected to the internet (over wi-fi or cellular data) while you are scanning the QR code.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Step 1<br />
File:Duo-mobile-option.png|Step 3<br />
File:Naming-duo-mobile-device.png|Step 4<br />
File:Duo-mobile-add-account.png|Step 5<br />
File:Duo-mobile-scan-qr-code.png|Step 6<br />
File:Scanning-CCDB-QR-code.jpg|Step 7<br />
</gallery><br />
<br />
== Use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey is your best option.<br />
<br />
<!--T:45--><br />
<b>Note that some YubiKey models are [https://help.duo.com/s/article/2166?language=en_US not compatible]. We recommend using the YubiKey 5 Series.</b><br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Multiple protocols are supported by YubiKeys. Our clusters use the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates a string of 32 characters to complete your authentication. Using a YubiKey does not require any typing on the keyboard: the YubiKey connected to your computer “types” the 32-character string when you touch its button.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1 to 2.5 seconds), while slot 2 is a long touch on the key (pressing for 3 to 5 seconds). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce how frequently you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui install OpenSSH]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specific to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or later.<br />
<br />
<!--T:43--><br />
When connecting to a remote server, MobaXterm establishes two connections by default:<br />
the first for the terminal and the second for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
<br />
</translate><br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<translate><br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or later. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
== Cyberduck == <!--T:47--><br />
By default, Cyberduck opens a new connection for every file transfer, prompting you for your second factor each time. To change this, go in the application's preferences, under <i>Transfers</i>, in the <i>General</i> section, use the drop-down menu beside the <i>Transfer Files</i> item and select <i>Use browser connection</i>.<br />
<br />
<!--T:48--><br />
Then, ensure that the box beside <i>Segmented downloads with multiple connections per file</i> is not checked. It should look like the picture below.<br />
<br />
<!--T:49--><br />
[[File:CyberDuck configuration for multifactor authentication.png|400px|Cyberduck configuration for multifactor authentication]]<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an older Android phone and I cannot download the Duo Mobile application from the Google Play site. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website:<br />
<br />
<!--T:52--><br />
* For Android 9, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* For Android 10, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
<br />
<!--T:53--><br />
For validation, official [https://duo.com/docs/checksums#duo-mobile SHA-256 checksums are listed here].<br />
<br />
<!--T:54--><br />
For installation instructions, [https://help.duo.com/s/article/2211?language=en_US see this page].<br />
<br />
== I want to disable multifactor authentication. How do I do this? == <!--T:51--><br />
Multifactor authentication will become mandatory in the near future; therefore, users cannot disable it. Exceptions can only be granted for automation purposes. If you find that multifactor authentication is annoying, we recommend applying one of the configurations listed above, depending on the SSH client you are using. Our [[Multifactor_authentication#Recorded_webinars|recorded webinars]] also contain many tips on how to make MFA less burdensome to use. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
* CyberDuck (see instructions above)<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering options to implement for automation, but we do not have a solution yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
== What should I do when I receive the message "Access denied. Duo Security does not provide services in your current location" ? == <!--T:44--><br />
This is a consequence of Duo being a US product: [https://help.duo.com/s/article/7544?language=en_US Duo help]. You'll need to use a VPN to circumvent this, to make it appear you're coming from an unaffected country.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=149500Multifactor authentication2024-01-30T20:33:31Z<p>Plstonge: Installation instructions</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approve a notification on a smart device through the Duo Mobile application.<br />
*Enter a code generated on demand.<br />
*Push a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be gradually deployed and will not be immediately available for all of our services.<br />
<br />
= Recorded webinars = <!--T:50--><br />
Two webinars were presented in October 2023. Their recordings are available here: <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (French)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (English)<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== Use a smartphone or tablet == <!--T:3--><br />
<br />
<!--T:46--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Make sure to get the correct application (see icon below). TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are <b>not</b> compatible with Duo and will not scan the QR code.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], log in to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device. Click on <i>Continue</i>. A QR code will be displayed.<br />
#In the Duo Mobile application, tap <i>Set up account</i> or the “+” sign.<br />
#Tap <i>Use a QR code</i>.<br />
#Scan the QR code shown to you in CCDB. <b>Important: Make sure that your mobile device is connected to the internet (over wi-fi or cellular data) while you are scanning the QR code.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Step 1<br />
File:Duo-mobile-option.png|Step 3<br />
File:Naming-duo-mobile-device.png|Step 4<br />
File:Duo-mobile-add-account.png|Step 5<br />
File:Duo-mobile-scan-qr-code.png|Step 6<br />
File:Scanning-CCDB-QR-code.jpg|Step 7<br />
</gallery><br />
<br />
== Use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey is your best option.<br />
<br />
<!--T:45--><br />
<b>Note that some YubiKey models are [https://help.duo.com/s/article/2166?language=en_US not compatible]. We recommend using the YubiKey 5 Series.</b><br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Multiple protocols are supported by YubiKeys. Our clusters use the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates a string of 32 characters to complete your authentication. Using a YubiKey does not require any typing on the keyboard: the YubiKey connected to your computer “types” the 32-character string when you touch its button.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1 to 2.5 seconds), while slot 2 is a long touch on the key (pressing for 3 to 5 seconds). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce how frequently you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui install OpenSSH]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specific to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or later.<br />
<br />
<!--T:43--><br />
When connecting to a remote server, MobaXterm establishes two connections by default:<br />
the first for the terminal and the second for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
<br />
</translate><br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<translate><br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or later. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
== Cyberduck == <!--T:47--><br />
By default, Cyberduck opens a new connection for every file transfer, prompting you for your second factor each time. To change this, go in the application's preferences, under <i>Transfers</i>, in the <i>General</i> section, use the drop-down menu beside the <i>Transfer Files</i> item and select <i>Use browser connection</i>.<br />
<br />
<!--T:48--><br />
Then, ensure that the box beside <i>Segmented downloads with multiple connections per file</i> is not checked. It should look like the picture below.<br />
<br />
<!--T:49--><br />
[[File:CyberDuck configuration for multifactor authentication.png|400px|Cyberduck configuration for multifactor authentication]]<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an older Android phone and I cannot download the Duo Mobile application from the Google Play site. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website:<br />
<br />
* For Android 9, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* For Android 10, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
<br />
For validation, official [https://duo.com/docs/checksums#duo-mobile SHA-256 checksums are listed here].<br />
<br />
For installation instructions, [https://help.duo.com/s/article/2211?language=en_US see this page].<br />
<br />
== I want to disable multifactor authentication. How do I do this? == <!--T:51--><br />
Multifactor authentication will become mandatory in the near future; therefore, users cannot disable it. Exceptions can only be granted for automation purposes. If you find that multifactor authentication is annoying, we recommend applying one of the configurations listed above, depending on the SSH client you are using. Our [[Multifactor_authentication#Recorded_webinars|recorded webinars]] also contain many tips on how to make MFA less burdensome to use. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
* CyberDuck (see instructions above)<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering options to implement for automation, but we do not have a solution yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
== What should I do when I receive the message "Access denied. Duo Security does not provide services in your current location" ? == <!--T:44--><br />
This is a consequence of Duo being a US product: [https://help.duo.com/s/article/7544?language=en_US Duo help]. You'll need to use a VPN to circumvent this, to make it appear you're coming from an unaffected country.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=149499Multifactor authentication2024-01-30T20:30:44Z<p>Plstonge: Specific versions of Android and Duo</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approve a notification on a smart device through the Duo Mobile application.<br />
*Enter a code generated on demand.<br />
*Push a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be gradually deployed and will not be immediately available for all of our services.<br />
<br />
= Recorded webinars = <!--T:50--><br />
Two webinars were presented in October 2023. Their recordings are available here: <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (French)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (English)<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== Use a smartphone or tablet == <!--T:3--><br />
<br />
<!--T:46--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Make sure to get the correct application (see icon below). TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are <b>not</b> compatible with Duo and will not scan the QR code.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], log in to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device. Click on <i>Continue</i>. A QR code will be displayed.<br />
#In the Duo Mobile application, tap <i>Set up account</i> or the “+” sign.<br />
#Tap <i>Use a QR code</i>.<br />
#Scan the QR code shown to you in CCDB. <b>Important: Make sure that your mobile device is connected to the internet (over wi-fi or cellular data) while you are scanning the QR code.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Step 1<br />
File:Duo-mobile-option.png|Step 3<br />
File:Naming-duo-mobile-device.png|Step 4<br />
File:Duo-mobile-add-account.png|Step 5<br />
File:Duo-mobile-scan-qr-code.png|Step 6<br />
File:Scanning-CCDB-QR-code.jpg|Step 7<br />
</gallery><br />
<br />
== Use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey is your best option.<br />
<br />
<!--T:45--><br />
<b>Note that some YubiKey models are [https://help.duo.com/s/article/2166?language=en_US not compatible]. We recommend using the YubiKey 5 Series.</b><br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Multiple protocols are supported by YubiKeys. Our clusters use the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates a string of 32 characters to complete your authentication. Using a YubiKey does not require any typing on the keyboard: the YubiKey connected to your computer “types” the 32-character string when you touch its button.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1 to 2.5 seconds), while slot 2 is a long touch on the key (pressing for 3 to 5 seconds). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce how frequently you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui install OpenSSH]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specific to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or later.<br />
<br />
<!--T:43--><br />
When connecting to a remote server, MobaXterm establishes two connections by default:<br />
the first for the terminal and the second for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
<br />
</translate><br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<translate><br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or later. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
== Cyberduck == <!--T:47--><br />
By default, Cyberduck opens a new connection for every file transfer, prompting you for your second factor each time. To change this, go in the application's preferences, under <i>Transfers</i>, in the <i>General</i> section, use the drop-down menu beside the <i>Transfer Files</i> item and select <i>Use browser connection</i>.<br />
<br />
<!--T:48--><br />
Then, ensure that the box beside <i>Segmented downloads with multiple connections per file</i> is not checked. It should look like the picture below.<br />
<br />
<!--T:49--><br />
[[File:CyberDuck configuration for multifactor authentication.png|400px|Cyberduck configuration for multifactor authentication]]<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an older Android phone and I cannot download the Duo Mobile application from the Google Play site. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website:<br />
<br />
* For Android 9, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.33.0.apk DuoMobile-4.33.0.apk]<br />
* For Android 10, the latest compatible version is [https://dl.duosecurity.com/DuoMobile-4.56.0.apk DuoMobile-4.56.0.apk]<br />
<br />
For validation, official [https://duo.com/docs/checksums#duo-mobile SHA-256 checksums are listed here].<br />
See [https://help.duo.com/s/article/2211?language=en_US this page] for more details.<br />
<br />
== I want to disable multifactor authentication. How do I do this? == <!--T:51--><br />
Multifactor authentication will become mandatory in the near future; therefore, users cannot disable it. Exceptions can only be granted for automation purposes. If you find that multifactor authentication is annoying, we recommend applying one of the configurations listed above, depending on the SSH client you are using. Our [[Multifactor_authentication#Recorded_webinars|recorded webinars]] also contain many tips on how to make MFA less burdensome to use. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
* CyberDuck (see instructions above)<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering options to implement for automation, but we do not have a solution yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
== What should I do when I receive the message "Access denied. Duo Security does not provide services in your current location" ? == <!--T:44--><br />
This is a consequence of Duo being a US product: [https://help.duo.com/s/article/7544?language=en_US Duo help]. You'll need to use a VPN to circumvent this, to make it appear you're coming from an unaffected country.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication/fr&diff=149497Multifactor authentication/fr2024-01-30T17:20:01Z<p>Plstonge: </p>
<hr />
<div><languages /><br />
<br />
<br />
L’authentification multifacteur permet de protéger votre compte avec plus qu’un simple mot de passe. Une fois que votre compte est configuré pour utiliser cette fonctionnalité, vous devrez entrer votre mot de passe comme d’habitude, mais en plus effectuer une deuxième action (le <i>deuxième facteur</i>), pour avoir accès à la plupart de nos services.<br />
<br />
Sélectionnez cette deuxième étape d’authentification parmi ces facteurs&nbsp;:<br />
*accepter une notification sur votre appareil intelligent dans l’application Duo Mobile;<br />
*entrer un code généré sur demande;<br />
*presser un bouton sur une clé matérielle (YubiKey).<br><br />
<br />
L’authentification multifacteur sera déployée graduellement. Cette fonctionnalité ne sera donc pas disponible immédiatement pour tous nos services.<br />
<br />
= Webinaires à voir =<br />
Ces deux webinaires ont été enregistrés en octobre 2023 : <br />
* [https://www.youtube.com/watch?v=ciycOUbchl8&ab_channel=TheAlliance%7CL%E2%80%99Alliance Authentification multifacteur pour la communauté de recherche] (en français)<br />
* [https://www.youtube.com/watch?v=qNsUsZ73HP0&ab_channel=TheAlliance%7CL%E2%80%99Alliance Multifactor authentication for researchers] (en anglais)<br />
<br />
= Enregistrement des facteurs =<br />
== Enregistrer plusieurs facteurs ==<br />
Lorsque vous activez l'authentification multifacteur pour votre compte, nous vous <b>recommandons fortement</b> d’enregistrer au moins deux options pour votre deuxième facteur. Vous pouvez par exemple vous servir de votre téléphone et de codes à usage unique; de votre téléphone et d’une clé YubiKey; ou encore de deux clés YubiKey. De cette façon, si une de ces options ne peut pas être employée, vous aurez un autre facteur pour accéder à votre compte.<br />
<br />
== Utiliser un téléphone ou une tablette ==<br />
<br />
#Installez l'application Duo Mobile à partir du [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] ou de [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Assurez-vous d'avoir la bonne application (voir l'icône ci-dessous). Les applications TOTP comme Aegis, Google Authenticator et Microsoft Authenticator <b>ne sont pas compatibles</b> avec Duo et ne peuvent pas balayer le code QR.<br />
#Connectez-vous à votre compte et cliquez sur <i>Mon compte → [https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
#Sous <i>Enregistrer un appareil</i>, cliquez sur <i>Duo Mobile</i>.<br />
#Entrez un nom pour identifier votre appareil. Cliquez sur <i>Continuer</i> pour faire afficher un code QR. <br />
#Dans l'application Duo Mobile, cliquez sur le signe <b>+</b> ou sur <i>Ajouter un compte</i>.<br />
#Touchez <i>Utiliser un code QR</i>.<br />
#Balayez le code QR qui est affiché dans CCDB. <b>Important : Pour balayer le code QR, votre appareil doit avoir accès à l'internet par wi-fi ou par réseau cellulaire.</b><br />
<gallery widths=300px heights=300px><br />
File:Duo-mobile-app-icon.png|Étape 1<br />
File:Duo-mobile-option.png|Étape 3<br />
File:Naming-duo-mobile-device.png|Étape 4<br />
File:Duo-mobile-add-account.png|Étape 5<br />
File:Duo-mobile-scan-qr-code.png|Étape 6<br />
File:Scanning-CCDB-QR-code.jpg|Étape 7<br />
</gallery><br />
<br />
== Utiliser une clé YubiKey 5 ==<br />
Les YubiKey sont des clés matérielles produites par [https://www.yubico.com/ Yubico]. Si vous n'avez pas de téléphone intelligent ou de tablette, si vous ne voulez pas employer ces appareils pour l'authentification multifacteur, ou s'il vous est souvent impossible de les utiliser, une clé YubiKey 5 serait votre meilleur choix.<br />
<br />
<b>Notez que certains modèles [https://help.duo.com/s/article/2166?language=en_US ne sont pas compatibles]; nous recommandons YubiKey, série 5.</b><br />
<br />
De la taille d’une petite clé USB, les clés YubiKey 5 coûtent entre 50 et 100 dollars. Différents modèles sont compatibles avec les ports USB-A, USB-C et Lightning et certaines permettent la communication en champ proche (NFC) avec un téléphone ou une tablette.<br />
<br />
YubiKeys supporte plusieurs protocoles. Nos grappes utilisent Yubico OTP (<i>one-time password</i>). Une fois que votre clé est enregistrée à votre compte comme facteur d'authentification, quand vous tenterez de vous connecter à une de nos grappes, on vous demandera d'entrer un mot de passe à utilisation unique (OTP). Vous appuyez alors sur le bouton de la clé, ce qui génère une chaîne de 32 caractères qui forme un mot de passe à entrer. Vous n'avez pas besoin du clavier; la clé se connecte à votre ordinateur et entre elle-même la chaîne de 32 caractères quand vous touchez le bouton.<br />
<br />
Pour enregistrer votre YubiKey, entrez son identifiant public, son identifiant privé et sa clé secrète dans la page <i>[https://ccdb.computecanada.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>. Si ces renseignements ne sont pas disponibles, configurez votre clé comme suit.<br />
<br />
=== Configurer votre YubiKey pour Yubico OTP ===<br />
<br />
# Téléchargez et installez YubiKey Manager à partir du [https://www.yubico.com/support/download/yubikey-manager/ site Web de Yubico].<br />
# Insérez la clé YubiKey et lancez YubiKey Manager.<br />
# Dans YubiKey Manager, cliquez sur <i>Applications</i> puis sur <i>OTP</i> (voir les images ci-dessous).<br />
# Vous pouvez ici configurer l'une de deux options. <i>Short Touch (Slot 1)</i> identifie une touche brève (de 1 à 2,5 secondes) et <i>Long Touch (Slot 2)</i> correspond à une touche plus longue (de 3 à 5 secondes). L'option numéro 1 est généralement préenregistrée pour Yubico Cloud. Si vous utilisez déjà cette option pour d'autres services, configurez plutôt l'option 2, ou cliquez sur <i>Swap</i> pour transférer la configuration de l'option 1 vers l'option 2, puis configurer l'option 1. <br />
# Sélectionnez <i>Yubico OTP</i>.<br />
# Sélectionnez <i>Use serial</i> pour générer un identifiant privé et une clé secrète. <b>Faites une copie des deux identifiants et de la clé secrète avant de cliquer sur <i>Finish</i> parce que vous en aurez besoin à la prochaine étape</b>. Gardez cette fenêtre ouverte.<br />
# <b>IMPORTANT: Assurez-vous d'avoir cliqué sur <i>Finish</i> à l'étape précédente.</b><br />
# Connectez-vous à la CCDB et cliquez sur <i>Mon compte → [https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i> pour entrer les données pour votre clé.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Étape 3<br />
File:Yubico Manager OTP configuration.png|Étape 4<br />
File:Select Yubico OTP.png|Étape 5<br />
File:Generate Yubikey IDs.png|Étapes 6 et 7<br />
CCDB Yubikeys.png|Étape 8<br />
</gallery><br />
<br />
= Authentification =<br />
== Pour vous connecter à une grappe via SSH == <br />
Si l'authentification multifacteur est activée pour votre compte et que vous vous connectez via SSH à une grappe qui supporte cette fonctionnalité, vous devez d’abord passer la première authentification avec votre mot de passe ou avec votre [[SSH Keys/fr|clé SSH]]. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):}}<br />
<br />
Vous pouvez maintenant indiquer le téléphone ou la tablette qui recevra une notification de la part de Duo. Si vous avez enregistré plusieurs appareils, une liste sera affichée, dans laquelle vous pouvez sélectionner l'appareil de votre choix. Vous n'avez qu'à accepter la notification pour confirmer votre deuxième authentification.<br />
<br />
Si vous utilisez une YubiKey ou un code préalablement sauvegardé, ou encore si vous préférez entrer le mot de passe unique valide pour une durée limitée que Duo Mobile affiche, ne sélectionnez pas une option, mais entrez le code, par exemple <br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
Enter a passcode or select one of the following options:<br />
<br />
1. Duo Push to My phone (iOS)<br />
<br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Passer outre à la deuxième authentification===<br />
Si vous vous connectez avec OpenSSH, vous pouvez configurer votre client SSH pour diminuer la fréquence à laquelle vous devez utiliser la deuxième authentification. Modifiez <code>.ssh/config</code> en ajoutant les lignes suivantes&nbsp;:<br />
<br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
Remplacez <code>HOSTNAME</code> par le hostname du serveur que vous voulez configurer.<br />
<br />
Si vous utilisez Windows, vous pouvez installer OpenSSH en suivant les [https://learn.microsoft.com/fr-ca/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui directives pour installer OpenSSH]. Vous n'avez besoin d'installer que le client.<br />
<br />
== Pour vous connecter à votre compte ==<br />
Si l'authentification multifacteur est activée pour votre compte, vous devez d’abord passer la première authentification avec votre nom d'utilisateur et votre mot de passe. Ce qui suit sera affiché pour la deuxième authentification&nbsp;: <br />
<br><br />
(Remarque : <i>Ceci n'est pas la fenêtre finale</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuration de clients SSH courants =<br />
Les clients ligne de commande prennent généralement en charge l'authentification multifacteur sans plus de configuration. Par contre, ce n'est souvent pas le cas pour les clients graphiques. Vous trouverez ci-dessous des directives spécifiques à quelques-uns d’entre eux. <br />
<br />
== FileZilla == <br />
FileZilla demande le mot de passe et le deuxième facteur chaque fois qu'un transfert est initié puisque par défaut, les transferts utilisent des connexions distinctes qui sont automatiquement fermées après un certain temps d'inactivité.<br />
<br />
Pour ne pas avoir à saisir plusieurs fois le mot de passe et le deuxième facteur, vous pouvez limiter le nombre de connexions à chaque site à «&nbsp;1&nbsp;» dans <i>Site Manager => Paramètres de transfert</i>; prenez note que vous perdrez ainsi la possibilité de parcourir le serveur lors des transferts.<br />
<br />
# Lancez FileZilla et sélectionnez <i>Gestionnaire de Sites</i>.<br />
# Dans <i>Gestionnaire de Sites</i>, modifiez un site existant ou créez un nouveau site.<br />
# Sous l'onglet <i>Général</i>, entrez les choix suivants&nbsp;:<br />
#* <i>Protocole : SFTP – SSH File Transfer Protocol</i><br />
#* <i>Hôte :</i> [nom de l'hôte pour la grappe de connexion]<br />
#* <i>Type d'authentification : Interactive</i><br />
#* <i>Identifiant :</i> [votre nom d'utilisateur]<br />
# Sous l'onglet <i>Paramètres de transfert</i>&nbsp;:<br />
#* cochez la case <i>Limiter le nombre de connexions simultanées</i> <br />
#* <i>Nombre maximum de connexions : 1</i><br />
# Cliquez sur <i>OK</i> pour sauvegarder la connexion.<br />
# Testez la connexion.<br />
<br />
== MobaXTerm == <br />
Installez la version 23.1 ou une version plus récente.<br />
<br />
Pour rejoindre un serveur distant, MobaXTerm établit par défaut deux connexions&nbsp;: une première pour le terminal et une seconde pour naviguer dans les fichiers à distance. Puisque le navigateur utilise par défaut le <i>protocole SFTP</i>, votre deuxième facteur d'authentification vous est demandé une seconde fois. Pour éviter ceci, dans l'éditeur SSH, sous l'onglet <i>SSH-browser type</i>, sélectionnez <i>SCP (enhanced speed)</i> ou <i>SCP (normal speed)</i>.<br />
<br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<br />
== PuTTY ==<br />
Installez la version 0.72 ou une version plus récente. <br />
<br />
== WinSCP == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]]. <br />
<br />
== PyCharm == <br />
Assurez-vous que vous utilisez des [[SSH Keys/fr|clés SSH]].<br />
<br />
== Cyberduck ==<br />
Par défaut, Cyberduck ouvre une nouvelle connexion pour chaque transfert de fichier et vous demande chaque fois votre deuxième facteur. Pour modifier ceci, utilisez les préférences, sous <i>Transferts</i>, onglet <i>Général</i> et dans le denu déroulant de <i>Transférer des fichiers</i>, sélectionnez <i>Utiliser la connexion du navigateur</i>.<br />
<br />
Assurez-vous de ne pas cocher la case pour <i>Téléchargements segmentés avec plusieurs connexions par fichier</i>.<br />
<br />
[[File:CyberduckFRN.png|400px|Configuration pour l'authentification multifacteur]]<br />
<br />
= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo. [https://help.duo.com/s/article/2211?language=en_US Voir les détails.] <br />
<br />
== Je veux désactiver l'authentification multifacteur. Comment dois-je procéder? ==<br />
Cette fonctionnalité sera sous peu obligatoire et elle ne peut pas être désactivée. Nous accordons des exceptions uniquement dans le cas de processus automatisés. Si l'authentification multifacteur vous dérange, nous vous suggérons d'employer une des configurations décrites ci-dessus, selon le client SSH que vous utilisez. Vous trouverez d'autres suggestions dans [[Multifactor_authentication/fr#Webinaires_à_voir|ces webinaires]]. <br />
<br />
== Je n'ai pas de tablette ni de téléphone intelligent assez récent. Comment puis-je utiliser l'authentification multifacteur? ==<br />
Vous pouvez [[Multifactor authentication/fr#Pour_utiliser_une_clé_YubiKey|utiliser une clé YubiKey]].<br />
<br />
== J’ai perdu un appareil que j’utilisais comme deuxième facteur. Que puis-je faire? ==<br />
* Si vous avez configuré plusieurs appareils ou si vous avez généré des codes de contournement, utilisez cette autre méthode pour [https://ccdb.alliancecan.ca/multi_factor_authentications accéder à votre compte]. Dans la liste des appareils enregistrés, supprimez celui que vous avez perdu et enregistrez le nouvel appareil.<br />
* Si vous n’avez sauvegardé aucun code de contournement et que vous n’avez plus aucun des appareils que vous avez configurés, copiez la liste suivante et ajoutez-y le plus de détails possible. Faites parvenir cette information à support@tech.alliancecan.ca. <br />
<br />
Quelle est l’adresse de courriel principale enregistrée dans votre compte?<br />
Depuis combien de temps détenez-vous un compte actif avec nous?<br />
Quel est votre champ de recherche?<br />
Quelle est votre adresse IP? (pour connaître votre adresse IP, [https://whatismyipaddress.com/ cliquez sur ce lien])<br />
Quel est le nom de la chercheuse principale ou du chercheur principal qui vous parraine?<br />
Qui sont les membres de votre groupe?<br />
Avec qui pouvons-nous communiquer au sujet de votre demande?<br />
Quelles sont les grappes que vous utilisez le plus?<br />
Quels sont les modules que vous chargez le plus souvent?<br />
À quand remonte la dernière tâche que vous avez soumise?<br />
Mentionnez les identifiants de certaines de vos tâches les plus récentes.<br />
Décrivez les sujets et donnez les identifiants de vos plus récentes demandes de soutien technique.<br />
<br />
== Quels sont les clients SSH qu'on peut utiliser quand l'authentification multifacteur est configurée? ==<br />
* La plupart des clients SSH en ligne de commande, tels que ceux disponibles sur Linux ou Mac OS<br />
* MobaXTerm (voir les directives ci-dessus)<br />
* PuTTY (voir les directives ci-dessus)<br />
* Termius sur iOS<br />
* FileZilla (voir les directives ci-dessus)<br />
* JuiceSSH sur Android<br />
* WinSCP (voir les directives ci-dessus)<br />
* PyCharm (voir les directives ci-dessus)<br />
* VSCode<br />
* CyberDuck (voir les directives ci-dessus)<br />
<br />
== J'ai besoin de connexions qui se font automatiquement aux grappes à partir de mon compte; est-ce que je peux utiliser l'authentification multifacteur? ==<br />
Cette option est à l'étude, mais aucune solution générale n'est encore implémentée. Si c'est votre cas, évitez de vous inscrire au service d'authentification multifacteur et écrivez au [[Technical support/fr|soutien technique]].<br />
<br />
== Message <i>Access denied. Duo Security does not provide services in your current location</i> ==<br />
Ceci est dû au fait que Duo est un produit des États-Unis (voir [https://help.duo.com/s/article/7544?language=en_US Duo help]). Pour contourner ceci, vous devez utiliser une connexion VPN et faire comme si vous étiez d'un pays à partir duquel l'accès est permis.<br />
<br />
= Fonctions avancées =<br />
== Configurer votre YubiKey pour Yubico OTP via la ligne de commande (<code>ykman</code>)==<br />
# Installez le logiciel de ligne de commande YubiKey Manager (<code>ykman</code>) en suivant les directives pour votre système d'exploitation dans le [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman guide ykman].<br />
# Entrez votre YubiKey et prenez connaissance de l'information sur la clé avec la commande <code>ykman info</code>.<br />
# Prenez connaissance de l'information sur OTP avec la commande <code>ykman otp info</code>.<br />
# Choisissez entre Slot 1 et Slot 2 et lancez la commande <code>ykman otp yubiotp</code> pour programmer l'option.<br />
# <b>Dans un endroit sécuritaire, conservez une copie de l’identifiant public, l’identifiant privé et la clé secrète; ils seront nécessaires à la prochaine étape.</b><br />
# Connectez-vous à la CCDB pour enregistrer votre clé dans la page <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Gestion de l'authentification multifacteur]</i>.<br />
<br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Multifactor_authentication/19/fr&diff=149496Translations:Multifactor authentication/19/fr2024-01-30T17:19:55Z<p>Plstonge: </p>
<hr />
<div>= Foire aux questions =<br />
== J'ai un téléphone Android et je ne trouve pas l'application Duo Mobile dans Google Play. Est-ce que je peux quand même utiliser Duo? ==<br />
Oui, mais il faudra télécharger l'application du site Web de Duo. [https://help.duo.com/s/article/2211?language=en_US Voir les détails.]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149491Visual Studio Code2024-01-30T16:59:02Z<p>Plstonge: Changed position of first image</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
[[File:VSCode SSH Passphrase Prompt.png|thumb|SSH Passphrase prompt]]<br />
Note : <b>you will be prompted many times for your SSH key passphrase.</b><br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
===Connection with MFA enabled===<br />
[[File:VSCode Detail Link.png|thumb|When connecting, click on "details" to see the prompt for the 2nd factor in the Terminal]]<br />
<br />
<!--T:12--><br />
If the [[Multifactor authentication|multifactor authentication]] is enabled,<br />
you will need to check the "details" of the connection, which will bring you to the<br />
VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149490Visual Studio Code2024-01-30T16:57:17Z<p>Plstonge: Two images 1) Passphrase prompt 2) Click on details</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
Note : <b>you will be prompted many times for your SSH key passphrase.</b><br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
[[File:VSCode SSH Passphrase Prompt.png|thumb|center|SSH Passphrase prompt]] <br clear=all><br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
===Connection with MFA enabled===<br />
[[File:VSCode Detail Link.png|thumb|When connecting, click on "details" to see the prompt for the 2nd factor in the Terminal]]<br />
<br />
<!--T:12--><br />
If the [[Multifactor authentication|multifactor authentication]] is enabled,<br />
you will need to check the "details" of the connection, which will bring you to the<br />
VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=File:VSCode_Detail_Link.png&diff=149489File:VSCode Detail Link.png2024-01-30T16:45:03Z<p>Plstonge: </p>
<hr />
<div></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=File:VSCode_SSH_Passphrase_Prompt.png&diff=149488File:VSCode SSH Passphrase Prompt.png2024-01-30T16:42:14Z<p>Plstonge: </p>
<hr />
<div></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149487Visual Studio Code2024-01-30T16:31:48Z<p>Plstonge: New subsection for MFA</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
Note : <b>you will be prompted many times for your SSH key passphrase.</b><br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
===Connection with MFA enabled===<br />
<br />
<!--T:12--><br />
If the [[Multifactor authentication|multifactor authentication]] is enabled,<br />
you will need to check the "details" of the connection, which will bring you to the<br />
VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=149049Visual Studio Code2024-01-15T16:06:49Z<p>Plstonge: Back to draft.</p>
<hr />
<div>{{draft}}<br />
<br />
<languages /><br />
<translate><br />
<!--T:1--><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
<!--T:2--><br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
<!--T:17--><br />
Note that if you are using Visual Studio Code with Python, you should avoid installing [[Anaconda/en|Conda and its variants]] as they are poorly adapted to our cluster environment. Alternatives to the use of Conda include [[Python#Creating_and_using_a_virtual_environment|Python virtual environments]] and [[Apptainer]].<br />
<br />
=Configuring remote access= <!--T:3--><br />
<br />
==Configuration of your SSH keys== <!--T:4--><br />
<br />
<!--T:5--><br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file== <!--T:6--><br />
<br />
<!--T:7--><br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
</translate><br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<translate><br />
==First connection with VS Code== <!--T:8--><br />
<br />
<!--T:9--><br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
<!--T:10--><br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
<!--T:11--><br />
Note 1 : you will be prompted many times for your SSH key passphrase.<br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
<!--T:12--><br />
Note 2 : If you are using some [[Multifactor authentication|multifactor authentication]],<br />
you may need to check the "Details" of the connection,<br />
which will bring you to the VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
<!--T:13--><br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
=Connection to a compute node= <!--T:14--><br />
<br />
<!--T:15--><br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=See also= <!--T:16--><br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://youtu.be/1B0hiWaVcHY Connect VS Code to High-Performance Computing (HPC) Clusters]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=148978Visual Studio Code2024-01-10T21:26:48Z<p>Plstonge: Added tutorial video</p>
<hr />
<div><languages /><br />
<translate><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
=Configuring remote access=<br />
<br />
==Configuration of your SSH keys==<br />
<br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file==<br />
<br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
<br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<br />
==First connection with VS Code==<br />
<br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
Note 1 : you will be prompted many times for your SSH key passphrase.<br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
Note 2 : If you are using some [[Multifactor authentication|multifactor authentication]],<br />
you may need to check the "Details" of the connection,<br />
which will bring you to the VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
=Connection to a compute node=<br />
<br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=See also=<br />
* Tutorial video created by two users (best viewed in 720p):<br />
** [https://www.youtube.com/watch?v=1B0hiWaVcHY Connect VS Code to High Performance Computing (HPC) Clusters]<br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=148977Visual Studio Code2024-01-10T21:08:18Z<p>Plstonge: No longer a draft page</p>
<hr />
<div><languages /><br />
<translate><br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
=Configuring remote access=<br />
<br />
==Configuration of your SSH keys==<br />
<br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file==<br />
<br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
<br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<br />
==First connection with VS Code==<br />
<br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
Note 1 : you will be prompted many times for your SSH key passphrase.<br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
Note 2 : If you are using some [[Multifactor authentication|multifactor authentication]],<br />
you may need to check the "Details" of the connection,<br />
which will bring you to the VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
=Connection to a compute node=<br />
<br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=See also=<br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Visual_Studio_Code&diff=148976Visual Studio Code2024-01-10T21:04:51Z<p>Plstonge: More details for compute nodes</p>
<hr />
<div>{{Draft}}<br />
[https://code.visualstudio.com/ Visual Studio Code] is an integrated development environment (IDE) from [https://www.microsoft.com Microsoft] which can be used for remote development with Compute Canada clusters over [[SSH]]. In this context, users can run the graphical interface of Visual Studio Code locally, on their personal computer, while connecting to a cluster where the source code is located and where the debugging and testing operations are being executed. While Visual Studio Code may be used for development in a variety of programming languages, in this page we will focus on its use with [[Python]].<br />
<br />
When using an IDE like Visual Studio Code, it's important to distinguish what sort of action you're performing, even if all of them take place within the context of the IDE. Editing a Python script or any other text file of reasonable size (up to a few thousand lines) is a very light-weight process which requires little processing power or memory but an IDE offers you numerous other possibilities, including the ability to debug your script for example. In this case, the IDE is now ''executing'' your Python code on the shared login node and until the script crashes because of a bug, it may well consume an entire CPU core or even several if the script or the libraries which it uses are multi-threaded.<br />
<br />
=Configuring remote access=<br />
<br />
==Configuration of your SSH keys==<br />
<br />
# If not done already, <b>[[SSH_Keys#Generating_an_SSH_Key|generate your SSH key]]</b>. For example, we will name it <code>~/.ssh/ccdb</code>.<br />
# If not done already, <b>[[SSH_Keys#Installing_your_key|install your <i>public</i> SSH key on CCDB]]</b>.<br />
# Because compute nodes may not get your public SSH key from CCDB through LDAP, you may have to <b>copy your public key</b> to <code>~/.ssh/authorized_keys</code> on the remote cluster (create this file if it does not exist).<br />
<br />
==SSH configuration file==<br />
<br />
VS Code works well with your local [[SSH configuration file]] (<code>~/.ssh/config</code>).<br />
Here are the recommended options :<br />
<br />
{{File<br />
|name=~/.ssh/config<br />
|contents=<br />
Host *<br />
ServerAliveInterval 300<br />
<br />
Host beluga cedar graham narval<br />
HostName %h.alliancecan.ca<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host bc????? bg????? bl?????<br />
ProxyJump beluga<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host cdr*<br />
ProxyJump cedar<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host gra1* gra2* gra3* gra4* gra5* gra6* gra7* gra8* gra9*<br />
ProxyJump graham<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
<br />
Host nc????? ng????? nl?????<br />
ProxyJump narval<br />
IdentityFile ~/.ssh/ccdb<br />
User your_username<br />
}}<br />
<br />
==First connection with VS Code==<br />
<br />
Because some clusters do not provide access to Internet from compute nodes,<br />
the installation of VS Code Server must be done prior to using a remote connection to any compute node.<br />
Therefore, in VS Code, a first connection to any frontal node is required - select either :<br />
<br />
* beluga<br />
* cedar<br />
* graham<br />
* narval<br />
<br />
Note 1 : you will be prompted many times for your SSH key passphrase.<br />
If not, make sure to copy your SSH public key as described in a previous section.<br />
<br />
Note 2 : If you are using some [[Multifactor authentication|multifactor authentication]],<br />
you may need to check the "Details" of the connection,<br />
which will bring you to the VS Code Terminal in which you may be prompted for your 2nd factor of authentication.<br />
<br />
That first connection will automatically install VS Code Server in <code>~/.vscode-server/</code>.<br />
The installation can take up to 5 minutes.<br />
Once done, close the connection.<br />
<br />
=Connection to a compute node=<br />
<br />
Connection procedure:<br />
# Make sure VS Code Server is installed as described in the previous section.<br />
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>) and take note of the allocated compute node name.<br />
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).<br />
# In VS Code, start a new remote session with the name of the allocated compute node:<br />
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.<br />
## Start typing and select <i>Remote-SSH: Connect to Host...</i>: <b>&gt; Remote-SSH: Connect to Host...</b><br />
## Enter the noted compute node name.<br />
### If you get prompted for the type of operating system, select <b>Linux</b><br />
<br />
=See also=<br />
* SHARCNET General Interest Webinar, "Remote Development on Clusters with VSCode", presented by Armin Sobhani:<br />
** [https://youtu.be/u9k6HikDyqk Part I]<br />
** [https://youtu.be/CsgBGpampvc Part II]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Storage_and_file_management&diff=148298Storage and file management2023-12-12T14:09:35Z<p>Plstonge: New storage limits through RAS</p>
<hr />
<div><languages /><br />
<translate><br />
==Overview== <!--T:1--><br />
<br />
<!--T:2--><br />
We provide a wide range of storage options to cover the needs of our very diverse users. These storage solutions range from high-speed temporary local storage to different kinds of long-term storage, so you can choose the storage medium that best corresponds to your needs and usage patterns. In most cases the [https://en.wikipedia.org/wiki/File_system filesystems] on our systems are a <i>shared</i> resource and for this reason should be used responsibly because unwise behaviour can negatively affect dozens or hundreds of other users. These filesystems are also designed to store a limited number of very large files, which are typically binary since very large (hundreds of MB or more) text files lose most of their interest in being readable by humans. You should therefore avoid storing tens of thousands of small files, where small means less than a few megabytes, particularly in the same directory. A better approach is to use commands like [[Archiving and compressing files|<code>tar</code>]] or <code>zip</code> to convert a directory containing many small files into a single very large archive file. <br />
<br />
<!--T:3--><br />
It is also your responsibility to manage the age of your stored data: most of the filesystems are not intended to provide an indefinite archiving service so when a given file or directory is no longer needed, you need to move it to a more appropriate filesystem which may well mean your personal workstation or some other storage system under your control. Moving significant amounts of data between your workstation and one of our systems or between two of our systems should generally be done using [[Globus]]. <br />
<br />
<!--T:4--><br />
Note that our storage systems are not for personal use and should only be used to store research data.<br />
<br />
<!--T:17--><br />
When your account is created on a cluster, your home directory will not be entirely empty. It will contain references to your scratch and [[Project layout|project]] spaces through the mechanism of a [https://en.wikipedia.org/wiki/Symbolic_link symbolic link], a kind of shortcut that allows easy access to these other filesystems from your home directory. Note that these symbolic links may appear up to a few hours after you first connect to the cluster. While your home and scratch spaces are unique to you as an individual user, the project space is shared by a research group. This group may consist of those individuals with an account sponsored by a particular faculty member or members of an [https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/resource-allocation-competition/ RAC allocation]. A given individual may thus have access to several different project spaces, associated with one or more faculty members, with symbolic links to these different project spaces in the directory projects of your home. Every account has one or many projects. In the folder <code>projects</code> within their home directory, each user has a link to each of the projects they have access to. For users with a single active sponsored role, it is the default project of your sponsor while users with more than one active sponsored role will have a default project that corresponds to the default project of the faculty member with the most sponsored accounts.<br />
<br />
<!--T:16--><br />
All users can check the available disk space and the current disk utilization for the <i>project</i>, <i>home</i> and <i>scratch</i> filesystems with the command line utility <b><i>diskusage_report</b></i>, available on our clusters. To use this utility, log into the cluster using SSH, at the command prompt type <i>diskusage_report</i>, and press the Enter key. Below is a typical output of this utility:<br />
<pre><br />
# diskusage_report<br />
Description Space # of files<br />
Home (username) 280 kB/47 GB 25/500k<br />
Scratch (username) 4096 B/18 TB 1/1000k<br />
Project (def-username-ab) 4096 B/9536 GB 2/500k<br />
Project (def-username) 4096 B/9536 GB 2/500k<br />
</pre><br />
More detailed output is available using the [[Diskusage Explorer]] tool.<br />
<br />
== Storage types == <!--T:5--><br />
Unlike your personal computer, our systems will typically have several storage spaces or filesystems and you should ensure that you are using the right space for the right task. In this section we will discuss the principal filesystems available on most of our systems and the intended use of each one along with some of its characteristics. <br />
* <b>HOME:</b> While your home directory may seem like the logical place to store all your files and do all your work, in general this isn't the case; your home normally has a relatively small quota and doesn't have especially good performance for writing and reading large amounts of data. The most logical use of your home directory is typically source code, small parameter files and job submission scripts. <br />
* <b>PROJECT:</b> The project space has a significantly larger quota and is well adapted to [[Sharing data | sharing data]] among members of a research group since it, unlike the home or scratch, is linked to a professor's account rather than an individual user. The data stored in the project space should be fairly static, that is to say the data are not likely to be changed many times in a month. Otherwise, frequently changing data, including just moving and renaming directories, in project can become a heavy burden on the tape-based backup system. <br />
* <b>SCRATCH</b>: For intensive read/write operations on large files (> 100 MB per file), scratch is the best choice. However, remember that important files must be copied off scratch since they are not backed up there, and older files are subject to [[Scratch purging policy|purging]]. The scratch storage should therefore be used for temporary files: checkpoint files, output from jobs and other data that can easily be recreated.<br />
* <b>SLURM_TMPDIR</b>: While a job is running, <code>$SLURM_TMPDIR</code> is a unique path to a temporary folder on a local fast filesystem on each compute node reserved for the job. This is the best location to temporarily store large collections of small files (< 1 MB per file). Note that this space is shared between jobs on each node and the total available space depends on the node specifications. Finally, when the job ends, this folder is deleted. A more detailed discussion of using <code>$SLURM_TMPDIR</code> is available at [[Using_$SLURM_TMPDIR | this page]].<br />
<br />
==Project space consumption per user== <!--T:23--> <br />
<br />
<!--T:24--><br />
While the command <b>diskusage_report</b> gives the space and file count usage per user on <i>home</i> and <i>scratch</i>, it shows the total quota of the group on project. It includes all the files from each member of the group. Since the files that belong to a user could however be anywhere in the project space, it is difficult to obtain correct figures per user and per given project in case a user has access to more than one project. However, users can obtain an estimate of their space and file count use on the entire project space by running the command<br />
<br />
<!--T:26--><br />
<code>lfs quota -u $USER /project</code><br />
<br />
<!--T:25--><br />
In addition to that, users can obtain an estimate for the number of files in a given directory (and its subdirectories) using the command <code>lfs find</code>, e.g.<br />
<source lang="console"><br />
lfs find <path to the directory> -type f | wc -l<br />
</source><br />
<br />
== Best practices == <!--T:9--><br />
* Regularly clean up your data in the scratch and project spaces, because those filesystems are used for huge data collections.<br />
* Only use text format for files that are smaller than a few megabytes.<br />
* As far as possible, use scratch and local storage for temporary files. For local storage you can use the temporary directory created by the [[Running jobs|job scheduler]] for this, named <code>$SLURM_TMPDIR</code>.<br />
* If your program must search within a file, it is fastest to do it by first reading it completely before searching.<br />
* If you no longer use certain files but they must be retained, [[Archiving and compressing files|archive and compress]] them, and if possible move them to an alternative location like [[Using nearline storage|nearline]].<br />
* For more on managing many files, see [[Handling large collections of files]], especially if you are limited by a quota on the number of files. <br />
* Having any sort of parallel write access to a file stored on a shared filesystem like home, scratch and project is likely to create problems unless you are using a specialized tool such as [https://en.wikipedia.org/wiki/Message_Passing_Interface#I/O MPI-IO]. <br />
* If your needs are not well served by the available storage options please contact [[technical support]].<br />
<br />
==Filesystem quotas and policies== <!--T:10--><br />
<br />
<!--T:11--><br />
In order to ensure that there is adequate space for all users, there are a variety of quotas and policy restrictions concerning backups and automatic purging of certain filesystems. <br />
By default on our clusters, each user has access to the home and scratch spaces, and each group has access to 1 TB of project space. Small increases in project and scratch spaces are available through our Rapid Access Service ([https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/rapid-access-service RAS]). Larger increases in project spaces are available through the annual Resource Allocation Competition ([https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/resource-allocation-competition RAC]). You can see your current quota usage for various filesystems on Cedar and Graham using the command [[Storage and file management#Overview|<code>diskusage_report</code>]].<br />
<br />
<!--T:12--><br />
<tabs><br />
<tab name="Cedar"><br />
{| class="wikitable" style="font-size: 95%; text-align: center;"<br />
|+Filesystem Characteristics <br />
! Filesystem<br />
! Default Quota<br />
! Lustre-based<br />
! Backed up<br />
! Purged<br />
! Available by Default<br />
! Mounted on Compute Nodes<br />
|-<br />
|Home Space<br />
|50 GB and 500K files per user<ref>This quota is fixed and cannot be changed.</ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|Yes<br />
|-<br />
|Scratch Space<br />
|20 TB and 1M files per user<br />
|Yes<br />
|No<br />
|Files older than 60 days are purged.<ref>See [[Scratch purging policy]] for more information.</ref><br />
|Yes<br />
|Yes<br />
|-<br />
|Project Space<br />
|1 TB and 500K files per group<ref>Project space can be increased to 10 TB per group by a RAS request. The group's sponsoring PI should write to [[technical support]] to make the request.</ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|Yes<br />
|-<br />
|Nearline Space<br />
|2 TB and 5000 files per group<ref>Starting April 1st, 2024, new storage limits and policies through RAS requests will allow larger project and nearline spaces. For all details, see the section <b>[https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/rapid-access-service HPC resources available]</b></ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|No<br />
|}<br />
<references /><br />
</tab><br />
<tab name="Graham"><br />
{| class="wikitable" style="font-size: 95%; text-align: center;"<br />
|+Filesystem Characteristics <br />
! Filesystem<br />
! Default Quota<br />
! Lustre-based<br />
! Backed up<br />
! Purged<br />
! Available by Default<br />
! Mounted on Compute Nodes<br />
|-<br />
|Home Space<br />
|50 GB and 500K files per user<ref>This quota is fixed and cannot be changed.</ref><br />
|No<br />
|Yes<br />
|No<br />
|Yes<br />
|Yes<br />
|-<br />
|Scratch Space<br />
|20 TB and 1M files per user<br />
|Yes<br />
|No<br />
|Files older than 60 days are purged.<ref>See [[Scratch purging policy]] for more information.</ref><br />
|Yes<br />
|Yes<br />
|-<br />
|Project Space<br />
|1 TB and 500K files per group<ref>Project space can be increased to 10 TB per group by a RAS request. The group's sponsoring PI should write to [[technical support]] to make the request.</ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|Yes<br />
|-<br />
|Nearline Space<br />
|10 TB and 5000 files per group<ref>Starting April 1st, 2024, new storage limits and policies through RAS requests will allow larger project and nearline spaces. For all details, see the section <b>[https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/rapid-access-service HPC resources available]</b></ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|No<br />
|}<br />
<references /><br />
</tab><br />
<tab name="Béluga and Narval"><br />
{| class="wikitable" style="font-size: 95%; text-align: center;"<br />
|+Filesystem Characteristics <br />
! Filesystem<br />
! Default Quota<br />
! Lustre-based<br />
! Backed up<br />
! Purged<br />
! Available by Default<br />
! Mounted on Compute Nodes<br />
|-<br />
|Home Space<br />
|50 GB and 500K files per user<ref>This quota is fixed and cannot be changed.</ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|Yes<br />
|-<br />
|Scratch Space<br />
|20 TB and 1M files per user<br />
|Yes<br />
|No<br />
|Files older than 60 days are purged.<ref>See [[Scratch purging policy]] for more information.</ref><br />
|Yes<br />
|Yes<br />
|-<br />
|Project Space<br />
|1 TB and 500K files per group<ref>Project space can be increased to 10 TB per group by a RAS request. The group's sponsoring PI should write to [[technical support]] to make the request.</ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|Yes<br />
|-<br />
|Nearline Space<br />
|1 TB and 5000 files per group<ref>Starting April 1st, 2024, new storage limits and policies through RAS requests will allow larger project and nearline spaces. For all details, see the section <b>[https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/rapid-access-service HPC resources available]</b></ref><br />
|Yes<br />
|Yes<br />
|No<br />
|Yes<br />
|No<br />
|}<br />
<references /><br />
</tab><br />
<tab name="Niagara"><br />
{| class="wikitable"<br />
! location<br />
!colspan="2"| quota<br />
!align="right"| block size<br />
! expiration time<br />
! backed up<br />
! on login nodes<br />
! on compute nodes<br />
|-<br />
| $HOME<br />
|colspan="2"| 100 GB per user<br />
|align="right"| 1 MB<br />
| <br />
| yes<br />
| yes<br />
| read-only<br />
|-<br />
|rowspan="6"| $SCRATCH<br />
|colspan="2"| 25 TB per user (dynamic per group)<br />
|align="right" rowspan="6" | 16 MB<br />
|rowspan="6"| 2 months<br />
|rowspan="6"| no<br />
|rowspan="6"| yes<br />
|rowspan="6"| yes<br />
|-<br />
|align="right"|up to 4 users per group<br />
|align="right"|50TB<br />
|-<br />
|align="right"|up to 11 users per group<br />
|align="right"|125TB<br />
|-<br />
|align="right"|up to 28 users per group<br />
|align="right"|250TB<br />
|-<br />
|align="right"|up to 60 users per group<br />
|align="right"|400TB<br />
|-<br />
|align="right"|above 60 users per group<br />
|align="right"|500TB<br />
|-<br />
| $PROJECT<br />
|colspan="2"| by group allocation (RRG or RPP)<br />
|align="right"| 16 MB<br />
| <br />
| yes<br />
| yes<br />
| yes<br />
|-<br />
| $ARCHIVE<br />
|colspan="2"| by group allocation<br />
|align="right"| <br />
|<br />
| dual-copy<br />
| no<br />
| no<br />
|-<br />
| $BBUFFER<br />
|colspan="2"| 10 TB per user<br />
|align="right"| 1 MB<br />
| very short<br />
| no<br />
| yes<br />
| yes<br />
|}<br />
<ul><br />
<li>[https://docs.scinet.utoronto.ca/images/9/9a/Inode_vs._Space_quota_-_v2x.pdf Inode vs. Space quota (PROJECT and SCRATCH)]</li><br />
<li>[https://docs.scinet.utoronto.ca/images/0/0e/Scratch-quota.pdf dynamic quota per group (SCRATCH)]</li><br />
<li>Compute nodes do not have local storage.</li><br />
<li>Archive (a.k.a. nearline) space is on [https://docs.scinet.utoronto.ca/index.php/HPSS HPSS]</li><br />
<li>Backup means a recent snapshot, not an archive of all data that ever was.</li><br />
<li><code>$BBUFFER</code> stands for [https://docs.scinet.utoronto.ca/index.php/Burst_Buffer Burst Buffer], a faster parallel storage tier for temporary data.</li></ul><br />
<br />
<!--T:21--><br />
</tab><br />
</tabs><br />
<br />
<!--T:22--><br />
The backup policy on the home and project space is nightly backups which are retained for 30 days, while deleted files are retained for a further 60 days; note that is entirely distinct from the age limit for purging files from the scratch space. If you wish to recover a previous version of a file or directory, you should contact [[technical support]] with the full path for the file(s) and desired version (by date).<br />
<br />
== See also == <!--T:13--><br />
<br />
<!--T:14--><br />
* [[Diskusage Explorer]]<br />
* [[Project layout]]<br />
* [[Sharing data]]<br />
* [[Transferring data]]<br />
* [[Tuning Lustre]]<br />
* [[Archiving and compressing files]]<br />
* [[Handling large collections of files]]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Narval/15/en&diff=148116Translations:Narval/15/en2023-12-05T15:35:54Z<p>Plstonge: </p>
<hr />
<div>=Node characteristics=<br />
{| class="wikitable sortable"<br />
! nodes !! cores !! available memory !! CPU !! storage !! GPU<br />
|-<br />
| 1145 || rowspan="3"|64 || 249G or 255000M || rowspan="2"|2 x AMD Rome 7532 @ 2.40 GHz 256M cache L3 || rowspan="3"|1 x 960G SSD || rowspan="3"|-<br />
|-<br />
| 33 || 2009G or 2057500M<br />
|-<br />
| 3 || 4000G or 4096000M || 2 x AMD Rome 7502 @ 2.50 GHz 128M cache L3<br />
|-<br />
| 159 || 48 || 498G or 510000M || 2 x AMD Milan 7413 @ 2.65 GHz 128M cache L3 || 1 x SSD of 3.84 TB || 4 x NVidia A100SXM4 (40 GB memory), connected via NVLink<br />
|}</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Narval&diff=148113Narval2023-12-05T15:34:46Z<p>Plstonge: NVLink</p>
<hr />
<div><languages /><br />
<translate><br />
<!--T:1--><br />
{| class="wikitable"<br />
|-<br />
| Disponibilité : depuis octobre 2021<br />
|-<br />
| Nœud frontal : '''narval.alliancecan.ca'''<br />
|-<br />
| Collection Globus : '''[https://app.globus.org/file-manager?origin_id=a1713da6-098f-40e6-b3aa-034efe8b6e5b Compute Canada - Narval]'''<br />
|-<br />
| Nœud de copie (rsync, scp, sftp,...) : '''narval.alliancecan.ca'''<br />
|}<br />
<br />
<!--T:2--><br />
Narval est une grappe hétérogène et polyvalente conçue pour une grande variété de calculs scientifiques de petite et moyenne taille. Narval est située à l'[http://www.etsmtl.ca/ École de technologie supérieure]. Son nom rappelle le [https://fr.wikipedia.org/wiki/Narval narval], un mammifère marin qui a parfois été observé dans les eaux du fleuve Saint-Laurent.<br />
<br />
=Particularités= <!--T:3--><br />
Notre politique veut que les nœuds de calcul de Narval n'aient pas accès à l'internet. Pour y faire exception, veuillez joindre le [[Technical_support/fr|soutien technique]] en expliquant ce dont vous avez besoin et pourquoi. Notez que l'outil <code>crontab</code> n'est pas offert.<br />
<br />
<!--T:4--><br />
Chaque tâche devrait être d'une durée d’au moins une heure (au moins cinq minutes pour les tâches de test) et vous ne pouvez pas avoir plus de 1000 tâches (en exécution et en attente) à la fois. La durée maximale d'une tâche est de 7 jours (168 heures).<br />
<br />
=Stockage= <!--T:5--><br />
{| class="wikitable sortable"<br />
<br />
<!--T:6--><br />
|-<br />
| HOME <br> Système de fichiers Lustre, 40 To d’espace au total || <br />
<br />
<!--T:7--><br />
* Cet espace est petit et ne peut pas être agrandi : vous devrez utiliser votre espace <code>project</code> pour les grands besoins en stockage.<br />
* Petits [[Storage and file management/fr#Quotas_et_politiques|quotas]] fixes par utilisateur<br />
* Il y a une sauvegarde automatique une fois par jour.<br />
<br />
<!--T:8--><br />
|-<br />
| SCRATCH <br> Système de fichiers Lustre, 5.5 Po d’espace au total ||<br />
<br />
<!--T:9--><br />
* Grand espace pour stocker les fichiers temporaires pendant les calculs.<br />
* Pas de système de sauvegarde automatique<br />
* Grands [[Storage and file management/fr#Quotas_et_politiques|quotas]] fixes par utilisateur<br />
* Il y a une [[Scratch_purging_policy/fr | purge automatique]] des vieux fichiers dans cet espace.<br />
<br />
<!--T:10--><br />
|-<br />
| PROJECT <br> Système de fichiers Lustre, 19 Po d’espace au total ||<br />
<br />
<!--T:11--><br />
* Cet espace est conçu pour le partage de données entre membres d'un groupe et pour le stockage de beaucoup de données. <br />
* Grands [[Storage and file management/fr#Quotas_et_politiques|quotas]] ajustables par projet<br />
* Il y a une sauvegarde automatique une fois par jour.<br />
|}<br />
<br />
<!--T:12--><br />
Au tout début de la présente page, un tableau indique plusieurs adresses de connexion. Pour les transferts de données par [[Globus/fr|Globus]], il faut utiliser le '''Point de chute Globus'''. Par contre, pour les outils comme [[Transferring_data/fr#rsync|rsync]] et [[Transferring_data/fr#SCP|scp]], il faut utiliser l'adresse du '''Nœud de copie'''.<br />
<br />
=Réseautique haute performance= <!--T:13--><br />
Le réseau [https://fr.wikipedia.org/wiki/Bus_InfiniBand InfiniBand] [https://www.nvidia.com/en-us/networking/infiniband/qm8700/ HDR de Mellanox] relie tous les nœuds de la grappe. Chaque commutateur de 40 ports HDR (200 Gb/s) permet de connecter ensemble jusqu'à 66 nœuds en HDR100 (100 Gb/s) avec 33 liens HDR divisés en deux (2) par des câbles spéciaux. Les sept (7) liens HDR restants servent à connecter le commutateur d'un cabinet à chacun des sept (7) commutateurs HDR du réseau InfiniBand central. Les îlots de nœuds sont donc connectés avec un facteur de blocage maximum de 33:7 (4.7:1). Par contre, les serveurs de stockage sont branchés avec un facteur de blocage significativement plus bas pour une performance maximale.<br />
<br />
<!--T:14--><br />
En pratique, les cabinets de Narval contiennent des îlots de 48 ou 56 nœuds CPU réguliers. Il est donc possible d'exécuter des tâches parallèles utilisant jusqu’à 3584 cœurs et une réseautique non bloquante. Pour des tâches plus imposantes ou plus fragmentées sur le réseau, le facteur de blocage est de 4.7:1. L’interconnexion reste malgré tout de haute performance.<br />
<br />
=Caractéristiques des nœuds= <!--T:15--><br />
{| class="wikitable sortable"<br />
! nœuds !! cœurs !! mémoire disponible !! CPU !! stockage !! GPU<br />
|-<br />
| 1145 || rowspan="3"|64 || 249G ou 255000M || rowspan="2"|2 x AMD Rome 7532 @ 2.40 GHz 256M cache L3 || rowspan="3"|1 x SSD de 960G || rowspan="3"|-<br />
|-<br />
| 33 || 2009G ou 2057500M<br />
|-<br />
| 3 || 4000G ou 4096000M || 2 x AMD Rome 7502 @ 2.50 GHz 128M cache L3<br />
|-<br />
| 159 || 48 || 498G ou 510000M || 2 x AMD Milan 7413 @ 2.65 GHz 128M cache L3 || 1 x SSD de 3.84T || 4 x NVidia A100SXM4 (mémoire 40G), connectés via NVLink<br />
|}<br />
<br />
=Particularités liées aux processeurs AMD= <!--T:16--><br />
== Ensemble d'instructions pris en charge ==<br />
La grappe Narval est équipée de processeurs AMD EPYC de 2e et 3e génération qui prennent en charge les instructions [https://fr.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2]. Cet ensemble d'instructions est le même que celui des processeurs Intel que l'on retrouve sur les nœuds de [[Béluga#Caract.C3.A9ristiques_des_n.C5.93uds|Béluga]], [[Cedar/fr#Caract.C3.A9ristiques_des_n.C5.93uds|Cedar]], [[Graham/fr#Caract.C3.A9ristiques_des_n.C5.93uds|Graham]] et [[Niagara/fr#Caract.C3.A9ristiques_des_n.C5.93uds|Niagara]].<br><br />
<br />
<!--T:22--><br />
Narval ne prend toutefois pas en charge les instructions [https://en.wikipedia.org/wiki/AVX-512 AVX512], contrairement aux nœuds de Béluga et Niagara et à certains nœuds de Cedar et de Graham.<br />
<br />
<!--T:20--><br />
AVX2 est pris en charge là où les nœuds ont des CPU de type Broadwell alors que les deux ensembles d’instructions (AVX2 et AVX512) le sont là où les CPU sont de type [https://fr.wikipedia.org/wiki/Skylake Skylake] ou [https://en.wikipedia.org/wiki/Cascade_Lake_(microarchitecture Cascade Lake]. Par conséquent, une application compilée dans un nœud avec un CPU Broadwell de Cedar ou Graham, incluant leurs nœuds de connexion, pourra être exécutée sur Narval, mais ne pourra pas être exécutée si elle est compilée sur Béluga ou Niagara, ou dans un nœud Skylake ou Cascade Lake de Cedar ou Graham. Dans ce dernier cas, l’application devra être recompilée (voir ''Compilateurs Intel'' ci-dessous).<br />
<br />
<br />
<br />
==Compilateurs Intel== <!--T:17--><br />
Les compilateurs Intel peuvent très bien compiler des applications pour les processeurs AMD de Narval, et ce, en se limitant aux ensembles d'instructions AVX2 et les plus anciens. Pour ce faire, il faut utiliser l'option <tt>-march=core-avx2</tt> du compilateur Intel, ce qui permet d'obtenir des exécutables qui sont compatibles à la fois avec les processeurs Intel et AMD.<br />
<br />
<!--T:21--><br />
Par contre, si vous avez compilé un code sur un système utilisant des processeurs Intel et que vous avez utilisé une ou des options <tt>-xXXXX</tt>, telle que <tt>-xCORE-AVX2</tt>, les applications compilées ne fonctionneront pas sur Narval, car les compilateurs Intel ajoutent des instructions supplémentaires pour vérifier que le processeur utilisé est un produit Intel. Sur Narval, les options <tt>-xHOST</tt> et <tt>-march=native</tt> sont équivalentes à <tt>-march=pentium</tt> (l'ancien Pentium de 1993) et ne devraient <b>pas</b> être utilisés.<br />
<br />
==Environnements logiciels disponibles== <!--T:18--><br />
[[Standard software environments/fr|L'environnement logiciel standard <tt>StdEnv/2020</tt>]] est l'environnement par défaut sur Narval. Les anciennes versions ont été volontairement bloquées. Si vous avez besoin d'un logiciel qui n'est disponible que sur une ancienne version de l'environnement standard, nous vous invitons à envoyer une demande à [[Technical support/fr|notre soutien technique]].<br />
<br />
==Bibliothèques BLAS et LAPACK== <!--T:19--><br />
La bibliothèque Intel MKL fonctionne sur les processeurs AMD, mais elle n'est pas optimale. Nous favorisons dorénavant l'utilisation de FlexiBLAS. Pour plus de détails, consulter la page [[BLAS and LAPACK/fr|BLAS et LAPACK]].<br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Allocations_and_compute_scheduling/fr&diff=145007Allocations and compute scheduling/fr2023-10-05T12:43:10Z<p>Plstonge: </p>
<hr />
<div><languages /><br />
<br />
<br />
<i>Page enfant de [[Job scheduling policies/fr|Politique d'ordonnancement des tâches]]</i><br />
<br />
=Allocations pour le calcul haute performance=<br />
<br />
<b>Une <i>allocation</i> est l’attribution d’une quantité de ressources à un groupe de recherche pour une période donnée, habituellement un an.</b> Il s'agit soit d'un maximum comme dans le cas du stockage, soit d'une moyenne d'utilisation sur une période donnée comme c'est le cas pour les ressources partagées que sont les cœurs de calcul.<br />
<br />
L’allocation des ressources de stockage attribue un maximum déterminé d’espace réservé à l’usage exclusif d’un groupe de recherche. Pour sa part, l’allocation des ressources partagées que sont les cœurs-année et les GPU-année est plus complexe puisque ces ressources sont partagées par l’ensemble des groupes et que l’allocation tient compte de l’utilisation moyenne de chaque groupe.<br />
<br />
La durée de l’allocation est une valeur de référence utilisée pour calculer la moyenne de la consommation des ressources au cours de la période pendant laquelle celles-ci sont disponibles. Par exemple, si les grappes ne sont pas disponibles pour une semaine dû à des opérations de maintenance, les groupes de recherche touchés n’obtiennent pas une semaine additionnelle en compensation à la fin de la période. De la même manière, si la période d’allocation est allongée, les groupes n’y perdent pas en utilisation.<br />
<br />
Notons qu’une allocation de cœurs-année et de GPU-année en ressources partagées considère la moyenne d’utilisation cible dans le temps; un groupe est donc plus susceptible d’atteindre et même de dépasser ses cibles en utilisant ses ressources de façon régulière sur la période qu’en soumettant des tâches en rafale (''burst'') ou en les reportant à plus tard.<br />
<br />
==De l'allocation à l'ordonnancement par priorité==<br />
<br />
Les ressources de calcul par cœurs-année et par GPU-année reçoivent des tâches qui sont immédiatement prises en charge par l’ordonnanceur. Rappelons qu’une tâche se compose d’une application logicielle et de la liste des ressources pour l’exécuter. L’ordonnanceur est aussi une application logicielle dont le rôle est de calculer la priorité de chaque tâche et de lui attribuer les ressources nécessaires selon leur disponibilité et en accord avec les règles de priorisation.<br />
<br />
À l’aide d’algorithmes spécialisés, l’ordonnanceur tient compte des cibles de chaque groupe et compare la consommation récente du groupe à l’utilisation qui lui était allouée. Un des facteurs déterminants est la consommation à l’intérieur de la période. Le facteur qui possède cependant le plus de poids est la consommation (ou la non-consommation) récente, ceci en vue d’offrir une opération plus stable aux groupes dont l’utilisation réelle se rapproche des ressources qui leur étaient allouées. Cette façon de procéder assure une meilleure répartition du parc de ressources pour l’ensemble des groupes et fait en sorte qu’il est théoriquement possible pour tous les groupes d’atteindre leurs cibles.<br />
<br />
==Conséquences d'une surutilisation d'une allocation CPU ou GPU==<br />
<br />
Si vous avez des tâches en attente et qu’à ce moment la demande en ressources de calcul est basse, l’ordonnanceur pourrait faire exécuter vos tâches même si vous dépassez la quantité cible de votre allocation. Tout ce qui peut se produire alors serait que les prochaines tâches que vous soumettrez se voient attribuer un plus bas niveau de priorité que celles soumises par des groupes qui n’ont pas encore atteint leur niveau cible d’utilisation. Aucune tâche soumise à l’ordonnanceur n’est refusée en raison d’une surutilisation de ressources et votre utilisation moyenne de ressources sur la période d’allocation devrait se situer proche de la cible qui vous a été allouée.<br />
<br />
Il se pourrait qu’au cours d’un mois ou d’une année vous puissiez accomplir plus de travail que votre allocation ne semblerait le permettre, mais ce scénario est peu probable puisque la demande est plus élevée que la quantité de ressources dont nous disposons.<br />
<br />
=Unités GPU de référence (UGR)=<br />
{{Note|Cette nouvelle unité sera utilisée à partir du concours pour l'allocation de ressources de 2024.}}<br />
<br />
Comme vous le savez peut-être, la performance des GPU a considérablement augmenté ces dernières années et devrait continuer sa progression avec la prochaine génération. Par le passé et jusqu'au concours de 2023, nous traitions tous les GPU comme étant équivalents les uns aux autres, tant au moment de l'allocation que dans le calcul du nombre de ressources consommées par le groupe. Ceci diminuait la complexité de nos outils de gestion des ressources, mais créait des problèmes d'équité, à la fois dans le processus d'attribution et lors de l'exécution des tâches. Nous ne pouvons donc plus continuer à traiter tous les types de GPU de la même manière.<br />
<br />
Afin de résoudre le problème d'équité, nous avons créé l'<i>unité GPU de référence</i> (ou <i>UGR</i>) qui nous permet de classer les différents modèles de GPU en production sur la base de leur performance nominale. Parce qu'environ la moitié des tâches utilisent principalement des opérations à virgule flottante simple précision ([https://en.wikipedia.org/wiki/Single-precision_floating-point_format FP32]) et que les autres utilisent des opérations à virgule flottante demi-précision ([https://en.wikipedia.org/wiki/Half-precision_floating-point_format FP16]), et que la plupart des utilisateurs se soucient de la mémoire sur du GPU lui-même, nous avons établi les critères d'évaluation suivants avec leur poids correspondant :<br />
<br />
{| class="wikitable" style="margin: auto;"<br />
|-<br />
! scope="col"| Critères d'évaluation<br />
! scope="col"| Poids <br> (UGR)<br />
|-<br />
! scope="row"| Score FP32<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score FP16<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score mémoire GPU<br />
| 20% * 4 = 0.8<br />
|}<br />
<br />
Pour plus de commodité, les pondérations sont basées sur des pourcentages augmentés d'un facteur de 4 UGR. Ensuite, en utilisant le <b>A100-40gb</b> comme modèle de référence, nous obtenons les scores suivants pour chaque modèle&nbsp;:<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
|<br />
! scope="col"| Score FP32<br />
! scope="col"| Score FP16<br />
! scope="col"| Score mémoire<br />
! scope="col"| Score pondéré<br />
|-<br />
! scope="col"| Poids:<br />
! scope="col"| 1.6<br />
! scope="col"| 1.6<br />
! scope="col"| 0.8<br />
| (UGR)<br />
|-<br />
! scope="row" style="text-decoration: underline;"| Modèle<br />
|-<br />
! scope="row"| P100-12gb<br />
| 0.48<br />
| 0.00<br />
| 0.3<br />
! 1.0<br />
|-<br />
! scope="row"| P100-16gb<br />
| 0.48<br />
| 0.00<br />
| 0.4<br />
! 1.1<br />
|-<br />
! scope="row"| T4-16gb<br />
| 0.42<br />
| 0.21<br />
| 0.4<br />
! 1.3<br />
|-<br />
! scope="row"| V100-16gb<br />
| 0.81<br />
| 0.40<br />
| 0.4<br />
! 2.2<br />
|-<br />
! scope="row"| V100-32gb<br />
| 0.81<br />
| 0.40<br />
| 0.8<br />
! 2.6<br />
|-<br />
! scope="row"| A100-40gb<br />
| <b>1.00</b><br />
| <b>1.00</b><br />
| <b>1.0</b><br />
! 4.0<br />
|-<br />
! scope="row"| A100-80gb*<br />
| 1.00<br />
| 1.00<br />
| 2.0<br />
! 4.8<br />
|}<br />
<br />
(*) Sur Graham, ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
Par exemple, le plus ancien modèle de GPU en production est le P100-12gb qui vaut 1.0 UGR. Les prochaines générations de GPU seront comparées avec la même formule au modèle A100-40gb.<br />
<br />
==Choisir des modèles de GPU pour votre projet==<br />
<br />
Les scores relatifs du précédent tableau devraient vous aider à sélectionner les modèles les plus convenables. Les exemples suivants présentent des cas extrêmes.<br />
<br />
* Si vos applications font surtout des opérations FP32, le modèle A100-40gb devrait être deux fois plus rapide que le P100-12gb, mais l'utilisation des ressources sera considérée comme étant quatre fois plus grande. En conséquence, pour le même nombre d'UGR, le modèle P100-12gb devrait vous permettre d'exécuter deux fois plus de calculs. <br />
* Si vos applications font surtout des opérations FP16 (ce qui est le cas en intelligence artificielle et avec les opérations à précision mixte ou utilisant [https://en.wikipedia.org/wiki/Bfloat16_floating-point_format d'autres formats à virgule flottante]), l'utilisation d'un A100-40gb sera calculée comme utilisant quatre fois les ressources d'un P100-12gb, mais pourra faire ~30 fois plus de calculs dans la même période, ce qui vous permettrait d'exécuter ~7.5 fois plus de calculs.<br />
<br />
==À compter du concours de 2024==<br />
<br />
* Pour le concours d'allocation de ressources de 2024, votre demande de GPU doit indiquer le modèle de GPU que vous préférez. Le nombre d’UGR sera automatiquement calculé sur la base des GPU-années par année du projet et enregistré dans le formulaire électronique dans CCDB.<br />
** Par exemple, si vous sélectionnez la ressource <i>narval-gpu</i> et demandez 13 GPU-années du modèle A100-40gb, le nombre d’UGR sera 13&nbsp;*&nbsp;4.0&nbsp;=&nbsp;52. Le comité d’administration du concours vous allouerait un maximum de 52&nbsp;UGR, dépendant de la note attribuée à votre demande. Dans le cas où votre allocation serait déplacée sur Cedar, le comité vous allouerait jusqu’à 20&nbsp;GPU-années, puisque chaque GPU V100-32gb vaut 2.6&nbsp;UGR (et 52&nbsp;/&nbsp;2.6&nbsp;=&nbsp;20).<br />
<br />
* L’emploi des UGR entrera en vigueur le 1er avril 2024 avec le concours pour l'allocation des ressources de 2024. Cette unité servira à l’ordonnancement des tâches et au calcul de l’utilisation des ressources qui est rapportée dans CCDB.<br />
<br />
=Effet détaillé de l'utilisation des ressources sur la priorité=<br />
<br />
Le principe gouverneur dans notre façon de déterminer la priorité des tâches de calcul se base sur les ressources qu’une tâche rend <b>non disponibles aux autres utilisateurs</b> plutôt que sur les ressources effectivement utilisées.<br />
<br />
Le cas de cœurs non utilisés qui influent sur le calcul des priorités se produit souvent lorsqu’une tâche est soumise en demandant plusieurs cœurs, mais n’en consomme effectivement qu’une partie à l’exécution. C’est le nombre de cœurs demandés par une tâche qui a une incidence sur la priorisation des prochaines tâches puisque la tâche bloque les cœurs non utilisés pendant son exécution.<br />
<br />
Un autre cas fréquent de cœurs non utilisés se pose lorsqu’une tâche exige plus de mémoire que celle demandée pour un cœur. Sur une grappe où chaque cœur serait doté de 4Go de mémoire, une tâche qui demanderait un seul cœur et 8Go de mémoire bloquerait donc 2 cœurs et le deuxième cœur ne serait pas disponible pour les tâches des autres groupes de recherche<br />
<br />
==Équivalents-cœurs utilisés par l'ordonnanceur==<br />
<br />
Un équivalent-cœur se compose d’'''un cœur simple et d’une certaine quantité de mémoire'''; pour le nommer, nous utilisons le terme ''bundle''. En plus du cœur, le bundle contient aussi la mémoire considérée comme étant associée à ce cœur. <br />
<br />
[[File:EquivalentCoeur.png|frame|Figure 1 – ''Équivalent-cœur sur Cedar et Graham'']]<br />
<br />
Cedar et Graham offrent surtout des cœurs de 4Go et dans leur cas, l’équivalent-cœur est un bundle de 4 Go (voir Figure 1). Pour sa part, Niagara offre surtout des cœurs de 4.8Go, donc des bundles de 4.8Go. L’utilisation des ressources par une tâche est comptabilisée à raison de 4Go ou 4.8Go par cœur, comme mentionné ci-dessus.<br />
<br />
Le suivi des cibles s’avère relativement simple quand les ressources demandées sont des cœurs et des quantités de mémoire qui correspondent à un équivalent-cœur entier, plutôt qu’à une portion d’équivalent-cœur. Les choses se compliquent parce que l’utilisation de portions d’équivalents-cœur risque d’augmenter le pointage servant au calcul de la juste part du groupe de recherche. En pratique, la méthode appliquée résout le problème d'équité ou de perception d'équité, mais cette méthode n’est pas intuitive au début.<br />
<br />
Dans les exemples qui suivent, la mémoire est de 4Go.<br />
<br />
<b>Comptabilisation par équivalents-cœur</b><br />
<br />
Examinons le cas où nous avons un bundle composé de 1 cœur et 4Go de mémoire.<br />
<br />
* [[File:Two_core_equivalents.png|frame|Figure 2 <i>– Deux équivalents-cœurs</i>]] Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de mémoire, c’est-à-dire plus que le ratio 1cœur/4Go.<br />
*:Dans la figure 2, on demande 2 cœurs et 2Go par cœur pour une mémoire totale de 4Go; la tâche exige 2 équivalents-cœur pour les cœurs, mais un seul bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-cœurs. <br clear=all><br />
<br />
* [[File:Two_and_a_half_core_equivalents.png|frame|Figure 3 – <i>2.5 équivalents-cœur</i>]] La mémoire est comptabilisée si un groupe utilise plus de mémoire que le ratio de 1 cœur/4Go.<br />
*:Dans la figure 3, on demande 2 cœurs et 5Go par cœur pour une mémoire totale de 10Go; la tâche exige 2.5 bundles pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2.5 équivalents-cœurs. <br clear=all><br />
<br />
==Équivalents-UGR utilisés par l'ordonnanceur==<br />
<br />
L’utilisation des GPU et leurs ressources associées suit les mêmes principes que ceux décrits pour les équivalents-coeurs, sauf qu’une UGR est ajoutée au bundle avec de la mémoire et plusieurs cœurs. Ceci signifie que la comptabilisation de l’utilisation de la cible pour l’allocation de GPU doit inclure l’UGR. Tout comme le système de points utilisé dans l’expression de l’utilisation de la ressource en équivalents-cœurs, nous utilisons aussi un système de points pour les équivalents-UGR.<br />
<br />
Le calcul de priorité se fait en fonction du nombre maximum de bundles UGR-coeurs-mémoire demandés. Examinons le cas où nous avons un bundle de 1 UGR, 3 cœurs et 4Go de mémoire.<br />
[[File:EquivalentG1.png|thumb|upright=1.1|center|Figure 4 - ''1 équivalent-UGR'']] <br clear=all><br />
<br />
* Les UGR sont comptabilisés si un groupe utilise plus de UGR que de cœurs OU de mémoire par bundle. Prenons l'exemple d'un usager demandant 2 GPU (de 1 UGR chacun), 3 cœurs et 4Go de mémoire. La tâche exige donc l'équivalent de 2 bundles pour les GPU, mais un seul pour les cœurs et la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-UGR. <br />
[[File:EquivalentsG2_(GPUs).png|thumb|center|Figure 5 – ''2 équivalents-UGR'']] <br clear=all><br />
<br />
* Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de UGR OU plus de mémoire par bundle avec GPU. Dans la figure 6, on demande 1 GPU de 1 UGR, 5 cœurs et 5Go; la requête exige donc 1.66 bundles avec GPU pour les cœurs, mais un seul bundle pour le GPU et 1.25 bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue donc la demande à 1.66 équivalents-UGR.<br />
[[File:EquivalentsG1.66_(coeurs).png|thumb|center|Figure 6 – ''1.66 équivalents-GPU (cœurs)'']] <br clear=all><br />
<br />
* La mémoire est comptabilisée si un groupe utilise plus de mémoire que de UGR OU de cœurs par bundle avec GPU. Dans la figure 7, on demande 1 GPU de 1 UGR, 2 cœurs et 6Go; la requête exige donc 1.5 bundle avec GPU pour la mémoire, mais un seul bundle pour les GPU et 0.66 pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 1.5 équivalents-GPU.<br />
[[File:EquivalentsG1.5_(memoire).png|thumb|center|Figure 7 – ''1.5 équivalents-GPU (mémoire)'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU V100-32gb, 7.8 cœurs et 10.4 Go de mémoire-vive vaudrait 2.6 équivalents-UGR :<br />
[[File:EquivalentsG2.6_V100-32gb.png|thumb|upright=2.1|center|Figure 8 - ''2.6 équivalents-UGR, basés sur le GPU V100-32gb'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU A100-40gb, 12 cœurs et 16 Go de mémoire-vive vaudrait 4.0 équivalents-UGR :<br />
[[File:EquivalentsG4_A100-40gb.png|thumb|upright=2.66|center|Figure 9 - ''4.0 équivalents-UGR, basés sur le GPU A100-40gb'']] <br clear=all><br />
<br />
===Ratios dans les bundles===<br />
Les différents bundles UGR-coeur-mémoire et GPU-coeur-mémoire des systèmes de l'Alliance ont les caractéristiques suivantes :<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
! scope="col"| Grappe<br />
! scope="col"| Modèle GPU<br />
! scope="col"| UGR par GPU<br />
! scope="col"| Bundle par UGR<br />
! scope="col"| Bundle par GPU<br />
! scope="col"| Ratios physiques<br />
|-<br />
! scope="row"| [[Béluga#Caractéristiques_des_nœuds|Béluga]]<br />
| V100-16gb<br />
| 2.2<br />
| 4.5 cœurs / 21 Go<br />
| 10 cœurs / 46.5 Go<br />
| 10 cœurs / 46.5 Go<br />
|-<br />
! rowspan="3"| [[Cedar/fr#Caractéristiques_des_nœuds|Cedar]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="3"|3.1 cœurs / 25 Go<br />
| 3.1 cœurs / 25 Go<br />
| 6 cœurs / 31.2 Go<br />
|-<br />
| P100-16gb<br />
| 1.1<br />
| 3.4 cœurs / 27 Go<br />
| 6 cœurs / 62.5 Go<br />
|-<br />
| V100-32gb<br />
| 2.6<br />
| 8.0 cœurs / 65 Go<br />
| 8 cœurs / 46.5 Go<br />
|-<br />
! rowspan="5"| [[Graham/fr#Caractéristiques_des_nœuds|Graham]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="5"| 9.7 cœurs / 43 Go<br />
| 9.7 cœurs / 43 Go<br />
| 16 cœurs / 62 Go<br />
|-<br />
| T4-16gb<br />
| 1.3<br />
| 12.6 cœurs / 56 Go<br />
| {4, 11} cœurs / 46.8 Go<br />
|-<br />
| V100-16gb*<br />
| 2.2<br />
| 21.3 cœurs / 95 Go<br />
| 3.5 cœurs / 23.4 Go<br />
|-<br />
| V100-32gb*<br />
| 2.6<br />
| 25.2 cœurs / 112 Go<br />
| 5 cœurs / 47.1 Go<br />
|-<br />
| A100-80gb*<br />
| 4.8<br />
| 46.6 cœurs / 206 Go<br />
| {8, 16} c. / {62, 248} Go<br />
|-<br />
! scope="row"| [[Narval#Caractéristiques_des_nœuds|Narval]]<br />
| A100-40gb<br />
| 4.0<br />
| 3.0 cœurs / 31 Go<br />
| 12 cœurs / 124.5 Go<br />
| 12 cœurs / 124.5 Go<br />
|}<br />
<br />
(*) Ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
<b>Remarque :</b> Si l'ordonnanceur établit la priorité sur la base de l'utilisation calculée avec les bundles, une demande de plusieurs GPU sur un même nœud doit aussi tenir compte des ratios physiques.<br />
<br />
=Visionner les données d’utilisation par le groupe=<br />
<br />
[[File:Select view group usage fr edit.png|thumb|Onglet <i>Mon compte</i>, option <i>Utilisation par le groupe</i>]]<br />
Vous pouvez visionner les données d’utilisation des ressources par votre groupe en sélectionnant <i>Mon compte --> Utilisation par le groupe</i> dans la base de données CCDB. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_fr.png|thumb|Utilisation de CPU et de GPU, par ressource de calcul]]<br />
Les valeurs pour l’utilisation des CPU (cœurs-année) et des GPU-année sont calculées selon la quantité des ressources allouées aux tâches exécutées sur les grappes. Notez que les valeurs employées dans les graphiques ne représentent pas les équivalents-cœur; ainsi, l’utilisation par les tâches qui exigent beaucoup de mémoire ne correspond pas à l’utilisation du compte représentée par l’ordonnanceur de la grappe.<br />
<br />
La première barre d’onglets offre les vues suivantes&nbsp;:<br />
: <b>Par ressource de calcul</b>; nom de la grappe sur laquelle les tâches ont été soumises,<br />
: <b>Par projet (RAPI)</b>; projets auxquels les tâches ont été soumises,<br />
: <b>Par utilisateur</b>; utilisatrice ou utilisateur ayant soumis les tâches,<br />
: <b>Utilisation du stockage</b>; voyez [[Storage and file management/fr|Stockage et gestion des fichiers]].<br />
<br clear=all><br />
<br />
==Utilisation par ressource de calcul==<br />
<br />
Cette vue montre l’utilisation par ressource de calcul par grappe, pour tous les groupes desquels vous êtes propriétaire ou membre, pour l’année d’allocation en cours qui commence le 1er avril. Les données représentent l’utilisation à jour et supposent que cette utilisation restera la même jusqu’à la fin de l’année d’allocation. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_monthly_fr.png|thumb|Utilisation mensuelle par ressource]]<br />
Dans la colonne <i>Extra Info</i>, cliquez sur <i>Utilisation sur une base mensuelle</i> pour obtenir la répartition mensuelle pour la ressource correspondante. En cliquant sur <i>Utilisation par utilisateur</i>, la répartition se fait par utilisateur ou utilisatrice ayant soumis les tâches.<br />
<br clear=all><br />
<br />
==Utilisation par projet==<br />
[[File:Ccdb view use by compute resource monthly proj fr edit.png|thumb|Utilisation par projet, avec répartition mensuelle]]<br />
Pour cette vue, une troisième barre d'onglets permet de sélectionner l'identifiant de projet pour l'année d'allocation choisie. Le tableau montre les détails pour chaque projet ainsi que les ressources utilisées sur toutes les grappes. Dans le haut de la vue, on trouve le nom du compte (par exemple def-, rrg- ou rpp-*, etc.), le titre du projet et le ou la propriétaire, ainsi que les sommaires de l'allocation et de l'utilisation.<br />
<br clear=all><br />
<br />
==Utilisation des GPU en unités GPU de référence (UGR)==<br />
[[File:rgu_fr.png|thumb|Sommaire de l'utilisation des GPU et le détail en unités GPU de référence (UGR) par modèle.]]<br />
Pour chaque projet (RAPI) ayant une utilisation de GPU, le détail d'utilisation par modèle de GPU est donné en GPU-années et en UGR-années dans une table située au bas de la page.<br />
<br clear=all><br />
<br />
==Utilisation par utilisateur==<br />
[[File:Ccdb view use by submitter summary fr edit.png|thumb|Utilisation de CPU et GPU]]<br />
Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur une base mensuelle</i>.<br />
<br clear=all><br />
<br />
[[Category:SLURM]]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Allocations_and_compute_scheduling/50/fr&diff=145006Translations:Allocations and compute scheduling/50/fr2023-10-05T12:43:04Z<p>Plstonge: </p>
<hr />
<div>{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
|<br />
! scope="col"| Score FP32<br />
! scope="col"| Score FP16<br />
! scope="col"| Score mémoire<br />
! scope="col"| Score pondéré<br />
|-<br />
! scope="col"| Poids:<br />
! scope="col"| 1.6<br />
! scope="col"| 1.6<br />
! scope="col"| 0.8<br />
| (UGR)<br />
|-<br />
! scope="row" style="text-decoration: underline;"| Modèle<br />
|-<br />
! scope="row"| P100-12gb<br />
| 0.48<br />
| 0.00<br />
| 0.3<br />
! 1.0<br />
|-<br />
! scope="row"| P100-16gb<br />
| 0.48<br />
| 0.00<br />
| 0.4<br />
! 1.1<br />
|-<br />
! scope="row"| T4-16gb<br />
| 0.42<br />
| 0.21<br />
| 0.4<br />
! 1.3<br />
|-<br />
! scope="row"| V100-16gb<br />
| 0.81<br />
| 0.40<br />
| 0.4<br />
! 2.2<br />
|-<br />
! scope="row"| V100-32gb<br />
| 0.81<br />
| 0.40<br />
| 0.8<br />
! 2.6<br />
|-<br />
! scope="row"| A100-40gb<br />
| <b>1.00</b><br />
| <b>1.00</b><br />
| <b>1.0</b><br />
! 4.0<br />
|-<br />
! scope="row"| A100-80gb*<br />
| 1.00<br />
| 1.00<br />
| 2.0<br />
! 4.8<br />
|}</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Allocations_and_compute_scheduling&diff=145002Allocations and compute scheduling2023-10-05T12:41:40Z<p>Plstonge: Those GPUs are finally allocatable on Graham</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:31--><br />
<i>Parent page: [[Job scheduling policies]]</i><br />
<br />
=Allocations for high-performance computing= <!--T:2--><br />
<br />
<!--T:3--><br />
<b>An allocation is an amount of resources that a research group can target for use for a period of time, usually a year.</b> This amount is either a maximum amount, as is the case for storage, or an average amount of usage over the period, as is the case for shared resources like computation cores.<br />
<br />
<!--T:4--><br />
Allocations are usually made in terms of core years, GPU years, or storage space. Storage allocations are the most straightforward to understand: research groups will get a maximum amount of storage that they can use exclusively throughout the allocation period. Core year and GPU year allocations are more difficult to understand because these allocations are meant to capture average use throughout the allocation period---typically meant to be a year---and this use will occur across a set of resources shared with other research groups.<br />
<br />
<!--T:5--><br />
The time period of an allocation when it is granted is a reference value, used for the calculation of the average which is applied to the actual period during which the resources are available. This means that if the allocation period was a year and the clusters were down for a week of maintenance, a research group would not be entitled to an additional week of resource usage. Equally so, if the allocation period were to be extended by a month, research groups affected by such a change would not see their resource access diminish during this month.<br />
<br />
<!--T:6--><br />
It should be noted that in the case of core year and GPU year allocations, both of which target resource usage averages over time on shared resources, a research group is more likely to hit (or exceed) its target(s) if the resources are used evenly over the allocation period than if the resources are used in bursts or if use is put off until later in the allocation period.<br />
<br />
==From compute allocations to job scheduling== <!--T:7--><br />
<br />
<!--T:8--><br />
Compute-related resources granted by core-year and GPU-year allocations require research groups to submit what are referred to as <i>jobs</i> to a <i>scheduler</i>. A job is a combination of a computer program (an application) and a list of resources that the application is expected to use. The [[What is a scheduler?|scheduler]] is a program that calculates the priority of each job submitted and provides the needed resources based on the priority of each job and the available resources.<br />
<br />
<!--T:9--><br />
The scheduler uses prioritization algorithms to meet the allocation targets of all groups and it is based on a research group’s recent usage of the system as compared to their allocated usage on that system. The past of the allocation period is taken into account but the most weight is put on recent usage (or non-usage). The point of this is to allow a research group that matches their actual usage with their allocated amounts to operate roughly continuously at that level. This smooths resource usage over time across all groups and resources, allowing for it to be theoretically possible for all research groups to hit their allocation targets.<br />
<br />
==Consequences of overusing a CPU or GPU allocation== <!--T:32--><br />
<br />
<!--T:33--><br />
If you have jobs waiting to run, and competing demand is low enough, then the scheduler may allow more of your jobs to run than your target level. The only consequence of this is that succeeding jobs of yours <i>may</i> have lower priority for a time while the scheduler prioritizes other groups which were below their target. You are not prevented from submitting or running new jobs, and the average of your usage over time should still be close to your target, that is, your allocation.<br />
<br />
<!--T:34--><br />
It is even possible that you could end a month or even a year having run more work than your allocation would seem to allow, although this is unlikely given the demand on our resources.<br />
<br />
=Reference GPU Units= <!--T:45--><br />
{{Note|This is a new unit that will be used from RAC 2024.}}<br />
<br />
<!--T:46--><br />
As you may be aware, the performance of GPUs has dramatically increased in the recent years and is expected to do so again with the upcoming next generation of GPUs. Until RAC 2023, in order to reduce complexity, we have been treating all GPUs as equivalent to each other at allocation time and when considering how many resources groups have consumed. This has raised issues of fairness, both in the allocation process and while running jobs. We cannot continue to treat all GPU types as the same.<br />
<br />
<!--T:47--><br />
To overcome the fairness problem, we have defined a <i>reference GPU unit</i> (or <b>RGU</b>) in order to be able to rank all GPU models in production. Because roughly half of our users use primarily single-precision floating-point operations ([https://en.wikipedia.org/wiki/Single-precision_floating-point_format FP32]), the other half use half-precision floating-point operations ([https://en.wikipedia.org/wiki/Half-precision_floating-point_format FP16]), and a significant portion of all users care about the memory on the GPU itself, we set the following evaluation criteria with their corresponding weight:<br />
<br />
<!--T:48--><br />
{| class="wikitable" style="margin: auto;"<br />
|-<br />
! scope="col"| Evaluation Criteria<br />
! scope="col"| Weight <br> (RGU)<br />
|-<br />
! scope="row"| FP32 score<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| FP16 score<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| GPU memory score<br />
| 20% * 4 = 0.8<br />
|}<br />
<br />
<!--T:49--><br />
For convenience, weights are based on percentages up-scaled by a factor of 4 <i>reference GPU units</i> (RGUs). Then, by using the <b>A100-40gb</b> as the reference GPU model, we get the following scores for each model:<br />
<br />
<!--T:50--><br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
|<br />
! scope="col"| FP32 score<br />
! scope="col"| FP16 score<br />
! scope="col"| Memory score<br />
! scope="col"| Weighted Score<br />
|-<br />
! scope="col"| Weight:<br />
! scope="col"| 1.6<br />
! scope="col"| 1.6<br />
! scope="col"| 0.8<br />
| (RGU)<br />
|-<br />
! scope="row" style="text-decoration: underline;"| Model<br />
|-<br />
! scope="row"| P100-12gb<br />
| 0.48<br />
| 0.00<br />
| 0.3<br />
! 1.0<br />
|-<br />
! scope="row"| P100-16gb<br />
| 0.48<br />
| 0.00<br />
| 0.4<br />
! 1.1<br />
|-<br />
! scope="row"| T4-16gb<br />
| 0.42<br />
| 0.21<br />
| 0.4<br />
! 1.3<br />
|-<br />
! scope="row"| V100-16gb<br />
| 0.81<br />
| 0.40<br />
| 0.4<br />
! 2.2<br />
|-<br />
! scope="row"| V100-32gb<br />
| 0.81<br />
| 0.40<br />
| 0.8<br />
! 2.6<br />
|-<br />
! scope="row"| A100-40gb<br />
| <b>1.00</b><br />
| <b>1.00</b><br />
| <b>1.0</b><br />
! 4.0<br />
|-<br />
! scope="row"| A100-80gb*<br />
| 1.00<br />
| 1.00<br />
| 2.0<br />
! 4.8<br />
|}<br />
<br />
<!--T:59--><br />
(*) On Graham, these GPU models are available through a very few contributed GPU nodes. While all users can use them, they are not allocatable through the RAC process.<br />
<br />
<!--T:51--><br />
As an example, the oldest GPU model in production (P100-12gb) is worth 1.0 RGU. The next few generations of GPUs will be compared to the A100-40gb using the same formula.<br />
<br />
==Choosing GPU models for your project== <!--T:52--><br />
<br />
<!--T:53--><br />
The relative scores in the above table should give you a hint on the models to choose. Here is an example with the extremes:<br />
<br />
<!--T:54--><br />
* If your applications are doing primarily FP32 operations, an A100-40gb GPU is expected to be twice as fast as a P100-12gb GPU, but the recorded usage will be 4 times the resources. Consequently, for an equal amount of RGUs, P100-12gb GPUs should allow you to run double the computations.<br />
* If your applications (typically AI-related) are doing primarily FP16 operations (including mixed precision operations or using other [https://en.wikipedia.org/wiki/Bfloat16_floating-point_format floating-point formats]), using an A100-40gb will result in getting evaluated as using 4x the resources of a P100-12gb, but it is capable of computing ~30x the calculations for the same amount of time, which would allow you to complete ~7.5x the computations.<br />
<br />
==Starting from RAC 2024== <!--T:55--><br />
<br />
<!--T:56--><br />
* During the Resource Allocation Competition 2024 (RAC 2024), any proposal asking for GPUs will require to specify the preferred GPU model for the project. Then, in the CCDB form, the amount of reference GPU units (RGUs) will automatically be calculated from the requested amount of gpu-years per year of project.<br />
** For example, if you select the <i>narval-gpu</i> resource and request 13 gpu-years of the model A100-40gb, the corresponding amount of RGUs would be 13 * 4.0 = 52. The RAC committee would then allocate up to 52 RGUs, depending on the proposal score. In case your allocation must be moved to Cedar, the committee would instead allocate up to 20 gpu-years, because each V100-32gb GPU is worth 2.6 RGUs (and 52 / 2.6 = 20).<br />
<br />
<!--T:57--><br />
* For job scheduling and for usage accounting on CCDB, the use of <i>reference GPU units</i> will take effect on April 1st, 2024, with the implementation of RAC 2024.<br />
<br />
=Detailed effect of resource usage on priority= <!--T:10--><br />
<br />
<!--T:11--><br />
The overarching principle governing the calculation of priority on our national clusters is that compute-based jobs are considered in the calculation based on the resources that others are prevented from using and not on the resources actually used.<br />
<br />
<!--T:12--><br />
The most common example of unused cores contributing to a priority calculation occurs when a submitted job requests multiple cores but uses fewer cores than requested when run. The usage that will affect the priority of future jobs is the number of cores requested, not the number of cores the application actually used. This is because the unused cores were unavailable to others to use during the job.<br />
<br />
<!--T:13--><br />
Another common case is when a job requests memory beyond what is associated with the cores requested. If a cluster that has 4GB of memory associated with each core receives a job request for only a single core but 8GB of memory, then the job will be deemed to have used two cores. This is because other researchers were effectively prevented from using the second core because there was no memory available for it.<br />
<br />
==Cores equivalent used by the scheduler== <!--T:15--><br />
<br />
<!--T:16--><br />
A core equivalent is a bundle made up of a single core and some amount of associated memory. In other words, a core equivalent is a core plus the amount of memory considered to be associated with each core on a given system. <br />
<br />
<!--T:17--><br />
[[File:Core_equivalent_diagram_GP.png|frame|Figure 1 - Core equivalent diagram for Cedar and Graham.]]<br />
<br />
<!--T:18--><br />
Cedar and Graham are considered to provide 4GB per core, since this corresponds to the most common node type in those clusters, making a core equivalent on these systems a core-memory bundle of 4GB per core. Niagara is considered to provide 4.8GB of memory per core, making a core equivalent on it a core-memory bundle of 4.8GB per core. Jobs are charged in terms of core equivalent usage at the rate of 4 or 4.8 GB per core, as explained above. See Figure 1.<br />
<br />
<!--T:19--><br />
Allocation target tracking is straightforward when requests to use resources on the clusters are made entirely of core and memory amounts that can be portioned only into complete equivalent cores. Things become more complicated when jobs request portions of a core equivalent because it is possible to have many points counted against a research group’s allocation, even when they are using only portions of core equivalents. In practice, the method used by the Alliance to account for system usage solves problems about fairness and perceptions of fairness but unfortunately the method is not initially intuitive.<br />
<br />
<!--T:20--><br />
Research groups are charged for the maximum number of core equivalents they take from the resources. Assuming a core equivalent of 1 core and 4GB of memory:<br />
* [[File:Two_core_equivalents.png|frame|Figure 2 - Two core equivalents.]] Research groups using more cores than memory (above the 1 core/4GB memory ratio), will be charged by cores. For example, a research group requesting two cores and 2GB per core for a total of 4 GB of memory. The request requires 2 core equivalents worth of cores but only one bundle for memory. This job request will be counted as 2 core equivalents when priority is calculated. See Figure 2. <br clear=all><br />
<br />
<!--T:21--><br />
* [[File:Two_and_a_half_core_equivalents.png|frame|Figure 3 - 2.5 core equivalents.]] Research groups using more memory than the 1 core/4GB ratio will be charged by memory. For example, a research group requests two cores and 5GB per core for a total of 10 GB of memory. The request requires 2.5 core equivalents worth of memory, but only two bundles for cores. This job request will be counted as 2.5 core equivalents when priority is calculated. See Figure 3. <br clear=all><br />
<br />
==Reference GPU unit equivalent used by the scheduler== <!--T:22--><br />
<br />
<!--T:23--><br />
Use of GPUs and their associated resources follow the same principles as already described for core equivalents, except that a reference GPU unit (RGU) is added to the bundle alongside multiple cores and memory. This means that the accounting for GPU-based allocation targets must include the RGU. Similar to how the point system was used above when considering resource use as an expression of the concept of core equivalence, we use a similar point system here as an expression of RGU equivalence.<br />
<br />
<!--T:25--><br />
Research groups are charged for the maximum number of RGU-core-memory bundles they use. Assuming a fictive bundle of 1 RGU, 3 cores, and 4 GB of memory: <br />
[[File:GPU_equivalent_diagram.png|thumb|upright=1.1|center|Figure 4 - RGU equivalent diagram.]] <br clear=all><br />
<br />
<!--T:26--><br />
* Research groups using more RGUs than cores or memory per RGU-core-memory bundle will be charged by RGU. For example, a research group requests 2 P100-12gb GPUs (1 RGU each), 3 cores, and 4 GB of memory. The request is for 2 bundles worth of RGUs, but only one bundle for memory and cores. This job request will be counted as 2 RGU equivalents when the research group’s priority is calculated.<br />
[[File:Two_GPU_equivalents.png|thumb|center|Figure 5 - Two RGU equivalents.]] <br clear=all><br />
<br />
<!--T:27--><br />
* Research groups using more cores than RGUs or memory per RGU-core-memory bundle will be charged by core. For example, a researcher requests 1 RGU, 5 cores, and 5 GB of memory. The request is for 1.66 bundles worth of cores, but only one bundle for RGUs and 1.25 bundles for memory. This job request will be counted as 1.66 RGU equivalents when the research group’s priority is calculated.<br />
[[File:GPU_and_a_half_(cores).png|thumb|center|Figure 6 - 1.66 RGU equivalents, based on cores.]] <br clear=all><br />
<br />
<!--T:28--><br />
* Research groups using more memory than RGUs or cores per RGU-core-memory bundle will be charged by memory. For example, a researcher requests 1 RGU, 2 cores, and 6 GB of memory. The request is for 1.5 bundles worth of memory, but only one bundle for GPUs and 0.66 bundle for cores. This job request will be counted as 1.5 RGU equivalents when the research group’s priority is calculated.<br />
[[File:GPU_and_a_half_(memory).png|thumb|center|Figure 7 - 1.5 RGU equivalents, based on memory.]] <br clear=all><br />
<br />
<!--T:60--><br />
* On the same fictive cluster, a bundle with one V100-32gb GPU, 7.8 CPU cores and 10.4 GB of memory is worth 2.6 RGU equivalents:<br />
[[File:Two.Six_RGU_equivalents.png|thumb|upright=2.1|center|Figure 8 - 2.6 RGU equivalents, based on the V100-32gb GPU.]] <br clear=all><br />
<br />
<!--T:61--><br />
* On the same fictive cluster, a bundle with one A100-40gb GPU, 12 CPU cores and 16 GB of memory is worth 4.0 RGU equivalents:<br />
[[File:Four_RGU_equivalents.png|thumb|upright=2.66|center|Figure 9 - 4.0 RGU equivalents, based on the A100-40gb GPU.]] <br clear=all><br />
<br />
===Ratios in bundles=== <!--T:29--><br />
Alliance systems have the following RPU-core-memory and GPU-core-memory bundle characteristics:<br />
<br />
<!--T:58--><br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
! scope="col"| Cluster<br />
! scope="col"| GPU model<br />
! scope="col"| RGU per GPU<br />
! scope="col"| Bundle per RGU<br />
! scope="col"| Bundle per GPU<br />
! scope="col"| Physical ratios<br />
|-<br />
! scope="row"| [[Béluga/en#Node_Characteristics|Béluga]]<br />
| V100-16gb<br />
| 2.2<br />
| 4.5 cores / 21 GB<br />
| 10 cores / 46.5 GB<br />
| 10 cores / 46.5 GB<br />
|-<br />
! rowspan="3"| [[Cedar#Node_characteristics|Cedar]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="3"|3.1 cores / 25 GB<br />
| 3.1 cores / 25 GB<br />
| 6 cores / 31.2 GB<br />
|-<br />
| P100-16gb<br />
| 1.1<br />
| 3.4 cores / 27 GB<br />
| 6 cores / 62.5 GB<br />
|-<br />
| V100-32gb<br />
| 2.6<br />
| 8.0 cores / 65 GB<br />
| 8 cores / 46.5 GB<br />
|-<br />
! rowspan="5"| [[Graham#Node_characteristics|Graham]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="5"| 9.7 cores / 43 GB<br />
| 9.7 cores / 43 GB<br />
| 16 cores / 62 GB<br />
|-<br />
| T4-16gb<br />
| 1.3<br />
| 12.6 cores / 56 GB<br />
| {4, 11} cores / 46.8 GB<br />
|-<br />
| V100-16gb*<br />
| 2.2<br />
| 21.3 cores / 95 GB<br />
| 3.5 cores / 23.4 GB<br />
|-<br />
| V100-32gb*<br />
| 2.6<br />
| 25.2 cores / 112 GB<br />
| 5 cores / 47.1 GB<br />
|-<br />
| A100-80gb*<br />
| 4.8<br />
| 46.6 cores / 206 GB<br />
| {8, 16} c. / {62, 248} GB<br />
|-<br />
! scope="row"| [[Narval/en#Node_Characteristics|Narval]]<br />
| A100-40gb<br />
| 4.0<br />
| 3.0 cores / 31 GB<br />
| 12 cores / 124.5 GB<br />
| 12 cores / 124.5 GB<br />
|}<br />
<br />
<!--T:62--><br />
(*) These GPU models are available through a very few contributed GPU nodes. While all users can use them, they are not allocatable through the RAC process.<br />
<br />
<!--T:63--><br />
<b>Note:</b> While the scheduler will compute the priority based on the usage calculated with the above bundles, users requesting multiple GPUs per node also have to take into account the physical ratios.<br />
<br />
=Viewing group usage of compute resources= <!--T:35--><br />
<br />
<!--T:36--><br />
[[File:Select view group usage edit.png|thumb|Navigation to <i>View Group Usage</i>]]<br />
Information on the usage of compute resources by your groups can be found by logging into the CCDB and navigating to <i>My Account > View Group Usage</i>.<br />
<br clear=all><br />
<br />
<!--T:43--><br />
[[File:ccdb_view_use_by_compute_resource.png|thumb|CPU and GPU usage by compute resource]]<br />
CPU and GPU core year values are calculated based on the quantity of the resources allocated to jobs on the clusters. It is important to note that the values summarized in these pages do not represent core-equivalent measures such that, in the case of large memory jobs, the usage values will not match the cluster scheduler’s representation of the account usage.<br />
<br />
<!--T:37--><br />
The first tab bar offers these options:<br />
: <b>By Compute Resource</b>: cluster on which jobs are submitted; <br />
: <b>By Resource Allocation Project</b>: projects to which jobs are submitted;<br />
: <b>By Submitter</b>: user that submits the jobs;<br />
: <b>Storage usage</b> is discussed in [[Storage and file management]]. <br />
<br clear=all><br />
<br />
==Usage by compute resource== <!--T:38--><br />
<br />
<!--T:44--><br />
This view shows the usage of compute resources per cluster used by groups owned by you or of which you are a member for the current allocation year starting April 1st. The tables contain the total usage to date as well as the projected usage to the end of the current allocation period.<br />
<br clear=all><br />
<br />
<!--T:39--><br />
[[File:Ccdb_view_use_by_compute_resource_monthly.png|thumb|Usage by compute resource with monthly breakdown]]<br />
From the <i>Extra Info</i> column of the usage table <i>Show monthly usage</i> can be clicked to display a further breakdown of the usage by month for the specific cluster row in the table. By clicking <i>Show submitter usage</i>, a similar breakdown is displayed for the specific users submitting the jobs on the cluster.<br />
<br clear=all><br />
<br />
==Usage by resource allocation project== <!--T:40--><br />
[[File:Ccdb view use by compute resource monthly proj edit.png|thumb|Usage by Resource Allocation Project with monthly breakdown]]<br />
Under this tab, a third tag bar displays the RAPIs (Resource Allocation Project Identifiers) for the selected allocation year. The tables contain detailed information for each allocation project and the resources used by the projects on all of the clusters. The top of the page summarizes information such as the account name (e.g. def-, rrg- or rpp-*, etc.), the project title and ownership, as well as allocation and usage summaries.<br />
<br clear=all><br />
<br />
==GPU usage and Reference GPU Units (RGUs)== <!--T:41--><br />
[[File:Rgu en.png|thumb|alt=GPU usage|GPU usage summary with Reference GPU Unit (RGU) breakdown table.]]<br />
For resource allocation projects that have GPU usage the table is broken down into usage on various GPU models and measured in RGUs.<br />
<br clear=all><br />
<br />
==Usage by submitter== <!--T:42--><br />
[[File:Ccdb view use by submitter summary edit.png|thumb|CPU and GPU usage by submitter]]<br />
Usage can also be displayed grouped by the users that submitted jobs from within the resource allocation projects (group accounts). The view shows the usage for each user aggregated across systems.<br />
Selecting from the list of users will display that user’s usage broken down by cluster. Like the group summaries, these user summaries can then be broken down monthly by clicking the Show monthly usage link of the Extra Info column of the CPU/GPU Usage (in core/GPU] years) table for the specific Resource row. <br />
<br clear=all><br />
<br />
<!--T:30--><br />
[[Category:SLURM]]<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=144928Multifactor authentication2023-10-04T15:52:33Z<p>Plstonge: Modify image layout - disconnect from the paragraph</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approving a notification on a smart device through the Duo Mobile application.<br />
*Entering a code generated on demand.<br />
*Pushing a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be progressively deployed, that is, it will not be immediately available for all our services.<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== To use a smartphone or tablet == <!--T:3--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or on [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Note that TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are not compatible with Duo.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], connect to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device.<br />
#In the Duo Mobile application, click the "+" sign to add a new account, and scan the QR code that is shown to you.<br />
<br />
== To use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey 5 is your best option. <br />
<br />
<!--T:40--><br />
'''Note that only the Yubikey 5 Series are compatible. '''<br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Among the many protocols supported by YubiKeys, the one which works with SSH connections to our clusters is the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates and transmits a string of 32 characters to complete your authentication.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1s to 2.5), while slot 2 is a long touch on the key (pressing for 3s to 5s). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce the frequency with which you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can install OpenSSH using the instructions on [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui this page]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specifics to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or more recent.<br />
<br />
<!--T:43--><br />
When connecting to a remote server, MobaXterm establishes by default two connections:<br />
the first one for the terminal and the second one for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
<br />
</translate><br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<translate><br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or more recent. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an Android phone which is older than Android 9. I do not find the Duo Mobile application. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website. See [https://help.duo.com/s/article/2211?language=en_US this page] for more details. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering what options to implement for automation, but we do not have a general solution implemented yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
== What should I do when I receive the message "Access denied. Duo Security does not provide services in your current location" ? == <!--T:44--><br />
This is a consequence of Duo being a US product: [https://help.duo.com/s/article/7544?language=en_US Duo help]. You'll need to use a VPN to circumvent this, to make it appear you're coming from an unaffected country.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=JupyterHub/fr&diff=144839JupyterHub/fr2023-10-03T15:53:20Z<p>Plstonge: </p>
<hr />
<div><languages /><br />
JupyterHub est le meilleur système pour permettre à plusieurs personnes d'utiliser simultanément Jupyter Notebook, qu'il s'agisse d'un groupe dans un contexte d'enseignement ou de recherche, ou dans une entreprise de science des données.<br />
<ref>http://jupyterhub.readthedocs.io/en/latest/index.html</ref><br />
<br />
JupyterHub offre une version préconfigurée de JupyterLab et/ou Jupyter Notebook; pour plus d'information sur les options de configuration, consultez la [[Jupyter/fr| page Jupyter]].<br />
<br />
= Initiatives de l'Alliance =<br />
<br />
Notre réseau comprend quelques <i>hubs</i> qui permettent l'accès aux ressources de calcul de pointe.<br />
<br />
== JupyterHub sur une grappe ==<br />
<br />
Utilisez votre nom d'utilisateur et votre mot de passe de de votre compte avec l'Alliance pour vous connecter aux grappes suivantes&nbsp;:[[#clusters_note|<sup>‡</sup>]].<br />
{| class="wikitable"<br />
|-<br />
! JupyterHub !! Commentaires<br />
|-<br />
| <b>[https://jupyterhub.beluga.alliancecan.ca/ Béluga]</b> || Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web.<br />
|-<br />
| <b>[https://jupyterhub.cedar.computecanada.ca/ Cedar]</b> || Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web. L'authentification se fait via <b>idpmfa.mit.c3.ca</b>.<br />
|-<br />
| <b>[https://jupyterhub.narval.alliancecan.ca/ Narval]</b> || Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web.<br />
|-<br />
| <b>[https://jupyter.scinet.utoronto.ca/ Niagara]</b> || Possède un nœud JupyterHub qui peut exécuter des sessions Jupyter Notebook. Pour plus d'information, voyez [https://docs.scinet.utoronto.ca/index.php/Jupyter_Hub la page wiki de SciNet sur JupyterHub]<br />
|-<br />
| <b>[https://jupyterhub.sharcnet.ca/ Graham]</b>|| Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web.<br />
|}<br />
<br />
<b><sup id="clusters_note">‡</sup> Les nœuds de calcul sur lesquels les noyaux (<i>kernels</i>) Jupyter sont activés n'ont pas accès à l'internet.</b> En conséquence, vous pouvez seulement copier des fichiers vers et à partir de votre propre ordinateur. Vous ne pouvez pas télécharger du code ou des données de l'internet par exemple avec <code>git clone</code> ou <code>pip install</code> si le <i>wheel</i> ne se trouve pas dans notre <i>[[Available Python wheels/fr|wheelhouse]]</i>. Aussi, des problèmes pourraient survenir si votre code effectue des téléchargements ou des téléversements, dans le cas par exemple de l'apprentissage machine où les données sont souvent téléchargées à partir du code.<br />
<br />
== JupyterHub pour les universités et les écoles ==<br />
<br />
* En collaboration avec l'Alliance et [http://www.cybera.ca Cybera], le [https://www.pims.math.ca Pacific Institute for the Mathematical Sciences] offre des hubs infonuagiques aux établissements d'enseignement. Chacun peut avoir son propre hub auquel les utilisateurs accèdent via leur compte d'établissement. Les hubs sont hébergés par notre [[Cloud/fr|service infonuagique]] et servent essentiellement à des fins de formation. Les établissements souhaitant obtenir un hub peuvent consulter [http://syzygy.ca http://syzygy.ca].<br />
<br />
= Options pour le serveur =<br />
<br />
[[File:JupyterHub_Server_Options.png|thumb|Options pour le serveur sur Béluga]]<br />
Une fois la connexion établie et selon la configuration de JupyterHub, le navigateur web est redirigé vers<br />
<b>a)</b> un serveur Jupyter précédemment lancé,<br />
<b>b)</b> un nouveau serveur Jupyter possédant des options par défaut, ou<br />
<b>c)</b> un formulaire permettant de configurer les options du serveur Jupyter avant d'appuyer sur le bouton <i>Start</i>.<br />
Dans tous les cas, c'est l'équivalent d'accéer aux ressources demandées via [[Running_jobs/fr#Tâches_interactives|une tâche interactive]] sur la grappe correspondante.<br />
<br />
<b>Important :</b> Sur chaque grappe, une seule tâche interactive à la fois obtient une plus haute priorité pour commencer à l'intérieur de quelques secondes ou quelques minutes. Ceci inclut les tâches exécutées via <code>salloc</code>, <code>srun</code> et les tâches JupyterHub. Si vous avez une autre tâche interactive en exécution sur la grappe où se trouve JupyterHub, votre nouvelle session Jupyter pourrait ne pas commencer avant la limite de 5 minutes.<br />
<br />
== Ressources de calcul==<br />
<br />
Par exemple, les options pour [https://jupyterhub.beluga.computecanada.ca/ JupyterHub sur Béluga] sont :<br />
* <i>Account</i> : vous pouvez utiliser un compte de calcul de type <code>def-*</code>, <code>rrg-*</code>, <code>rpp-*</code> ou <code>ctb-*</code> auquel vous avez accès;<br />
* <i>Time (hours)</i> : nombre d'heures requises pour la session;<br />
* <i>Number of cores</i> : nombre de CPU réservés sur un seul nœud;<br />
* <i>Memory (MB)</i> : limite de mémoire vive totale pour toute la session; <br />
* ''GPU configuration'' (optionnel) : au moins un GPU;<br />
* <i>[[JupyterHub/fr#Interface_utilisateur | Interface utilisateur]]</i> (voir ci-dessous).<br />
<br />
== Interface utilisateur ==<br />
<br />
JupyterHub permet d'avoir accès à un serveur à la fois, mais plusieurs interfaces peuvent être offertes sous <i>User Interface</i> : <br />
* Jupyter Notebook (interface classique) : cette interface offre beaucoup de fonctionnalités, mais la plupart des utilisateurs choisissent désormais [[JupyterHub/fr#JupiterLab|JupyterLab]] qui est une meilleure plateforme et qui possède beaucoup plus de caractéristiques;<br />
* <b>[[JupyterHub/fr#JupyterLab | JupyterLab]]</b> (interface moderne) : cette interface Jupyter est la plus recommandée pour le prototypage interactif et la visualisation des données;<br />
* Terminal (pour un terminal unique) : cette interface donne accès à un terminal connecté à un compte à distance, ce qui se compare à se connecter à un serveur via SSH.<br />
<br />
Remarque : JupiterHub peut aussi être configuré pour afficher une interface spécifique, par exemple dans le cas d'un événement spécial.<br />
<br />
= JupyterLab =<br />
<br />
JupyterLab est présentement l'interface utilisateur générale recommandée pour une session via JupyterHub.<br />
Vos fichiers et répertoires distants peuvent être gérés directement à partir de JupyterLab et vous pouvez lancer des applications Jupyter comme un terminal, des notebooks (Python 3), RStudio et un bureau Linux.<br />
<br />
== Interface JupyterLab ==<br />
<br />
Quand JupyterLab est prête à être utilisée, l'interface comprend plusieurs panneaux. <br />
[[File:JupyterLab_HomeTab.png|thumb|Onglet par défaut quand JupyterLab est chargé]]<br />
<br />
=== Barre de menus (dans le haut) ===<br />
<br />
* Menu <i>File</i><br />
** <i>Hub Control Panel</i> : pour arrêter manuellement le serveur JupyterLab et la tâche correspondante sur la grappe. Ceci est utile quand vous voulez démarrer un nouveau serveur JupyterLab avec plus ou moins de ressources;<br />
** <i>Log Out</i> : la session JupyterHub se termine, ce qui arrête aussi le serveur JupyterLab et la tâche correspondante sur la grappe.<br />
* La plupart des autres options du menu sont pour les notebooks et les applications Jupyter.<br />
<br />
=== Outil de sélection (sur la gauche) ===<br />
<br />
* <i>File Browser</i> (icône dossier) :<br />
** Pour consulter le contenu de vos espaces /home, /project et /scratch; <br />
** Il est possible d'y téléverser des fichiers;<br />
* <i>Running Terminals and Kernels</i> (icône arrêt) :<br />
** Pour arrêter les sessions de noyaux et de terminal; <br />
* <i>Commands</i><br />
* <i>Property Inspector</i><br />
* <i>Open Tabs</i>:<br />
** Pour se déplacer parmi les onglets des applications;<br />
** Pour fermer les onglets des applications; les noyaux correspondants demeurent actifs;<br />
[[File:JupyterLab_Softwares.png|thumb|Modules chargés et modules disponibles]]<br />
* <i>Software</i> (icône diamant bleu) :<br />
** Nos modules peuvent être chargés et déchargés dans la session JupyterLab. Selon les modules chargés, différentes icônes [[JupyterHub/fr#Applications_préconstruites|d'application Jupyter]] seront affichées sous l'onglet <i>Launcher</i>.<br />
** Le champ de recherche peut être utilisé pour trouver un [[Available software/fr|module disponible]] et afficher le résultat dans le sous-panneau <i>Available Modules</i>. Prenez note que certains modules restent cachés jusqu'à ce que leurs dépendances soient chargées; nous vous recommandons de chercher un module particulier avec la commande <code>module spider nom module</code> à partir d'un terminal.<br />
** Le sous-panneau <i>Loaded Modules</i> affiche la liste des modules chargés dans toute la session JupyterLab. Prenez note que si les modules <code>python</code> et <code>ipython-kernel</code> sont chargés par défaut, d'autres modules doivent être chargés avant que certaines applications ou notebooks soient lancés, par exemple <code>scipy-stack</code>.<br />
** Le dernier sous-panneau <i>Available Modules</i> affiche la liste des modules disponibles, ce qui est semblable au résultat de la commande <code>module avail</code>. Cliquez sur le nom d'un module pour faire afficher les détails du module. Cliquez sur le lien <i>Load</i> pour charger le module et l'ajouter à la liste des modules chargés.<br />
<br />
=== Zone des applications (sur la droite) ===<br />
<br />
* L'onglet <i>Launcher</i> s'ouvre par défaut.<br />
** Il montre tous les [[Jupyter/fr#Applications_préconstruites|notebooks et applications Jupyter]] disponibles, en fonction des modules qui sont chargés.<br />
<br />
=== Barre d'état (dans le bas)===<br />
<br />
* Cliquez sur les icônes pour aller à l'outil <i>Running Terminals and Kernels</i>.<br />
<br />
== Applications préconstruites ==<br />
<br />
JupyterLab offre l'accès à un terminal, un IDE (bureau), une console Python et plusieurs options pour créer des fichiers texte brut et formatés (<i>markdown</i>). Nous ne présentons ici que les principales applications qui sont compatibles avec notre pile logicielle.<br />
<br />
=== Interpréteurs de ligne de commande ===<br />
<br />
[[File:JupyterLab_Launcher_Julia.png|thumb|Bouton pour lancer la console Julia]]<br />
[[File:JupyterLab_Launcher_Python.png|thumb|Bouton pour lancer la console Python]]<br />
[[File:JupyterLab_Launcher_Terminal.png|thumb|Bouton pour lancer le terminal]]<br />
<br />
==== Console Julia ====<br />
<br />
Pour permettre le lancement de la console Julia 1.x, il faut d'abord charger un module <code>ijulia-kernel</code>. Quand la console est lancée, l'interpréteur Julia est présenté dans un nouvel onglet JupyterLab.<br />
<br />
==== Console Python ====<br />
<br />
L'accès à Python 3.x est disponible par défaut dans une nouvelle session JupyterLab. Quand la console est lancée, un interpréteur Python 3 est affiché dans un nouvel onglet JupyterLab.<br />
<br />
==== Terminal ====<br />
<br />
Ceci ouvre un terminal sous un nouvel onglet JupyterLab&nbsp;:<br />
* Le terminal ouvre un interpréteur (Bash) sur le nœud de calcul distant, sans avoir besoin d'une connexion SSH.<br />
** Donne accès aux systèmes de fichiers distants (<code>/home</code>, <code>/project</code>, <code>/scratch</code>)<br />
** Permet d'exécuter des tâches de calcul<br />
* Le terminal permet de copier-coller du texte&nbsp;:<br />
** Pour copier, sélectionnez le texte et appuyez sur Ctrl+C<br />
*** Note : habituellement, Ctrl+C est utilisé pour envoyer un signal SIGINT à un processus en cours d'exécution ou pour annuler la commande courante. Pour effectuer ceci dans un terminal JupyterLab, cliquez sur le terminal pour désélectionner du texte avant d'appuyer sur Ctrl+C<br />
** Pour coller, appuyez sur Ctrl+V<br />
<br />
=== Noyaux (<i>kernels</i>) de notebooks disponibles ===<br />
<br />
==== Notebook Julia ====<br />
<br />
Pour permettre le lancement de notebooks Julia 1.x, il faut charger un module <code>ijulia-kernel</code>. Une fois lancé, le notebook Julia est présenté dans un nouvel onglet JupyterLab.<br />
<br />
==== Notebook Python ====<br />
<br />
[[File:JupyterLab_Softwares_ScipyStack.png|thumb|Recherche de modules scipy-stack]]<br />
Avant d'ouvrir un notebook qui nécessite un des paquets scientifiques suivants, vous devez charger le module <code>scipy-stack</code> à partir de l'outil <i>Softwares</i> de JupyterLab&nbsp;:<br />
* <code>ipython</code>, <code>ipython_genutils</code>, <code>ipykernel</code>, <code>ipyparallel</code><br />
* <code>matplotlib</code><br />
* <code>numpy</code><br />
* <code>pandas</code><br />
* <code>scipy</code><br />
* Autres paquets à souligner&nbsp;: <code>Cycler</code>, <code>futures</code>, <code>jupyter_client</code>, <code>jupyter_core</code>, <code>mpmath</code>, <code>pathlib2</code>, <code>pexpect</code>, <code>pickleshare</code>, <code>ptyprocess</code>, <code>pyzmq</code>, <code>simplegeneric</code>, <code>sympy</code>, <code>tornado</code>, <code>traitlets</code><br />
* et plusieurs autres; cliquez sur le module <code>scipy-stack</code> pour faire afficher toutes les extensions.<br />
<br />
Remarque : vous pouvez aussi installer les paquets dont vous avez besoin avec par exemple la commande <code>!pip install --no-index numpy</code> à l'intérieur d'une cellule.<br />
* Pour certains paquets (par exemple <code>plotly</code>), vous devrez peut-être redémarrer le noyau (<i>kernel</i>) du notebook avant d'importer le paquet.<br />
* L'installation de paquets dans l'environnement par défaut du noyau Python est temporaire, soit pour la durée de la session JupyterLab; vous devrez réinstaller ces paquets à la prochaine session JupyterLab. Pour créer un environnement Python persistant, vous devez configurer un <b>[[Advanced_Jupyter_configuration/fr#Noyau_Python|noyau Python personnalisé]]</b>.<br />
<br />
Pour ouvrir un notebook Python existant&nbsp;:<br />
* Retournez à <i>File Browser</i>.<br />
* Localisez le fichier <code>*.ipynb</code>.<br />
* Double-cliquez sur le fichier <code>*.ipynb</code>.<br />
** Le notebook Python s'ouvre dans un nouvel onglet JupyterLab.<br />
** Un nouveau noyau IPython démarrera en arrière-plan pour le notebook.<br />
<br />
Pour ouvrir un notebook Python dans le répertoire courant du <i>File Browser</i>&nbsp;:<br />
* Cliquez sur le bouton ''Python 3.x'' sous la section <i>Notebook</i>;<br />
** ceci ouvre un nouveau notebook Python 3 dans un nouvel onglet JupyterLab;<br />
** un nouveau noyau IPython démarrera en arrière-plan pour le notebook.<br />
<br />
=== Autres applications ===<br />
<br />
==== OpenRefine ====<br />
<br />
[[File:JupyterLab_Launcher_OpenRefine.png|thumb|Bouton pour lancer OpenRefine]]<br />
Pour permettre le lancement de OpenRefine, un module <code>openrefine</code> doit être chargé. Dépendant de l'environnement logiciel, chargez la plus récente version de OpenRefine :<br />
* pour <code>StdEnv/2020</code>, chargez <code>openrefine/3.4.1</code>;<br />
* pour <code>StdEnv/2018.3</code>, chargez <code>openrefine/3.3</code>.<br />
<br />
Une interface OpenRefine sera affichée ou réaffichée dans un nouvel onglet de votre navigateur&nbsp;: <br />
* il est possible de rouvrir une session OpenRefine active après que l'onglet a été fermé; <br />
* la session OpenRefine se termine en même temps que la session JupyterLab.<br />
<br />
==== RStudio ====<br />
<br />
[[File:JupyterLab_Launcher_RStudio.png|thumb|Bouton pour lancer RStudio]]<br />
Pour permettre le lancement de l'application RStudio dans <code>StdEnv/2020</code>, chargez le module <code>rstudio-server</code>.<br />
<br />
Avec les environnements moins récents, chargez les modules suivants :<br />
* pour <code>StdEnv/2018.3</code>, chargez <code>gcc/7.3.0</code> et <code>rstudio-server/1.2.1335</code>;<br />
* pour <code>StdEnv/2016.4</code>, chargez <code>gcc/7.3.0</code> et <code>rstudio-server/1.2.1335</code>.<br />
<br />
Une interface RStudio sera affichée ou réaffichée dans un nouvel onglet de votre navigateur Web&nbsp;: <br />
* il est possible de rouvrir une session RStudio active après que l'onglet web a été fermé; <br />
* la session RStudio se termine en même temps que la session JupyterLab.<br />
<br />
==== VS Code ====<br />
<br />
[[File:JupyterLab_Launcher_VSCode.png|thumb|Bouton pour lancer VS Code]]<br />
Avant de lancer VS Code (Visual Studio Code), un module <code>code-server</code> doit être chargé. Dépendant de l'environnement logiciel, chargez la plus récente version de VS Code&nbsp;:<br />
* avec <code>StdEnv/2020</code>, chargez <code>code-server/3.5.0</code>;<br />
* avec <code>StdEnv/2018.3</code>, chargez <code>code-server/3.4.1</code>.<br />
<br />
Une interface VS Code sera affichée ou réaffichée dans un nouvel onglet de votre navigateur&nbsp;:<br />
* une nouvelle session VS Code peut prendre jusqu'à 3 minutes avant d'être fonctionnelle;<br />
* il est possible de rouvrir une session VS Code active après que l'onglet a été fermé;<br />
* la session VS Code se termine en même temps que la session JupyterLab.<br />
<br />
==== Bureau ====<br />
<br />
[[File:JupyterLab_Launcher_Desktop.png|thumb|Bouton pour lancer Desktop]]<br />
Une interface Linux sera affichée ou réaffichée dans un nouvel onglet web de votre navigateur :<br />
* ceci est équivalent à démarrer un [[VNC/fr#Nœuds_de_calcul|serveur VNC sur un nœud de calcul]], créer ensuite un [[SSH_tunnelling/fr|tunnel SSH]] et utiliser un [[VNC/fr#Configuration|client VNC]], mais tout ceci n'est pas nécessaire avec JupyterLab.<br />
* il est possible de rouvrir une session <i>Desktop</i> active après que l'onglet a été fermé;<br />
* la session <i>Desktop</i> se termine en même temps que la session JupyterLab.<br />
<br />
= Messages d'erreur =<br />
<br />
Les erreurs avec JupyterHub sont généralement causées par l'ordonnanceur de tâches sous-jacent qui ne répond pas ou qui est incapable de trouver les ressources appropriées pour votre session, par exemple<br />
* un message d'erreur pour dépassement d'un délai (<i>timeout</i>) au début d'une session JupyterLab :<br />
** comme c'est le cas pour toutes les tâches interactives sur une grappe, le fait de demander plus de temps d'exécution peut entraîner une attente plus longue dans la liste d'attente; <br />
** il est possible qu'aucun nœud interactif ne soit disponible à ce moment; essayez plus tard.<br />
<br />
= Références =</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:JupyterHub/8/fr&diff=144838Translations:JupyterHub/8/fr2023-10-03T15:53:15Z<p>Plstonge: </p>
<hr />
<div>Utilisez votre nom d'utilisateur et votre mot de passe de de votre compte avec l'Alliance pour vous connecter aux grappes suivantes&nbsp;:[[#clusters_note|<sup>‡</sup>]].<br />
{| class="wikitable"<br />
|-<br />
! JupyterHub !! Commentaires<br />
|-<br />
| <b>[https://jupyterhub.beluga.alliancecan.ca/ Béluga]</b> || Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web.<br />
|-<br />
| <b>[https://jupyterhub.cedar.computecanada.ca/ Cedar]</b> || Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web. L'authentification se fait via <b>idpmfa.mit.c3.ca</b>.<br />
|-<br />
| <b>[https://jupyterhub.narval.alliancecan.ca/ Narval]</b> || Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web.<br />
|-<br />
| <b>[https://jupyter.scinet.utoronto.ca/ Niagara]</b> || Possède un nœud JupyterHub qui peut exécuter des sessions Jupyter Notebook. Pour plus d'information, voyez [https://docs.scinet.utoronto.ca/index.php/Jupyter_Hub la page wiki de SciNet sur JupyterHub]<br />
|-<br />
| <b>[https://jupyterhub.sharcnet.ca/ Graham]</b>|| Donne accès aux serveurs JupyterLab générés par des tâches interactives qui sont lancées à même l’interface web.<br />
|}</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=JupyterHub&diff=144834JupyterHub2023-10-03T15:52:21Z<p>Plstonge: Alliancecan link for Béluga and Narval</p>
<hr />
<div><languages /><br />
<translate><br />
<!--T:2--><br />
<i>JupyterHub is the best way to serve Jupyter Notebook for multiple users. It can be used in a class of students, a corporate data science group or scientific research group.</i><br />
<ref>http://jupyterhub.readthedocs.io/en/latest/index.html</ref><br />
<br />
<!--T:3--><br />
JupyterHub provides a preconfigured version of JupyterLab and/or Jupyter Notebook; for more configuration options, please check the [[Jupyter]] page.<br />
<br />
= Alliance initiatives = <!--T:4--><br />
<br />
<!--T:5--><br />
Some regional initiatives offer access to computing resources through JupyterHub.<br />
<br />
== JupyterHub on clusters == <!--T:11--><br />
<br />
<!--T:8--><br />
On the following clusters[[#clusters_note|<sup>‡</sup>]], use your Alliance username and password to connect to JupyterHub:<br />
{| class="wikitable"<br />
|-<br />
! JupyterHub !! Comments<br />
|-<br />
| <b>[https://jupyterhub.beluga.alliancecan.ca/ Béluga]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Béluga/en|Béluga]] cluster. <br />
|-<br />
| <b>[https://jupyterhub.cedar.computecanada.ca/ Cedar]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Cedar]] cluster. <br />
|-<br />
| <b>[https://jupyterhub.narval.alliancecan.ca/ Narval]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Narval/en|Narval]] cluster.<br />
|-<br />
| <b>[https://jupyter.scinet.utoronto.ca/ Niagara]</b> || This is a node which has been designated as a Jupyter Hub and it can run Jupyter Notebook sessions. To learn more, see the [https://docs.scinet.utoronto.ca/index.php/Jupyter_Hub SciNet JupyterHub wiki page].<br />
|-<br />
| <b>[https://jupyterhub.sharcnet.ca/ Graham]</b> || Provides access to JupyterLab servers spawned through jobs on the [[Graham]] cluster.<br />
|}<br />
<br />
<!--T:18--><br />
<b><sup id="clusters_note">‡</sup> Note that the compute nodes running the Jupyter kernels do not have internet access</b>. This means that you can only transfer files from/to your own computer; you cannot download code or data from the internet (e.g. cannot do "git clone", cannot do "pip install" if the wheel is absent from our [[Available Python wheels|wheelhouse]]). You may also have problems if your code performs downloads or uploads (e.g. in machine learning where downloading data from the code is often done).<br />
<br />
== JupyterHub for universities and schools == <!--T:12--><br />
<br />
<!--T:6--><br />
* The [https://www.pims.math.ca Pacific Institute for the Mathematical Sciences] in collaboration with the Alliance and [http://www.cybera.ca Cybera] offer cloud-based hubs to universities and schools. Each institution can have its own hub where users authenticate with their credentials from that institution. The hubs are hosted on Alliance [[Cloud|clouds]] and are essentially for training purposes. Institutions interested in obtaining their own hub can visit [http://syzygy.ca http://syzygy.ca].<br />
<br />
= Server options = <!--T:13--><br />
<br />
<!--T:14--><br />
[[File:JupyterHub_Server_Options.png|thumb|<i>Server Options</i> form on Béluga's JupyterHub]]<br />
Once logged in, depending on the configuration of JupyterHub, the user's web browser is redirected to either<br />
<b>a)</b> a previously launched Jupyter server,<br />
<b>b)</b> a new Jupyter server with default options, or<br />
<b>c)</b> a form that allows a user to set different options for their Jupyter server before pressing the <i>Start</i> button.<br />
In all cases, it is equivalent to accessing requested resources via an [[Running_jobs#Interactive_jobs|interactive job]] on the corresponding cluster.<br />
<br />
<!--T:64--><br />
<b>Important:</b> On each cluster, only one interactive job at a time gets a priority increase in order to start in a few seconds or minutes. That includes <code>salloc</code>, <code>srun</code> and JupyterHub jobs. If you already have another interactive job running on the cluster hosting JupyterHub, your new Jupyter session may never start before the time limit of 5 minutes.<br />
<br />
== Compute resources == <!--T:15--><br />
<br />
<!--T:16--><br />
For example, <i>Server Options</i> available on [https://jupyterhub.beluga.computecanada.ca/ Béluga's JupyterHub] are:<br />
* <i>Account</i> to be used: any <code>def-*</code>, <code>rrg-*</code>, <code>rpp-*</code> or <code>ctb-*</code> account a user has access to<br />
* <i>Time (hours)</i> required for the session<br />
* <i>Number of (CPU) cores</i> that will be reserved on a single node<br />
* <i>Memory (MB)</i> limit for the entire session<br />
* (Optional) <i>GPU configuration</i>: at least one GPU<br />
* <i>[[JupyterHub#User_Interface|User interface]]</i> (see below)<br />
<br />
== User interface == <!--T:9--><br />
<br />
<!--T:17--><br />
While JupyterHub allows each user to use one Jupyter server at a time on each hub, there can be multiple options under <i>User interface</i>:<br />
* Jupyter Notebook (classic interface): Even though it offers many functionalities, the community is moving towards [[JupyterHub#JupyterLab|JupyterLab]], which is a better platform that offers many more features.<br />
* <b>[[JupyterHub#JupyterLab|JupyterLab]]</b> (modern interface): This is the most recommended Jupyter user interface for interactive prototyping and data visualization.<br />
* Terminal (for a single terminal only): It gives access to a terminal connected to a remote account, which is comparable to connecting to a server through an SSH connection.<br />
<br />
<!--T:10--><br />
Note: JupyterHub could also have been configured to force a specific user interface. This is usually done for special events.<br />
<br />
= JupyterLab = <!--T:19--><br />
<br />
<!--T:20--><br />
JupyterLab is now the recommended general-purpose user interface to use on a JupyterHub.<br />
From a JupyterLab server, you can manage your remote files and folders,<br />
and you can launch Jupyter applications like a terminal, (Python 3) notebooks, RStudio and a Linux desktop.<br />
<br />
== The JupyterLab interface == <!--T:21--><br />
<br />
<!--T:22--><br />
When JupyterLab is ready to be used, the interface has multiple panels.<br />
[[File:JupyterLab_HomeTab.png|thumb|Default home tab when JupyterLab is loaded]]<br />
<br />
=== Menu bar on top === <!--T:23--><br />
<br />
<!--T:24--><br />
* In the <i>File</i> menu:<br />
** <i>Hub Control Panel</i>: if you want to manually stop the JupyterLab server and the corresponding job on the cluster. This is useful when you want to start a new JupyterLab server with more or less resources.<br />
** <i>Log Out</i>: the JupyterHub session will end, which will also stop the JupyterLab server and the corresponding job on the cluster.<br />
* Most other menu items are related to notebooks and Jupyter applications.<br />
<br />
=== Tool selector on left === <!--T:25--><br />
<br />
<!--T:26--><br />
* <i>File Browser</i> (folder icon):<br />
** This is where you can browse in your home, project and scratch spaces.<br />
** It is also possible to upload files.<br />
* <i>Running Terminals and Kernels</i> (stop icon):<br />
** To stop kernel sessions and terminal sessions<br />
* <i>Commands</i><br />
* <i>Property Inspector</i><br />
* <i>Open Tabs</i>:<br />
** To navigate between application tabs.<br />
** To close application tabs (the corresponding kernels remain active).<br />
[[File:JupyterLab_Softwares.png|thumb|Loaded modules and available modules]]<br />
* <b><i>Software</i></b> (blue diamond sign):<br />
** Alliance modules can be loaded and unloaded in the JupyterLab session. Depending on the modules loaded, icons directing to the corresponding [[#Prebuilt_applications|Jupyter applications]] will appear in the <i>Launcher</i> tab.<br />
** The search box can search for any [[Available software|available module]] and show the result in the <i>Available Modules</i> subpanel. Note: Some modules are hidden until their dependency is loaded: we recommend that you first look for a specific module with <code>module spider module_name</code> from a terminal.<br />
** The next subpanel is the list of <i>Loaded Modules</i> in the whole JupyterLab session. Note: While <code>python</code> and <code>ipython-kernel</code> modules are loaded by default, additional modules must be loaded before launching some other applications or notebooks. For example: <code>scipy-stack</code>.<br />
** The last subpanel is the list of <i>Available modules</i>, similar to the output of <code>module avail</code>. By clicking on a module's name, detailed information about the module is displayed. By clicking on the <i>Load</i> link, the module will be loaded and added to the <i>Loaded Modules</i> list.<br />
<br />
=== Applications area on right === <!--T:27--><br />
<br />
<!--T:28--><br />
* The <i>Launcher</i> tab is open by default.<br />
** It contains all available [[#Prebuilt_applications|Jupyter applications and notebooks]], depending on which modules are loaded<br />
<br />
=== Status bar at the bottom === <!--T:29--><br />
<br />
<!--T:30--><br />
* By clicking on the icons, this brings you to the <i>Running Terminals and Kernels</i> tool.<br />
<br />
== Prebuilt applications == <!--T:31--><br />
<br />
<!--T:32--><br />
JupyterLab offers access to a terminal, an IDE (Desktop), a Python console and different options to create text and markdown files. This section presents only the main supported Jupyter applications that work with our software stack.<br />
<br />
=== Command line interpreters === <!--T:33--><br />
<br />
<!--T:34--><br />
[[File:JupyterLab_Launcher_Julia.png|thumb|Julia console launcher button]]<br />
[[File:JupyterLab_Launcher_Python.png|thumb|Python console launcher button]]<br />
[[File:JupyterLab_Launcher_Terminal.png|thumb|Terminal launcher button]]<br />
<br />
==== Julia console ==== <!--T:35--><br />
<br />
<!--T:36--><br />
To enable the <i>Julia 1.x</i> console launcher, an <code>ijulia-kernel</code> module needs to be loaded. When launched, a Julia interpreter is presented in a new JupyterLab tab.<br />
<br />
==== Python console ==== <!--T:37--><br />
<br />
<!--T:38--><br />
The <i>Python 3.x</i> console launcher is available by default in a new JupyterLab session. When launched, a Python 3 interpreter is presented in a new JupyterLab tab.<br />
<br />
==== Terminal ==== <!--T:39--><br />
<br />
<!--T:40--><br />
This application launcher will open a terminal in a new JupyterLab tab:<br />
* The terminal runs a (Bash) shell on the remote compute node without the need of an SSH connection.<br />
** Gives access to the remote filesystems (<code>/home</code>, <code>/project</code>, <code>/scratch</code>).<br />
** Allows running compute tasks.<br />
* The terminal allows copy-and-paste operations of text:<br />
** Copy operation: select the text, then press Ctrl+C.<br />
*** Note: Usually, Ctrl+C is used to send a SIGINT signal to a running process, or to cancel the current command. To get this behaviour in JupyterLab's terminal, click on the terminal to deselect any text before pressing Ctrl+C.<br />
** Paste operation: press Ctrl+V.<br />
<br />
=== Available notebook kernels === <!--T:41--><br />
<br />
==== Julia notebook ==== <!--T:42--><br />
<br />
<!--T:43--><br />
To enable the <i>Julia 1.x</i> notebook launcher, an <code>ijulia-kernel</code> module needs to be loaded. When launched, a Julia notebook is presented in a new JupyterLab tab.<br />
<br />
==== Python notebook ==== <!--T:44--><br />
<br />
<!--T:45--><br />
[[File:JupyterLab_Softwares_ScipyStack.png|thumb|Searching for scipy-stack modules]]<br />
If any of the following scientific Python packages is required by your notebook, before you open this notebook, you must load the <code>scipy-stack</code> module from the JupyterLab <i>Softwares</i> tool:<br />
* <code>ipython</code>, <code>ipython_genutils</code>, <code>ipykernel</code>, <code>ipyparallel</code><br />
* <code>matplotlib</code><br />
* <code>numpy</code><br />
* <code>pandas</code><br />
* <code>scipy</code><br />
* Other notable packages are <code>Cycler</code>, <code>futures</code>, <code>jupyter_client</code>, <code>jupyter_core</code>, <code>mpmath</code>, <code>pathlib2</code>, <code>pexpect</code>, <code>pickleshare</code>, <code>ptyprocess</code>, <code>pyzmq</code>, <code>simplegeneric</code>, <code>sympy</code>, <code>tornado</code>, <code>traitlets</code>.<br />
* And many more (click on the <code>scipy-stack</code> module to see all <i>Included extensions</i>).<br />
<br />
<!--T:46--><br />
Note: You may also install needed packages by running for example the following command inside a cell: <code>!pip install --no-index numpy</code>.<br />
* For some packages (like <code>plotly</code>, for example), you may need to restart the notebook's kernel before importing the package.<br />
* The installation of packages in the default Python kernel environment is temporary to the lifetime of the JupyterLab session; you will have to reinstall these packages the next time you start a new JupyterLab session. For a persistent Python environment, you must configure a <b>[[Advanced_Jupyter_configuration#Python_kernel|custom Python kernel]]</b>.<br />
<br />
<!--T:47--><br />
To open an existing Python notebook:<br />
* Go back to the <i>File Browser</i>.<br />
* Browse to the location of the <code>*.ipynb</code> file.<br />
* Double-click on the <code>*.ipynb</code> file.<br />
** This will open the Python notebook in a new JupyterLab tab.<br />
** An IPython kernel will start running in the background for this notebook.<br />
<br />
<!--T:48--><br />
To open a new Python notebook in the current <i>File Browser</i> directory:<br />
* Click on the <i>Python 3.x</i> launcher under the <i>Notebook</i> section.<br />
** This will open a new Python 3 notebook in a new JupyterLab tab.<br />
** A new IPython kernel will start running in the background for this notebook.<br />
<br />
=== Other applications === <!--T:49--><br />
<br />
==== OpenRefine ==== <!--T:50--><br />
<br />
<!--T:51--><br />
[[File:JupyterLab_Launcher_OpenRefine.png|thumb|OpenRefine launcher button]]<br />
To enable the <i>OpenRefine</i> application launcher, an <code>openrefine</code> module needs to be loaded. Depending on the software environment version, the latest version of OpenRefine should be loaded:<br />
* with <code>StdEnv/2020</code>, load module: <code>openrefine/3.4.1</code><br />
* with <code>StdEnv/2018.3</code>, load module: <code>openrefine/3.3</code><br />
<br />
<!--T:52--><br />
This <i>OpenRefine</i> launcher will open or reopen an OpenRefine interface in a new web browser tab.<br />
* It is possible to reopen an active OpenRefine session after the web browser tab was closed.<br />
* The OpenRefine session will end when the JupyterLab session will end.<br />
<br />
==== RStudio ==== <!--T:53--><br />
<br />
<!--T:54--><br />
[[File:JupyterLab_Launcher_RStudio.png|thumb|RStudio launcher button]]<br />
To enable the <i>RStudio</i> application launcher in <code>StdEnv/2020</code>, load the module: <code>rstudio-server</code><br />
<br />
<!--T:55--><br />
With older software environment, you should load the following two modules (<code>r</code> is loaded automatically):<br />
* with <code>StdEnv/2018.3</code>, load modules: <code>gcc/7.3.0</code>, <code>rstudio-server/1.2.1335</code><br />
* with <code>StdEnv/2016.4</code>, load modules: <code>gcc/7.3.0</code>, <code>rstudio-server/1.2.1335</code><br />
<br />
<!--T:56--><br />
This <i>RStudio</i> launcher will open or reopen an RStudio interface in a new web browser tab.<br />
* It is possible to reopen an active RStudio session after the web browser tab was closed.<br />
* The RStudio session will end when the JupyterLab session will end.<br />
<br />
==== VS Code ==== <!--T:57--><br />
<br />
<!--T:58--><br />
[[File:JupyterLab_Launcher_VSCode.png|thumb|VS Code launcher button]]<br />
To enable the <i>VS Code</i> (Visual Studio Code) application launcher, a <code>code-server</code> module needs to be loaded. Depending on the software environment version, the latest version of VS Code should be loaded:<br />
* with <code>StdEnv/2020</code>, load module: <code>code-server/3.5.0</code><br />
* with <code>StdEnv/2018.3</code>, load module: <code>code-server/3.4.1</code><br />
<br />
<!--T:59--><br />
This <i>VS Code</i> launcher will open or reopen the VS Code interface in a new web browser tab.<br />
* For a new session, the <i>VS Code</i> session can take up to 3 minutes to complete its startup.<br />
* It is possible to reopen an active VS Code session after the web browser tab was closed.<br />
* The VS Code session will end when the JupyterLab session will end.<br />
<br />
==== Desktop ==== <!--T:60--><br />
<br />
<!--T:61--><br />
[[File:JupyterLab_Launcher_Desktop.png|thumb|Desktop launcher button]]<br />
This <i>Desktop</i> launcher will open or reopen a remote Linux desktop interface in a new web browser tab:<br />
* This is equivalent to running a [[VNC#Compute_Nodes|VNC server on a compute node]], then creating an [[SSH_tunnelling|SSH tunnel]] and finally using a [[VNC#Setup|VNC client]], but you need nothing of all this with JupyterLab!<br />
* It is possible to reopen an active desktop session after the web browser tab was closed.<br />
* The desktop session will end when the JupyterLab session will end.<br />
<br />
= Possible error messages = <!--T:62--><br />
<br />
<!--T:63--><br />
Most JupyterHub errors are caused by the underlying job scheduler which is either unresponsive or not able to find appropriate resources for your session. For example:<br />
* A "time-out" error message when starting a JupyterLab session:<br />
** Just like any interactive job on any cluster, a longer requested time can cause a longer wait time in queue.<br />
** There may be no available interactive node at the moment; try again later.<br />
<br />
= References = <!--T:7--><br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=144830Multifactor authentication2023-10-03T14:30:37Z<p>Plstonge: Marked this version for translation</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approving a notification on a smart device through the Duo Mobile application.<br />
*Entering a code generated on demand.<br />
*Pushing a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be progressively deployed, that is, it will not be immediately available for all our services.<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== To use a smartphone or tablet == <!--T:3--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or on [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Note that TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are not compatible with Duo.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], connect to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device.<br />
#In the Duo Mobile application, click the "+" sign to add a new account, and scan the QR code that is shown to you.<br />
<br />
== To use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey 5 is your best option. <br />
<br />
<!--T:40--><br />
'''Note that only the Yubikey 5 Series are compatible. '''<br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Among the many protocols supported by YubiKeys, the one which works with SSH connections to our clusters is the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates and transmits a string of 32 characters to complete your authentication.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1s to 2.5), while slot 2 is a long touch on the key (pressing for 3s to 5s). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce the frequency with which you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can install OpenSSH using the instructions on [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui this page]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specifics to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or more recent.<br />
<br />
<!--T:43--><br />
When connecting to a remote server, MobaXterm establishes by default two connections:<br />
the first one for the terminal and the second one for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
</translate><br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<translate><br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or more recent. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an Android phone which is older than Android 9. I do not find the Duo Mobile application. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website. See [https://help.duo.com/s/article/2211?language=en_US this page] for more details. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering what options to implement for automation, but we do not have a general solution implemented yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=144829Multifactor authentication2023-10-03T14:30:13Z<p>Plstonge: No need to translate the MobaXterm image</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approving a notification on a smart device through the Duo Mobile application.<br />
*Entering a code generated on demand.<br />
*Pushing a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be progressively deployed, that is, it will not be immediately available for all our services.<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== To use a smartphone or tablet == <!--T:3--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or on [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Note that TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are not compatible with Duo.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], connect to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device.<br />
#In the Duo Mobile application, click the "+" sign to add a new account, and scan the QR code that is shown to you.<br />
<br />
== To use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey 5 is your best option. <br />
<br />
<!--T:40--><br />
'''Note that only the Yubikey 5 Series are compatible. '''<br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Among the many protocols supported by YubiKeys, the one which works with SSH connections to our clusters is the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates and transmits a string of 32 characters to complete your authentication.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1s to 2.5), while slot 2 is a long touch on the key (pressing for 3s to 5s). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce the frequency with which you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can install OpenSSH using the instructions on [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui this page]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specifics to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or more recent.<br />
<br />
When connecting to a remote server, MobaXterm establishes by default two connections:<br />
the first one for the terminal and the second one for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
</translate><br />
[[File:MobaXterm SSH-browser type.png|400px|MobaXterm - SSH-browser type]]<br />
<translate><br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or more recent. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an Android phone which is older than Android 9. I do not find the Duo Mobile application. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website. See [https://help.duo.com/s/article/2211?language=en_US this page] for more details. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering what options to implement for automation, but we do not have a general solution implemented yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Multifactor_authentication&diff=144828Multifactor authentication2023-10-03T14:27:50Z<p>Plstonge: MobaXterm SCP option</p>
<hr />
<div><languages /><br />
<br />
<translate><br />
<br />
<!--T:1--><br />
Multifactor authentication (MFA) allows you to protect your account with more than a password. Once your account is configured to use this feature, you will need to enter your username and password as usual, and then perform a second action (the <i>second factor</i>) to access most of our services. <br><br />
<br />
<!--T:21--><br />
You can choose any of these factors for this second authentication step:<br />
*Approving a notification on a smart device through the Duo Mobile application.<br />
*Entering a code generated on demand.<br />
*Pushing a button on a hardware key (YubiKey).<br />
<br />
<!--T:22--><br />
This feature will be progressively deployed, that is, it will not be immediately available for all our services.<br />
<br />
= Registering factors = <!--T:2--><br />
== Registering multiple factors ==<br />
When you enable multifactor authentication for your account, we <b>strongly recommend</b> that you configure at least two options for your second factor. For example, you can use a phone and single-use codes; a phone and a hardware key; or two hardware keys. This will ensure that if you lose one factor, you can still use your other one to access your account.<br />
<br />
== To use a smartphone or tablet == <!--T:3--><br />
#Install the Duo Mobile authentication application from the [https://itunes.apple.com/us/app/duo-mobile/id422663827 Apple Store] or on [https://play.google.com/store/apps/details?id=com.duosecurity.duomobile Google Play]. Note that TOTP applications such as Aegis, Google Authenticator, and Microsoft Authenticator are not compatible with Duo.<br />
#Go to the [https://ccdb.alliancecan.ca CCDB], connect to your account and select <i>My account → [https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management]</i>.<br />
#Under <i>Register a device</i>, click on <i>Duo Mobile</i>.<br />
#Enter a name for your device.<br />
#In the Duo Mobile application, click the "+" sign to add a new account, and scan the QR code that is shown to you.<br />
<br />
== To use a YubiKey 5 == <!--T:4--><br />
A YubiKey is a hardware token made by the [https://www.yubico.com/ Yubico] company. If you do not have a smartphone or tablet, do not wish to use your phone or tablet for multifactor authentication, or are often in a situation when using your phone or tablet is not possible, then a YubiKey 5 is your best option. <br />
<br />
<!--T:40--><br />
'''Note that only the Yubikey 5 Series are compatible. '''<br />
<br />
<!--T:23--><br />
A YubiKey 5 is the size of a small USB stick and costs between $50 and $100. Different models can fit in USB-A, USB-C, or Lightning ports, and some also support near-field communication (NFC) for use with a phone or tablet.<br />
<br />
<!--T:5--><br />
Among the many protocols supported by YubiKeys, the one which works with SSH connections to our clusters is the Yubico One-Time Password (OTP). After you have registered a YubiKey for multifactor authentication, when you log on to one of our clusters you will be prompted for a one-time password (OTP). You respond by touching a button on your YubiKey, which generates and transmits a string of 32 characters to complete your authentication.<br />
<br />
<!--T:6--><br />
To register your YubiKey you will need its Public ID, Private ID, and Secret Key. If you have this information, go to the [https://ccdb.computecanada.ca/multi_factor_authentications Multifactor authentication management page]. If you do not have this information, configure your key using the steps below.<br />
<br />
=== Configuring your YubiKey for Yubico OTP === <!--T:7--><br />
<br />
<!--T:8--><br />
# Download and install the YubiKey Manager software from the [https://www.yubico.com/support/download/yubikey-manager/ Yubico website].<br />
# Insert your YubiKey and launch the YubiKey Manager software.<br />
# In the YubiKey Manager software, select <i>Applications</i>, then <i>OTP</i>. (Images below illustrate this and the next few steps.)<br />
# Select <i>Configure</i> for either slot 1 or slot 2. Slot 1 corresponds to a short touch (pressing for 1s to 2.5), while slot 2 is a long touch on the key (pressing for 3s to 5s). Slot 1 is typically pre-registered for Yubico cloud mode. If you are already using this slot for other services, either use slot 2, or click on <i>Swap</i> to transfer the configuration to slot 2 before configuring slot 1. <br />
# Select <i>Yubico OTP</i>.<br />
# Select <i>Use serial</i>, then generate a private ID and a secret key. <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields before you click on <i>Finish</i>, as you will need the data for the next step.</b><br />
# <b>IMPORTANT: Make sure you clicked on "Finish" in the previous step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<gallery widths=300px heights=300px><br />
File:Yubico Manager OTP.png|Step 3<br />
File:Yubico Manager OTP configuration.png|Step 4<br />
File:Select Yubico OTP.png|Step 5<br />
File:Generate Yubikey IDs.png|Step 6, Step 7<br />
CCDB Yubikeys.png|Step 8<br />
</gallery><br />
<br />
= Using your second factor = <!--T:9--><br />
== When connecting via SSH == <br />
If your account has multifactor authentication enabled, when you connect via SSH to a cluster which supports MFA, you will be prompted to use your second factor after you first use either your password or your [[SSH Keys|SSH key]]. This prompt will look like this:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:10--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:11--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:12--><br />
Passcode or option (1-1):}}<br />
At this point, you can select which phone or tablet you want Duo to send a notification to. If you have multiple devices enrolled, you will be shown a list. You will then get a notification on your device, which you accept to complete the authentication.<br />
<br />
<!--T:13--><br />
If you are using a YubiKey, a backup code, or if you prefer to enter the time-based one-time password that the Duo Mobile application shows, you would write these instead of selecting an option. For example:<br />
{{Command|ssh cluster.computecanada.ca<br />
|result= Duo two-factor login for name<br />
<br />
<!--T:14--><br />
Enter a passcode or select one of the following options:<br />
<br />
<!--T:15--><br />
1. Duo Push to My phone (iOS)<br />
<br />
<!--T:16--><br />
Passcode or option (1-1):vvcccbhbllnuuebegkkbcfdftndjijlneejilrgiguki<br />
Success. Logging you in...}}<br />
<br />
=== Configuring your SSH client to only ask every so often === <!--T:17--><br />
If you use OpenSSH to connect, you can reduce the frequency with which you are asked for a second factor. To do so, edit your <code>.ssh/config</code> to add the lines:<br />
<br />
<!--T:24--><br />
<pre><br />
Host HOSTNAME<br />
ControlPath ~/.ssh/cm-%r@%h:%p<br />
ControlMaster auto<br />
ControlPersist 10m<br />
</pre><br />
where you would replace <code>HOSTNAME</code> with the host name of the server for which you want this configuration.<br />
<br />
<!--T:41--><br />
If you are using Windows, you can install OpenSSH using the instructions on [https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui this page]. Note that you only need the client portion of these instructions.<br />
<br />
== When authenticating to our account portal == <!--T:18--><br />
Once multifactor authentication is enabled on your account, you will be required to use it when connecting to our account portal. After entering your username and password, you will see a prompt similar to this, where you click on the option you want to use. <br><br />
(Note: <i>This screen will be updated</i>.)<br />
<gallery widths=300px heights=300px><br />
File:CCDB MFA prompt.png<br />
</gallery><br />
<br />
= Configuring common SSH clients = <!--T:32--><br />
Command line clients will typically support multifactor authentication without additional configuration. This is however often not the case for graphical clients. Below are instructions specifics to a few of them. <br />
<br />
== FileZilla == <!--T:33--><br />
FileZilla will ask the password and second factor each time a transfer is initiated because by default, transfers use independent connections which are closed automatically after some idle time.<br />
<br />
<!--T:34--><br />
To avoid entering the password and second factor multiple times, you can limit the number of connections to each site to “1” in “Site Manager” => “Transfer Settings tab”; note that you’ll then lose the ability to browse the server during transfers.<br />
<br />
<!--T:35--><br />
# Launch FileZilla and select “Site Manager”<br />
# From the “Site Manager”, create a new site (or edit an existing one)<br />
# On the “General” tab, specify the following:<br />
#* Protocol: “SFTP – SSH File Transfer Protocol”<br />
#* Host: [the cluster login hostname]<br />
#* Logon Type: “Interactive”<br />
#* User: [your username]<br />
# On the “Transfer Settings” tab, specify the following:<br />
#* Limit number of simultaneous connections: [checked]<br />
#* Maximum number of connections: 1<br />
# Select “OK” to save the connection<br />
# Test the connection<br />
<br />
== MobaXTerm == <!--T:36--><br />
Install version 23.1 or more recent.<br />
<br />
When connecting to a remote server, MobaXterm establishes by default two connections:<br />
the first one for the terminal and the second one for the remote file browser.<br />
By default, the file browser uses the <i>SFTP protocol</i>,<br />
which causes a mandatory second prompt for your second factor of authentication.<br />
To avoid that extra step, you can set the <i>SSH-browser type</i> to either<br />
<i>SCP (enhanced speed)</i> or <i>SCP (normal speed)</i> in the<br />
<i>Advanced SSH settings</i> tab of the <i>SSH</i> session editor:<br />
<br />
[[File:MobaXterm SSH-browser type.png|400px|SSH > asdf]]<br />
<br />
== PuTTY == <!--T:37--><br />
Install version 0.72 or more recent. <br />
<br />
== WinSCP == <!--T:38--><br />
Ensure that you are using [[SSH Keys]]. <br />
<br />
== PyCharm == <!--T:39--><br />
Ensure that you are using [[SSH Keys]].<br />
<br />
= Frequently asked questions = <!--T:19--><br />
== I have an Android phone which is older than Android 9. I do not find the Duo Mobile application. Can I still use Duo ? ==<br />
Yes. However, you have to download the application from the Duo website. See [https://help.duo.com/s/article/2211?language=en_US this page] for more details. <br />
<br />
== I do not have a smartphone or tablet, or they are too old. Can I still use multifactor authentication? == <!--T:25--><br />
Yes. In this case, you need [[#To use a YubiKey|to use a YubiKey]].<br />
<br />
== I have lost my second factor device. What can I do? == <!--T:20--><br />
* If you have backup codes, or if you have more than one device, use that other mechanism to connect to your account on our [https://ccdb.alliancecan.ca/multi_factor_authentications account portal], and then delete your lost device from the list. Then, register a new device. <br />
* If you do not have backup codes or have lost all of your devices, copy the following list providing answers to as many questions as you can. Email this information to support@tech.alliancecan.ca. <br />
<br />
<!--T:30--><br />
What is the primary email address registered in your account?<br />
For how long have you had an active account with us?<br />
What is your research area?<br />
What is your IP address? (to see your IP address, point your browser to this [https://whatismyipaddress.com/ link]).<br />
Who is the principal investigator sponsoring your account?<br />
Who are your group members?<br />
Who can we contact to validate your request?<br />
Which clusters do you use the most?<br />
Which modules do you load most often?<br />
When did you run your last job?<br />
Provide a few of your latest job IDs.<br />
Provide ticket topics and ticket IDs from your recent requests for technical support.<br />
<br />
== Which SSH clients can be used when multifactor authentication is configured? == <!--T:29--><br />
* Most clients that use a command-line interface, such as on Linux and Mac OS.<br />
* MobaXTerm (see instructions above)<br />
* PuTTY (see instructions above)<br />
* Termius on iOS<br />
* FileZilla (see instructions above)<br />
* JuiceSSH on Android<br />
* WinSCP (see instructions above)<br />
* PyCharm (see instructions above)<br />
* VSCode<br />
<br />
== I need to have automated connections to the clusters through my account. Can I use multifactor authentication ? == <!--T:31--><br />
Not at this moment. We are considering what options to implement for automation, but we do not have a general solution implemented yet. Please do not enroll into MFA at this time if you have this need - and please contact [[Technical support]] to explain your requirements.<br />
<br />
= Advanced usage = <!--T:27--><br />
== Configuring your YubiKey for Yubico OTP using the Command Line (<code>ykman</code>)==<br />
# Install the command line YubiKey Manager software (<code>ykman</code>) following instructions for your OS from Yubico's [https://docs.yubico.com/software/yubikey/tools/ykman/Install_ykman.html#download-ykman ykman guide].<br />
# Insert your YubiKey and read key information with the command <code>ykman info</code>.<br />
# Read OTP information with the command <code>ykman otp info</code>.<br />
# Select the slot you wish to program and use the command <code>ykman otp yubiotp</code> to program it.<br />
# <b>Securely save a copy of the data in the Public ID, Private ID, and Secret Key fields. You will need the data for the next step.</b><br />
# Log into the CCDB to register your YubiKey in the <i>[https://ccdb.alliancecan.ca/multi_factor_authentications Multifactor authentication management page]</i>.<br />
<br />
<!--T:28--><br />
:<source lang="console"><br />
[name@yourLaptop]$ ykman otp yubiotp -uGgP vvcccctffclk 2<br />
Using a randomly generated private ID: bc3dd98eaa12<br />
Using a randomly generated secret key: ae012f11bc5a00d3cac00f1d57aa0b12<br />
Upload credential to YubiCloud? [y/N]: y<br />
Upload to YubiCloud initiated successfully.<br />
Program an OTP credential in slot 2? [y/N]: y<br />
Opening upload form in browser: https://upload.yubico.com/proceed/4567ad02-c3a2-1234-a1c3-abe3f4d21c69<br />
</source><br />
<br />
</translate></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=File:MobaXterm_SSH-browser_type.png&diff=144827File:MobaXterm SSH-browser type.png2023-10-03T13:48:21Z<p>Plstonge: </p>
<hr />
<div></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Allocations_and_compute_scheduling/fr&diff=144808Allocations and compute scheduling/fr2023-10-02T18:07:34Z<p>Plstonge: </p>
<hr />
<div><languages /><br />
<br />
<br />
<i>Page enfant de [[Job scheduling policies/fr|Politique d'ordonnancement des tâches]]</i><br />
<br />
=Allocations pour le calcul haute performance=<br />
<br />
<b>Une <i>allocation</i> est l’attribution d’une quantité de ressources à un groupe de recherche pour une période donnée, habituellement un an.</b> Il s'agit soit d'un maximum comme dans le cas du stockage, soit d'une moyenne d'utilisation sur une période donnée comme c'est le cas pour les ressources partagées que sont les cœurs de calcul.<br />
<br />
L’allocation des ressources de stockage attribue un maximum déterminé d’espace réservé à l’usage exclusif d’un groupe de recherche. Pour sa part, l’allocation des ressources partagées que sont les cœurs-année et les GPU-année est plus complexe puisque ces ressources sont partagées par l’ensemble des groupes et que l’allocation tient compte de l’utilisation moyenne de chaque groupe.<br />
<br />
La durée de l’allocation est une valeur de référence utilisée pour calculer la moyenne de la consommation des ressources au cours de la période pendant laquelle celles-ci sont disponibles. Par exemple, si les grappes ne sont pas disponibles pour une semaine dû à des opérations de maintenance, les groupes de recherche touchés n’obtiennent pas une semaine additionnelle en compensation à la fin de la période. De la même manière, si la période d’allocation est allongée, les groupes n’y perdent pas en utilisation.<br />
<br />
Notons qu’une allocation de cœurs-année et de GPU-année en ressources partagées considère la moyenne d’utilisation cible dans le temps; un groupe est donc plus susceptible d’atteindre et même de dépasser ses cibles en utilisant ses ressources de façon régulière sur la période qu’en soumettant des tâches en rafale (''burst'') ou en les reportant à plus tard.<br />
<br />
==De l'allocation à l'ordonnancement par priorité==<br />
<br />
Les ressources de calcul par cœurs-année et par GPU-année reçoivent des tâches qui sont immédiatement prises en charge par l’ordonnanceur. Rappelons qu’une tâche se compose d’une application logicielle et de la liste des ressources pour l’exécuter. L’ordonnanceur est aussi une application logicielle dont le rôle est de calculer la priorité de chaque tâche et de lui attribuer les ressources nécessaires selon leur disponibilité et en accord avec les règles de priorisation.<br />
<br />
À l’aide d’algorithmes spécialisés, l’ordonnanceur tient compte des cibles de chaque groupe et compare la consommation récente du groupe à l’utilisation qui lui était allouée. Un des facteurs déterminants est la consommation à l’intérieur de la période. Le facteur qui possède cependant le plus de poids est la consommation (ou la non-consommation) récente, ceci en vue d’offrir une opération plus stable aux groupes dont l’utilisation réelle se rapproche des ressources qui leur étaient allouées. Cette façon de procéder assure une meilleure répartition du parc de ressources pour l’ensemble des groupes et fait en sorte qu’il est théoriquement possible pour tous les groupes d’atteindre leurs cibles.<br />
<br />
==Conséquences d'une surutilisation d'une allocation CPU ou GPU==<br />
<br />
Si vous avez des tâches en attente et qu’à ce moment la demande en ressources de calcul est basse, l’ordonnanceur pourrait faire exécuter vos tâches même si vous dépassez la quantité cible de votre allocation. Tout ce qui peut se produire alors serait que les prochaines tâches que vous soumettrez se voient attribuer un plus bas niveau de priorité que celles soumises par des groupes qui n’ont pas encore atteint leur niveau cible d’utilisation. Aucune tâche soumise à l’ordonnanceur n’est refusée en raison d’une surutilisation de ressources et votre utilisation moyenne de ressources sur la période d’allocation devrait se situer proche de la cible qui vous a été allouée.<br />
<br />
Il se pourrait qu’au cours d’un mois ou d’une année vous puissiez accomplir plus de travail que votre allocation ne semblerait le permettre, mais ce scénario est peu probable puisque la demande est plus élevée que la quantité de ressources dont nous disposons.<br />
<br />
=Unités GPU de référence (UGR)=<br />
{{Note|Cette nouvelle unité sera utilisée à partir du concours pour l'allocation de ressources de 2024.}}<br />
<br />
Comme vous le savez peut-être, la performance des GPU a considérablement augmenté ces dernières années et devrait continuer sa progression avec la prochaine génération. Par le passé et jusqu'au concours de 2023, nous traitions tous les GPU comme étant équivalents les uns aux autres, tant au moment de l'allocation que dans le calcul du nombre de ressources consommées par le groupe. Ceci diminuait la complexité de nos outils de gestion des ressources, mais créait des problèmes d'équité, à la fois dans le processus d'attribution et lors de l'exécution des tâches. Nous ne pouvons donc plus continuer à traiter tous les types de GPU de la même manière.<br />
<br />
Afin de résoudre le problème d'équité, nous avons créé l'<i>unité GPU de référence</i> (ou <i>UGR</i>) qui nous permet de classer les différents modèles de GPU en production sur la base de leur performance nominale. Parce qu'environ la moitié des tâches utilisent principalement des opérations à virgule flottante simple précision ([https://en.wikipedia.org/wiki/Single-precision_floating-point_format FP32]) et que les autres utilisent des opérations à virgule flottante demi-précision ([https://en.wikipedia.org/wiki/Half-precision_floating-point_format FP16]), et que la plupart des utilisateurs se soucient de la mémoire sur du GPU lui-même, nous avons établi les critères d'évaluation suivants avec leur poids correspondant :<br />
<br />
{| class="wikitable" style="margin: auto;"<br />
|-<br />
! scope="col"| Critères d'évaluation<br />
! scope="col"| Poids <br> (UGR)<br />
|-<br />
! scope="row"| Score FP32<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score FP16<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score mémoire GPU<br />
| 20% * 4 = 0.8<br />
|}<br />
<br />
Pour plus de commodité, les pondérations sont basées sur des pourcentages augmentés d'un facteur de 4 UGR. Ensuite, en utilisant le <b>A100-40gb</b> comme modèle de référence, nous obtenons les scores suivants pour chaque modèle&nbsp;:<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
|<br />
! scope="col"| Score FP32<br />
! scope="col"| Score FP16<br />
! scope="col"| Score mémoire<br />
! scope="col"| Score pondéré<br />
|-<br />
! scope="col"| Poids:<br />
! scope="col"| 1.6<br />
! scope="col"| 1.6<br />
! scope="col"| 0.8<br />
| (UGR)<br />
|-<br />
! scope="row" style="text-decoration: underline;"| Modèle<br />
|-<br />
! scope="row"| P100-12gb<br />
| 0.48<br />
| 0.00<br />
| 0.3<br />
! 1.0<br />
|-<br />
! scope="row"| P100-16gb<br />
| 0.48<br />
| 0.00<br />
| 0.4<br />
! 1.1<br />
|-<br />
! scope="row"| T4-16gb<br />
| 0.42<br />
| 0.21<br />
| 0.4<br />
! 1.3<br />
|-<br />
! scope="row"| V100-16gb*<br />
| 0.81<br />
| 0.40<br />
| 0.4<br />
! 2.2<br />
|-<br />
! scope="row"| V100-32gb*<br />
| 0.81<br />
| 0.40<br />
| 0.8<br />
! 2.6<br />
|-<br />
! scope="row"| A100-40gb<br />
| <b>1.00</b><br />
| <b>1.00</b><br />
| <b>1.0</b><br />
! 4.0<br />
|-<br />
! scope="row"| A100-80gb*<br />
| 1.00<br />
| 1.00<br />
| 2.0<br />
! 4.8<br />
|}<br />
<br />
(*) Sur Graham, ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
Par exemple, le plus ancien modèle de GPU en production est le P100-12gb qui vaut 1.0 UGR. Les prochaines générations de GPU seront comparées avec la même formule au modèle A100-40gb.<br />
<br />
==Choisir des modèles de GPU pour votre projet==<br />
<br />
Les scores relatifs du précédent tableau devraient vous aider à sélectionner les modèles les plus convenables. Les exemples suivants présentent des cas extrêmes.<br />
<br />
* Si vos applications font surtout des opérations FP32, le modèle A100-40gb devrait être deux fois plus rapide que le P100-12gb, mais l'utilisation des ressources sera considérée comme étant quatre fois plus grande. En conséquence, pour le même nombre d'UGR, le modèle P100-12gb devrait vous permettre d'exécuter deux fois plus de calculs. <br />
* Si vos applications font surtout des opérations FP16 (ce qui est le cas en intelligence artificielle et avec les opérations à précision mixte ou utilisant [https://en.wikipedia.org/wiki/Bfloat16_floating-point_format d'autres formats à virgule flottante]), l'utilisation d'un A100-40gb sera calculée comme utilisant quatre fois les ressources d'un P100-12gb, mais pourra faire ~30 fois plus de calculs dans la même période, ce qui vous permettrait d'exécuter ~7.5 fois plus de calculs.<br />
<br />
==À compter du concours de 2024==<br />
<br />
* Pour le concours d'allocation de ressources de 2024, votre demande de GPU doit indiquer le modèle de GPU que vous préférez. Le nombre d’UGR sera automatiquement calculé sur la base des GPU-années par année du projet et enregistré dans le formulaire électronique dans CCDB.<br />
** Par exemple, si vous sélectionnez la ressource <i>narval-gpu</i> et demandez 13 GPU-années du modèle A100-40gb, le nombre d’UGR sera 13&nbsp;*&nbsp;4.0&nbsp;=&nbsp;52. Le comité d’administration du concours vous allouerait un maximum de 52&nbsp;UGR, dépendant de la note attribuée à votre demande. Dans le cas où votre allocation serait déplacée sur Cedar, le comité vous allouerait jusqu’à 20&nbsp;GPU-années, puisque chaque GPU V100-32gb vaut 2.6&nbsp;UGR (et 52&nbsp;/&nbsp;2.6&nbsp;=&nbsp;20).<br />
<br />
* L’emploi des UGR entrera en vigueur le 1er avril 2024 avec le concours pour l'allocation des ressources de 2024. Cette unité servira à l’ordonnancement des tâches et au calcul de l’utilisation des ressources qui est rapportée dans CCDB.<br />
<br />
=Effet détaillé de l'utilisation des ressources sur la priorité=<br />
<br />
Le principe gouverneur dans notre façon de déterminer la priorité des tâches de calcul se base sur les ressources qu’une tâche rend <b>non disponibles aux autres utilisateurs</b> plutôt que sur les ressources effectivement utilisées.<br />
<br />
Le cas de cœurs non utilisés qui influent sur le calcul des priorités se produit souvent lorsqu’une tâche est soumise en demandant plusieurs cœurs, mais n’en consomme effectivement qu’une partie à l’exécution. C’est le nombre de cœurs demandés par une tâche qui a une incidence sur la priorisation des prochaines tâches puisque la tâche bloque les cœurs non utilisés pendant son exécution.<br />
<br />
Un autre cas fréquent de cœurs non utilisés se pose lorsqu’une tâche exige plus de mémoire que celle demandée pour un cœur. Sur une grappe où chaque cœur serait doté de 4Go de mémoire, une tâche qui demanderait un seul cœur et 8Go de mémoire bloquerait donc 2 cœurs et le deuxième cœur ne serait pas disponible pour les tâches des autres groupes de recherche<br />
<br />
==Équivalents-cœurs utilisés par l'ordonnanceur==<br />
<br />
Un équivalent-cœur se compose d’'''un cœur simple et d’une certaine quantité de mémoire'''; pour le nommer, nous utilisons le terme ''bundle''. En plus du cœur, le bundle contient aussi la mémoire considérée comme étant associée à ce cœur. <br />
<br />
[[File:EquivalentCoeur.png|frame|Figure 1 – ''Équivalent-cœur sur Cedar et Graham'']]<br />
<br />
Cedar et Graham offrent surtout des cœurs de 4Go et dans leur cas, l’équivalent-cœur est un bundle de 4 Go (voir Figure 1). Pour sa part, Niagara offre surtout des cœurs de 4.8Go, donc des bundles de 4.8Go. L’utilisation des ressources par une tâche est comptabilisée à raison de 4Go ou 4.8Go par cœur, comme mentionné ci-dessus.<br />
<br />
Le suivi des cibles s’avère relativement simple quand les ressources demandées sont des cœurs et des quantités de mémoire qui correspondent à un équivalent-cœur entier, plutôt qu’à une portion d’équivalent-cœur. Les choses se compliquent parce que l’utilisation de portions d’équivalents-cœur risque d’augmenter le pointage servant au calcul de la juste part du groupe de recherche. En pratique, la méthode appliquée résout le problème d'équité ou de perception d'équité, mais cette méthode n’est pas intuitive au début.<br />
<br />
Dans les exemples qui suivent, la mémoire est de 4Go.<br />
<br />
<b>Comptabilisation par équivalents-cœur</b><br />
<br />
Examinons le cas où nous avons un bundle composé de 1 cœur et 4Go de mémoire.<br />
<br />
* [[File:Two_core_equivalents.png|frame|Figure 2 <i>– Deux équivalents-cœurs</i>]] Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de mémoire, c’est-à-dire plus que le ratio 1cœur/4Go.<br />
*:Dans la figure 2, on demande 2 cœurs et 2Go par cœur pour une mémoire totale de 4Go; la tâche exige 2 équivalents-cœur pour les cœurs, mais un seul bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-cœurs. <br clear=all><br />
<br />
* [[File:Two_and_a_half_core_equivalents.png|frame|Figure 3 – <i>2.5 équivalents-cœur</i>]] La mémoire est comptabilisée si un groupe utilise plus de mémoire que le ratio de 1 cœur/4Go.<br />
*:Dans la figure 3, on demande 2 cœurs et 5Go par cœur pour une mémoire totale de 10Go; la tâche exige 2.5 bundles pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2.5 équivalents-cœurs. <br clear=all><br />
<br />
==Équivalents-UGR utilisés par l'ordonnanceur==<br />
<br />
L’utilisation des GPU et leurs ressources associées suit les mêmes principes que ceux décrits pour les équivalents-coeurs, sauf qu’une UGR est ajoutée au bundle avec de la mémoire et plusieurs cœurs. Ceci signifie que la comptabilisation de l’utilisation de la cible pour l’allocation de GPU doit inclure l’UGR. Tout comme le système de points utilisé dans l’expression de l’utilisation de la ressource en équivalents-cœurs, nous utilisons aussi un système de points pour les équivalents-UGR.<br />
<br />
Le calcul de priorité se fait en fonction du nombre maximum de bundles UGR-coeurs-mémoire demandés. Examinons le cas où nous avons un bundle de 1 UGR, 3 cœurs et 4Go de mémoire.<br />
[[File:EquivalentG1.png|thumb|upright=1.1|center|Figure 4 - ''1 équivalent-UGR'']] <br clear=all><br />
<br />
* Les UGR sont comptabilisés si un groupe utilise plus de UGR que de cœurs OU de mémoire par bundle. Prenons l'exemple d'un usager demandant 2 GPU (de 1 UGR chacun), 3 cœurs et 4Go de mémoire. La tâche exige donc l'équivalent de 2 bundles pour les GPU, mais un seul pour les cœurs et la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-UGR. <br />
[[File:EquivalentsG2_(GPUs).png|thumb|center|Figure 5 – ''2 équivalents-UGR'']] <br clear=all><br />
<br />
* Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de UGR OU plus de mémoire par bundle avec GPU. Dans la figure 6, on demande 1 GPU de 1 UGR, 5 cœurs et 5Go; la requête exige donc 1.66 bundles avec GPU pour les cœurs, mais un seul bundle pour le GPU et 1.25 bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue donc la demande à 1.66 équivalents-UGR.<br />
[[File:EquivalentsG1.66_(coeurs).png|thumb|center|Figure 6 – ''1.66 équivalents-GPU (cœurs)'']] <br clear=all><br />
<br />
* La mémoire est comptabilisée si un groupe utilise plus de mémoire que de UGR OU de cœurs par bundle avec GPU. Dans la figure 7, on demande 1 GPU de 1 UGR, 2 cœurs et 6Go; la requête exige donc 1.5 bundle avec GPU pour la mémoire, mais un seul bundle pour les GPU et 0.66 pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 1.5 équivalents-GPU.<br />
[[File:EquivalentsG1.5_(memoire).png|thumb|center|Figure 7 – ''1.5 équivalents-GPU (mémoire)'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU V100-32gb, 7.8 cœurs et 10.4 Go de mémoire-vive vaudrait 2.6 équivalents-UGR :<br />
[[File:EquivalentsG2.6_V100-32gb.png|thumb|upright=2.1|center|Figure 8 - ''2.6 équivalents-UGR, basés sur le GPU V100-32gb'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU A100-40gb, 12 cœurs et 16 Go de mémoire-vive vaudrait 4.0 équivalents-UGR :<br />
[[File:EquivalentsG4_A100-40gb.png|thumb|upright=2.66|center|Figure 9 - ''4.0 équivalents-UGR, basés sur le GPU A100-40gb'']] <br clear=all><br />
<br />
===Ratios dans les bundles===<br />
Les différents bundles UGR-coeur-mémoire et GPU-coeur-mémoire des systèmes de l'Alliance ont les caractéristiques suivantes :<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
! scope="col"| Grappe<br />
! scope="col"| Modèle GPU<br />
! scope="col"| UGR par GPU<br />
! scope="col"| Bundle par UGR<br />
! scope="col"| Bundle par GPU<br />
! scope="col"| Ratios physiques<br />
|-<br />
! scope="row"| [[Béluga#Caractéristiques_des_nœuds|Béluga]]<br />
| V100-16gb<br />
| 2.2<br />
| 4.5 cœurs / 21 Go<br />
| 10 cœurs / 46.5 Go<br />
| 10 cœurs / 46.5 Go<br />
|-<br />
! rowspan="3"| [[Cedar/fr#Caractéristiques_des_nœuds|Cedar]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="3"|3.1 cœurs / 25 Go<br />
| 3.1 cœurs / 25 Go<br />
| 6 cœurs / 31.2 Go<br />
|-<br />
| P100-16gb<br />
| 1.1<br />
| 3.4 cœurs / 27 Go<br />
| 6 cœurs / 62.5 Go<br />
|-<br />
| V100-32gb<br />
| 2.6<br />
| 8.0 cœurs / 65 Go<br />
| 8 cœurs / 46.5 Go<br />
|-<br />
! rowspan="5"| [[Graham/fr#Caractéristiques_des_nœuds|Graham]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="5"| 9.7 cœurs / 43 Go<br />
| 9.7 cœurs / 43 Go<br />
| 16 cœurs / 62 Go<br />
|-<br />
| T4-16gb<br />
| 1.3<br />
| 12.6 cœurs / 56 Go<br />
| {4, 11} cœurs / 46.8 Go<br />
|-<br />
| V100-16gb*<br />
| 2.2<br />
| 21.3 cœurs / 95 Go<br />
| 3.5 cœurs / 23.4 Go<br />
|-<br />
| V100-32gb*<br />
| 2.6<br />
| 25.2 cœurs / 112 Go<br />
| 5 cœurs / 47.1 Go<br />
|-<br />
| A100-80gb*<br />
| 4.8<br />
| 46.6 cœurs / 206 Go<br />
| {8, 16} c. / {62, 248} Go<br />
|-<br />
! scope="row"| [[Narval#Caractéristiques_des_nœuds|Narval]]<br />
| A100-40gb<br />
| 4.0<br />
| 3.0 cœurs / 31 Go<br />
| 12 cœurs / 124.5 Go<br />
| 12 cœurs / 124.5 Go<br />
|}<br />
<br />
(*) Ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
<b>Remarque :</b> Si l'ordonnanceur établit la priorité sur la base de l'utilisation calculée avec les bundles, une demande de plusieurs GPU sur un même nœud doit aussi tenir compte des ratios physiques.<br />
<br />
=Visionner les données d’utilisation par le groupe=<br />
<br />
[[File:Select view group usage fr edit.png|thumb|Onglet <i>Mon compte</i>, option <i>Utilisation par le groupe</i>]]<br />
Vous pouvez visionner les données d’utilisation des ressources par votre groupe en sélectionnant <i>Mon compte --> Utilisation par le groupe</i> dans la base de données CCDB. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_fr.png|thumb|Utilisation de CPU et de GPU, par ressource de calcul]]<br />
Les valeurs pour l’utilisation des CPU (cœurs-année) et des GPU-année sont calculées selon la quantité des ressources allouées aux tâches exécutées sur les grappes. Notez que les valeurs employées dans les graphiques ne représentent pas les équivalents-cœur; ainsi, l’utilisation par les tâches qui exigent beaucoup de mémoire ne correspond pas à l’utilisation du compte représentée par l’ordonnanceur de la grappe.<br />
<br />
La première barre d’onglets offre les vues suivantes&nbsp;:<br />
: <b>Par ressource de calcul</b>; nom de la grappe sur laquelle les tâches ont été soumises,<br />
: <b>Par projet (RAPI)</b>; projets auxquels les tâches ont été soumises,<br />
: <b>Par utilisateur</b>; utilisatrice ou utilisateur ayant soumis les tâches,<br />
: <b>Utilisation du stockage</b>; voyez [[Storage and file management/fr|Stockage et gestion des fichiers]].<br />
<br clear=all><br />
<br />
==Utilisation par ressource de calcul==<br />
<br />
Cette vue montre l’utilisation par ressource de calcul par grappe, pour tous les groupes desquels vous êtes propriétaire ou membre, pour l’année d’allocation en cours qui commence le 1er avril. Les données représentent l’utilisation à jour et supposent que cette utilisation restera la même jusqu’à la fin de l’année d’allocation. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_monthly_fr.png|thumb|Utilisation mensuelle par ressource]]<br />
Dans la colonne <i>Extra Info</i>, cliquez sur <i>Utilisation sur une base mensuelle</i> pour obtenir la répartition mensuelle pour la ressource correspondante. En cliquant sur <i>Utilisation par utilisateur</i>, la répartition se fait par utilisateur ou utilisatrice ayant soumis les tâches.<br />
<br clear=all><br />
<br />
==Utilisation par projet==<br />
[[File:Ccdb view use by compute resource monthly proj fr edit.png|thumb|Utilisation par projet, avec répartition mensuelle]]<br />
Pour cette vue, une troisième barre d'onglets permet de sélectionner l'identifiant de projet pour l'année d'allocation choisie. Le tableau montre les détails pour chaque projet ainsi que les ressources utilisées sur toutes les grappes. Dans le haut de la vue, on trouve le nom du compte (par exemple def-, rrg- ou rpp-*, etc.), le titre du projet et le ou la propriétaire, ainsi que les sommaires de l'allocation et de l'utilisation.<br />
<br clear=all><br />
<br />
==Utilisation des GPU en unités GPU de référence (UGR)==<br />
[[File:rgu_fr.png|thumb|Sommaire de l'utilisation des GPU et le détail en unités GPU de référence (UGR) par modèle.]]<br />
Pour chaque projet (RAPI) ayant une utilisation de GPU, le détail d'utilisation par modèle de GPU est donné en GPU-années et en UGR-années dans une table située au bas de la page.<br />
<br clear=all><br />
<br />
==Utilisation par utilisateur==<br />
[[File:Ccdb view use by submitter summary fr edit.png|thumb|Utilisation de CPU et GPU]]<br />
Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur une base mensuelle</i>.<br />
<br clear=all><br />
<br />
[[Category:SLURM]]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Allocations_and_compute_scheduling/41/fr&diff=144807Translations:Allocations and compute scheduling/41/fr2023-10-02T18:07:27Z<p>Plstonge: </p>
<hr />
<div>==Utilisation des GPU en unités GPU de référence (UGR)==<br />
[[File:rgu_fr.png|thumb|Sommaire de l'utilisation des GPU et le détail en unités GPU de référence (UGR) par modèle.]]<br />
Pour chaque projet (RAPI) ayant une utilisation de GPU, le détail d'utilisation par modèle de GPU est donné en GPU-années et en UGR-années dans une table située au bas de la page.<br />
<br clear=all></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Allocations_and_compute_scheduling/fr&diff=144806Allocations and compute scheduling/fr2023-10-02T18:06:02Z<p>Plstonge: </p>
<hr />
<div><languages /><br />
<br />
<br />
<i>Page enfant de [[Job scheduling policies/fr|Politique d'ordonnancement des tâches]]</i><br />
<br />
=Allocations pour le calcul haute performance=<br />
<br />
<b>Une <i>allocation</i> est l’attribution d’une quantité de ressources à un groupe de recherche pour une période donnée, habituellement un an.</b> Il s'agit soit d'un maximum comme dans le cas du stockage, soit d'une moyenne d'utilisation sur une période donnée comme c'est le cas pour les ressources partagées que sont les cœurs de calcul.<br />
<br />
L’allocation des ressources de stockage attribue un maximum déterminé d’espace réservé à l’usage exclusif d’un groupe de recherche. Pour sa part, l’allocation des ressources partagées que sont les cœurs-année et les GPU-année est plus complexe puisque ces ressources sont partagées par l’ensemble des groupes et que l’allocation tient compte de l’utilisation moyenne de chaque groupe.<br />
<br />
La durée de l’allocation est une valeur de référence utilisée pour calculer la moyenne de la consommation des ressources au cours de la période pendant laquelle celles-ci sont disponibles. Par exemple, si les grappes ne sont pas disponibles pour une semaine dû à des opérations de maintenance, les groupes de recherche touchés n’obtiennent pas une semaine additionnelle en compensation à la fin de la période. De la même manière, si la période d’allocation est allongée, les groupes n’y perdent pas en utilisation.<br />
<br />
Notons qu’une allocation de cœurs-année et de GPU-année en ressources partagées considère la moyenne d’utilisation cible dans le temps; un groupe est donc plus susceptible d’atteindre et même de dépasser ses cibles en utilisant ses ressources de façon régulière sur la période qu’en soumettant des tâches en rafale (''burst'') ou en les reportant à plus tard.<br />
<br />
==De l'allocation à l'ordonnancement par priorité==<br />
<br />
Les ressources de calcul par cœurs-année et par GPU-année reçoivent des tâches qui sont immédiatement prises en charge par l’ordonnanceur. Rappelons qu’une tâche se compose d’une application logicielle et de la liste des ressources pour l’exécuter. L’ordonnanceur est aussi une application logicielle dont le rôle est de calculer la priorité de chaque tâche et de lui attribuer les ressources nécessaires selon leur disponibilité et en accord avec les règles de priorisation.<br />
<br />
À l’aide d’algorithmes spécialisés, l’ordonnanceur tient compte des cibles de chaque groupe et compare la consommation récente du groupe à l’utilisation qui lui était allouée. Un des facteurs déterminants est la consommation à l’intérieur de la période. Le facteur qui possède cependant le plus de poids est la consommation (ou la non-consommation) récente, ceci en vue d’offrir une opération plus stable aux groupes dont l’utilisation réelle se rapproche des ressources qui leur étaient allouées. Cette façon de procéder assure une meilleure répartition du parc de ressources pour l’ensemble des groupes et fait en sorte qu’il est théoriquement possible pour tous les groupes d’atteindre leurs cibles.<br />
<br />
==Conséquences d'une surutilisation d'une allocation CPU ou GPU==<br />
<br />
Si vous avez des tâches en attente et qu’à ce moment la demande en ressources de calcul est basse, l’ordonnanceur pourrait faire exécuter vos tâches même si vous dépassez la quantité cible de votre allocation. Tout ce qui peut se produire alors serait que les prochaines tâches que vous soumettrez se voient attribuer un plus bas niveau de priorité que celles soumises par des groupes qui n’ont pas encore atteint leur niveau cible d’utilisation. Aucune tâche soumise à l’ordonnanceur n’est refusée en raison d’une surutilisation de ressources et votre utilisation moyenne de ressources sur la période d’allocation devrait se situer proche de la cible qui vous a été allouée.<br />
<br />
Il se pourrait qu’au cours d’un mois ou d’une année vous puissiez accomplir plus de travail que votre allocation ne semblerait le permettre, mais ce scénario est peu probable puisque la demande est plus élevée que la quantité de ressources dont nous disposons.<br />
<br />
=Unités GPU de référence (UGR)=<br />
{{Note|Cette nouvelle unité sera utilisée à partir du concours pour l'allocation de ressources de 2024.}}<br />
<br />
Comme vous le savez peut-être, la performance des GPU a considérablement augmenté ces dernières années et devrait continuer sa progression avec la prochaine génération. Par le passé et jusqu'au concours de 2023, nous traitions tous les GPU comme étant équivalents les uns aux autres, tant au moment de l'allocation que dans le calcul du nombre de ressources consommées par le groupe. Ceci diminuait la complexité de nos outils de gestion des ressources, mais créait des problèmes d'équité, à la fois dans le processus d'attribution et lors de l'exécution des tâches. Nous ne pouvons donc plus continuer à traiter tous les types de GPU de la même manière.<br />
<br />
Afin de résoudre le problème d'équité, nous avons créé l'<i>unité GPU de référence</i> (ou <i>UGR</i>) qui nous permet de classer les différents modèles de GPU en production sur la base de leur performance nominale. Parce qu'environ la moitié des tâches utilisent principalement des opérations à virgule flottante simple précision ([https://en.wikipedia.org/wiki/Single-precision_floating-point_format FP32]) et que les autres utilisent des opérations à virgule flottante demi-précision ([https://en.wikipedia.org/wiki/Half-precision_floating-point_format FP16]), et que la plupart des utilisateurs se soucient de la mémoire sur du GPU lui-même, nous avons établi les critères d'évaluation suivants avec leur poids correspondant :<br />
<br />
{| class="wikitable" style="margin: auto;"<br />
|-<br />
! scope="col"| Critères d'évaluation<br />
! scope="col"| Poids <br> (UGR)<br />
|-<br />
! scope="row"| Score FP32<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score FP16<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score mémoire GPU<br />
| 20% * 4 = 0.8<br />
|}<br />
<br />
Pour plus de commodité, les pondérations sont basées sur des pourcentages augmentés d'un facteur de 4 UGR. Ensuite, en utilisant le <b>A100-40gb</b> comme modèle de référence, nous obtenons les scores suivants pour chaque modèle&nbsp;:<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
|<br />
! scope="col"| Score FP32<br />
! scope="col"| Score FP16<br />
! scope="col"| Score mémoire<br />
! scope="col"| Score pondéré<br />
|-<br />
! scope="col"| Poids:<br />
! scope="col"| 1.6<br />
! scope="col"| 1.6<br />
! scope="col"| 0.8<br />
| (UGR)<br />
|-<br />
! scope="row" style="text-decoration: underline;"| Modèle<br />
|-<br />
! scope="row"| P100-12gb<br />
| 0.48<br />
| 0.00<br />
| 0.3<br />
! 1.0<br />
|-<br />
! scope="row"| P100-16gb<br />
| 0.48<br />
| 0.00<br />
| 0.4<br />
! 1.1<br />
|-<br />
! scope="row"| T4-16gb<br />
| 0.42<br />
| 0.21<br />
| 0.4<br />
! 1.3<br />
|-<br />
! scope="row"| V100-16gb*<br />
| 0.81<br />
| 0.40<br />
| 0.4<br />
! 2.2<br />
|-<br />
! scope="row"| V100-32gb*<br />
| 0.81<br />
| 0.40<br />
| 0.8<br />
! 2.6<br />
|-<br />
! scope="row"| A100-40gb<br />
| <b>1.00</b><br />
| <b>1.00</b><br />
| <b>1.0</b><br />
! 4.0<br />
|-<br />
! scope="row"| A100-80gb*<br />
| 1.00<br />
| 1.00<br />
| 2.0<br />
! 4.8<br />
|}<br />
<br />
(*) Sur Graham, ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
Par exemple, le plus ancien modèle de GPU en production est le P100-12gb qui vaut 1.0 UGR. Les prochaines générations de GPU seront comparées avec la même formule au modèle A100-40gb.<br />
<br />
==Choisir des modèles de GPU pour votre projet==<br />
<br />
Les scores relatifs du précédent tableau devraient vous aider à sélectionner les modèles les plus convenables. Les exemples suivants présentent des cas extrêmes.<br />
<br />
* Si vos applications font surtout des opérations FP32, le modèle A100-40gb devrait être deux fois plus rapide que le P100-12gb, mais l'utilisation des ressources sera considérée comme étant quatre fois plus grande. En conséquence, pour le même nombre d'UGR, le modèle P100-12gb devrait vous permettre d'exécuter deux fois plus de calculs. <br />
* Si vos applications font surtout des opérations FP16 (ce qui est le cas en intelligence artificielle et avec les opérations à précision mixte ou utilisant [https://en.wikipedia.org/wiki/Bfloat16_floating-point_format d'autres formats à virgule flottante]), l'utilisation d'un A100-40gb sera calculée comme utilisant quatre fois les ressources d'un P100-12gb, mais pourra faire ~30 fois plus de calculs dans la même période, ce qui vous permettrait d'exécuter ~7.5 fois plus de calculs.<br />
<br />
==À compter du concours de 2024==<br />
<br />
* Pour le concours d'allocation de ressources de 2024, votre demande de GPU doit indiquer le modèle de GPU que vous préférez. Le nombre d’UGR sera automatiquement calculé sur la base des GPU-années par année du projet et enregistré dans le formulaire électronique dans CCDB.<br />
** Par exemple, si vous sélectionnez la ressource <i>narval-gpu</i> et demandez 13 GPU-années du modèle A100-40gb, le nombre d’UGR sera 13&nbsp;*&nbsp;4.0&nbsp;=&nbsp;52. Le comité d’administration du concours vous allouerait un maximum de 52&nbsp;UGR, dépendant de la note attribuée à votre demande. Dans le cas où votre allocation serait déplacée sur Cedar, le comité vous allouerait jusqu’à 20&nbsp;GPU-années, puisque chaque GPU V100-32gb vaut 2.6&nbsp;UGR (et 52&nbsp;/&nbsp;2.6&nbsp;=&nbsp;20).<br />
<br />
* L’emploi des UGR entrera en vigueur le 1er avril 2024 avec le concours pour l'allocation des ressources de 2024. Cette unité servira à l’ordonnancement des tâches et au calcul de l’utilisation des ressources qui est rapportée dans CCDB.<br />
<br />
=Effet détaillé de l'utilisation des ressources sur la priorité=<br />
<br />
Le principe gouverneur dans notre façon de déterminer la priorité des tâches de calcul se base sur les ressources qu’une tâche rend <b>non disponibles aux autres utilisateurs</b> plutôt que sur les ressources effectivement utilisées.<br />
<br />
Le cas de cœurs non utilisés qui influent sur le calcul des priorités se produit souvent lorsqu’une tâche est soumise en demandant plusieurs cœurs, mais n’en consomme effectivement qu’une partie à l’exécution. C’est le nombre de cœurs demandés par une tâche qui a une incidence sur la priorisation des prochaines tâches puisque la tâche bloque les cœurs non utilisés pendant son exécution.<br />
<br />
Un autre cas fréquent de cœurs non utilisés se pose lorsqu’une tâche exige plus de mémoire que celle demandée pour un cœur. Sur une grappe où chaque cœur serait doté de 4Go de mémoire, une tâche qui demanderait un seul cœur et 8Go de mémoire bloquerait donc 2 cœurs et le deuxième cœur ne serait pas disponible pour les tâches des autres groupes de recherche<br />
<br />
==Équivalents-cœurs utilisés par l'ordonnanceur==<br />
<br />
Un équivalent-cœur se compose d’'''un cœur simple et d’une certaine quantité de mémoire'''; pour le nommer, nous utilisons le terme ''bundle''. En plus du cœur, le bundle contient aussi la mémoire considérée comme étant associée à ce cœur. <br />
<br />
[[File:EquivalentCoeur.png|frame|Figure 1 – ''Équivalent-cœur sur Cedar et Graham'']]<br />
<br />
Cedar et Graham offrent surtout des cœurs de 4Go et dans leur cas, l’équivalent-cœur est un bundle de 4 Go (voir Figure 1). Pour sa part, Niagara offre surtout des cœurs de 4.8Go, donc des bundles de 4.8Go. L’utilisation des ressources par une tâche est comptabilisée à raison de 4Go ou 4.8Go par cœur, comme mentionné ci-dessus.<br />
<br />
Le suivi des cibles s’avère relativement simple quand les ressources demandées sont des cœurs et des quantités de mémoire qui correspondent à un équivalent-cœur entier, plutôt qu’à une portion d’équivalent-cœur. Les choses se compliquent parce que l’utilisation de portions d’équivalents-cœur risque d’augmenter le pointage servant au calcul de la juste part du groupe de recherche. En pratique, la méthode appliquée résout le problème d'équité ou de perception d'équité, mais cette méthode n’est pas intuitive au début.<br />
<br />
Dans les exemples qui suivent, la mémoire est de 4Go.<br />
<br />
<b>Comptabilisation par équivalents-cœur</b><br />
<br />
Examinons le cas où nous avons un bundle composé de 1 cœur et 4Go de mémoire.<br />
<br />
* [[File:Two_core_equivalents.png|frame|Figure 2 <i>– Deux équivalents-cœurs</i>]] Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de mémoire, c’est-à-dire plus que le ratio 1cœur/4Go.<br />
*:Dans la figure 2, on demande 2 cœurs et 2Go par cœur pour une mémoire totale de 4Go; la tâche exige 2 équivalents-cœur pour les cœurs, mais un seul bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-cœurs. <br clear=all><br />
<br />
* [[File:Two_and_a_half_core_equivalents.png|frame|Figure 3 – <i>2.5 équivalents-cœur</i>]] La mémoire est comptabilisée si un groupe utilise plus de mémoire que le ratio de 1 cœur/4Go.<br />
*:Dans la figure 3, on demande 2 cœurs et 5Go par cœur pour une mémoire totale de 10Go; la tâche exige 2.5 bundles pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2.5 équivalents-cœurs. <br clear=all><br />
<br />
==Équivalents-UGR utilisés par l'ordonnanceur==<br />
<br />
L’utilisation des GPU et leurs ressources associées suit les mêmes principes que ceux décrits pour les équivalents-coeurs, sauf qu’une UGR est ajoutée au bundle avec de la mémoire et plusieurs cœurs. Ceci signifie que la comptabilisation de l’utilisation de la cible pour l’allocation de GPU doit inclure l’UGR. Tout comme le système de points utilisé dans l’expression de l’utilisation de la ressource en équivalents-cœurs, nous utilisons aussi un système de points pour les équivalents-UGR.<br />
<br />
Le calcul de priorité se fait en fonction du nombre maximum de bundles UGR-coeurs-mémoire demandés. Examinons le cas où nous avons un bundle de 1 UGR, 3 cœurs et 4Go de mémoire.<br />
[[File:EquivalentG1.png|thumb|upright=1.1|center|Figure 4 - ''1 équivalent-UGR'']] <br clear=all><br />
<br />
* Les UGR sont comptabilisés si un groupe utilise plus de UGR que de cœurs OU de mémoire par bundle. Prenons l'exemple d'un usager demandant 2 GPU (de 1 UGR chacun), 3 cœurs et 4Go de mémoire. La tâche exige donc l'équivalent de 2 bundles pour les GPU, mais un seul pour les cœurs et la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-UGR. <br />
[[File:EquivalentsG2_(GPUs).png|thumb|center|Figure 5 – ''2 équivalents-UGR'']] <br clear=all><br />
<br />
* Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de UGR OU plus de mémoire par bundle avec GPU. Dans la figure 6, on demande 1 GPU de 1 UGR, 5 cœurs et 5Go; la requête exige donc 1.66 bundles avec GPU pour les cœurs, mais un seul bundle pour le GPU et 1.25 bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue donc la demande à 1.66 équivalents-UGR.<br />
[[File:EquivalentsG1.66_(coeurs).png|thumb|center|Figure 6 – ''1.66 équivalents-GPU (cœurs)'']] <br clear=all><br />
<br />
* La mémoire est comptabilisée si un groupe utilise plus de mémoire que de UGR OU de cœurs par bundle avec GPU. Dans la figure 7, on demande 1 GPU de 1 UGR, 2 cœurs et 6Go; la requête exige donc 1.5 bundle avec GPU pour la mémoire, mais un seul bundle pour les GPU et 0.66 pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 1.5 équivalents-GPU.<br />
[[File:EquivalentsG1.5_(memoire).png|thumb|center|Figure 7 – ''1.5 équivalents-GPU (mémoire)'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU V100-32gb, 7.8 cœurs et 10.4 Go de mémoire-vive vaudrait 2.6 équivalents-UGR :<br />
[[File:EquivalentsG2.6_V100-32gb.png|thumb|upright=2.1|center|Figure 8 - ''2.6 équivalents-UGR, basés sur le GPU V100-32gb'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU A100-40gb, 12 cœurs et 16 Go de mémoire-vive vaudrait 4.0 équivalents-UGR :<br />
[[File:EquivalentsG4_A100-40gb.png|thumb|upright=2.66|center|Figure 9 - ''4.0 équivalents-UGR, basés sur le GPU A100-40gb'']] <br clear=all><br />
<br />
===Ratios dans les bundles===<br />
Les différents bundles UGR-coeur-mémoire et GPU-coeur-mémoire des systèmes de l'Alliance ont les caractéristiques suivantes :<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
! scope="col"| Grappe<br />
! scope="col"| Modèle GPU<br />
! scope="col"| UGR par GPU<br />
! scope="col"| Bundle par UGR<br />
! scope="col"| Bundle par GPU<br />
! scope="col"| Ratios physiques<br />
|-<br />
! scope="row"| [[Béluga#Caractéristiques_des_nœuds|Béluga]]<br />
| V100-16gb<br />
| 2.2<br />
| 4.5 cœurs / 21 Go<br />
| 10 cœurs / 46.5 Go<br />
| 10 cœurs / 46.5 Go<br />
|-<br />
! rowspan="3"| [[Cedar/fr#Caractéristiques_des_nœuds|Cedar]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="3"|3.1 cœurs / 25 Go<br />
| 3.1 cœurs / 25 Go<br />
| 6 cœurs / 31.2 Go<br />
|-<br />
| P100-16gb<br />
| 1.1<br />
| 3.4 cœurs / 27 Go<br />
| 6 cœurs / 62.5 Go<br />
|-<br />
| V100-32gb<br />
| 2.6<br />
| 8.0 cœurs / 65 Go<br />
| 8 cœurs / 46.5 Go<br />
|-<br />
! rowspan="5"| [[Graham/fr#Caractéristiques_des_nœuds|Graham]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="5"| 9.7 cœurs / 43 Go<br />
| 9.7 cœurs / 43 Go<br />
| 16 cœurs / 62 Go<br />
|-<br />
| T4-16gb<br />
| 1.3<br />
| 12.6 cœurs / 56 Go<br />
| {4, 11} cœurs / 46.8 Go<br />
|-<br />
| V100-16gb*<br />
| 2.2<br />
| 21.3 cœurs / 95 Go<br />
| 3.5 cœurs / 23.4 Go<br />
|-<br />
| V100-32gb*<br />
| 2.6<br />
| 25.2 cœurs / 112 Go<br />
| 5 cœurs / 47.1 Go<br />
|-<br />
| A100-80gb*<br />
| 4.8<br />
| 46.6 cœurs / 206 Go<br />
| {8, 16} c. / {62, 248} Go<br />
|-<br />
! scope="row"| [[Narval#Caractéristiques_des_nœuds|Narval]]<br />
| A100-40gb<br />
| 4.0<br />
| 3.0 cœurs / 31 Go<br />
| 12 cœurs / 124.5 Go<br />
| 12 cœurs / 124.5 Go<br />
|}<br />
<br />
(*) Ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
<b>Remarque :</b> Si l'ordonnanceur établit la priorité sur la base de l'utilisation calculée avec les bundles, une demande de plusieurs GPU sur un même nœud doit aussi tenir compte des ratios physiques.<br />
<br />
=Visionner les données d’utilisation par le groupe=<br />
<br />
[[File:Select view group usage fr edit.png|thumb|Onglet <i>Mon compte</i>, option <i>Utilisation par le groupe</i>]]<br />
Vous pouvez visionner les données d’utilisation des ressources par votre groupe en sélectionnant <i>Mon compte --> Utilisation par le groupe</i> dans la base de données CCDB. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_fr.png|thumb|Utilisation de CPU et de GPU, par ressource de calcul]]<br />
Les valeurs pour l’utilisation des CPU (cœurs-année) et des GPU-année sont calculées selon la quantité des ressources allouées aux tâches exécutées sur les grappes. Notez que les valeurs employées dans les graphiques ne représentent pas les équivalents-cœur; ainsi, l’utilisation par les tâches qui exigent beaucoup de mémoire ne correspond pas à l’utilisation du compte représentée par l’ordonnanceur de la grappe.<br />
<br />
La première barre d’onglets offre les vues suivantes&nbsp;:<br />
: <b>Par ressource de calcul</b>; nom de la grappe sur laquelle les tâches ont été soumises,<br />
: <b>Par projet (RAPI)</b>; projets auxquels les tâches ont été soumises,<br />
: <b>Par utilisateur</b>; utilisatrice ou utilisateur ayant soumis les tâches,<br />
: <b>Utilisation du stockage</b>; voyez [[Storage and file management/fr|Stockage et gestion des fichiers]].<br />
<br clear=all><br />
<br />
==Utilisation par ressource de calcul==<br />
<br />
Cette vue montre l’utilisation par ressource de calcul par grappe, pour tous les groupes desquels vous êtes propriétaire ou membre, pour l’année d’allocation en cours qui commence le 1er avril. Les données représentent l’utilisation à jour et supposent que cette utilisation restera la même jusqu’à la fin de l’année d’allocation. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_monthly_fr.png|thumb|Utilisation mensuelle par ressource]]<br />
Dans la colonne <i>Extra Info</i>, cliquez sur <i>Utilisation sur une base mensuelle</i> pour obtenir la répartition mensuelle pour la ressource correspondante. En cliquant sur <i>Utilisation par utilisateur</i>, la répartition se fait par utilisateur ou utilisatrice ayant soumis les tâches.<br />
<br clear=all><br />
<br />
==Utilisation par projet==<br />
[[File:Ccdb view use by compute resource monthly proj fr edit.png|thumb|Utilisation par projet, avec répartition mensuelle]]<br />
Pour cette vue, une troisième barre d'onglets permet de sélectionner l'identifiant de projet pour l'année d'allocation choisie. Le tableau montre les détails pour chaque projet ainsi que les ressources utilisées sur toutes les grappes. Dans le haut de la vue, on trouve le nom du compte (par exemple def-, rrg- ou rpp-*, etc.), le titre du projet et le ou la propriétaire, ainsi que les sommaires de l'allocation et de l'utilisation.<br />
<br clear=all><br />
<br />
==Utilisation des GPU et en unités GPU de référence (UGR)==<br />
[[File:rgu_fr.png|thumb|Sommaire de l'utilisation des GPU et le détail en unités GPU de référence (UGR) par modèle.]]<br />
Pour chaque projet (RAPI) ayant une utilisation de GPU, le détail d'utilisation par modèle de GPU est donné en GPU-années et en UGR-années dans une table située au bas de la page.<br />
<br clear=all><br />
<br />
==Utilisation par utilisateur==<br />
[[File:Ccdb view use by submitter summary fr edit.png|thumb|Utilisation de CPU et GPU]]<br />
Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur une base mensuelle</i>.<br />
<br clear=all><br />
<br />
[[Category:SLURM]]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Allocations_and_compute_scheduling/41/fr&diff=144805Translations:Allocations and compute scheduling/41/fr2023-10-02T18:05:59Z<p>Plstonge: </p>
<hr />
<div>==Utilisation des GPU et en unités GPU de référence (UGR)==<br />
[[File:rgu_fr.png|thumb|Sommaire de l'utilisation des GPU et le détail en unités GPU de référence (UGR) par modèle.]]<br />
Pour chaque projet (RAPI) ayant une utilisation de GPU, le détail d'utilisation par modèle de GPU est donné en GPU-années et en UGR-années dans une table située au bas de la page.<br />
<br clear=all></div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Allocations_and_compute_scheduling/fr&diff=144803Allocations and compute scheduling/fr2023-10-02T17:57:01Z<p>Plstonge: Created page with "==Utilisation par utilisateur== Utilisation de CPU et GPU Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur..."</p>
<hr />
<div><languages /><br />
<br />
<br />
<i>Page enfant de [[Job scheduling policies/fr|Politique d'ordonnancement des tâches]]</i><br />
<br />
=Allocations pour le calcul haute performance=<br />
<br />
<b>Une <i>allocation</i> est l’attribution d’une quantité de ressources à un groupe de recherche pour une période donnée, habituellement un an.</b> Il s'agit soit d'un maximum comme dans le cas du stockage, soit d'une moyenne d'utilisation sur une période donnée comme c'est le cas pour les ressources partagées que sont les cœurs de calcul.<br />
<br />
L’allocation des ressources de stockage attribue un maximum déterminé d’espace réservé à l’usage exclusif d’un groupe de recherche. Pour sa part, l’allocation des ressources partagées que sont les cœurs-année et les GPU-année est plus complexe puisque ces ressources sont partagées par l’ensemble des groupes et que l’allocation tient compte de l’utilisation moyenne de chaque groupe.<br />
<br />
La durée de l’allocation est une valeur de référence utilisée pour calculer la moyenne de la consommation des ressources au cours de la période pendant laquelle celles-ci sont disponibles. Par exemple, si les grappes ne sont pas disponibles pour une semaine dû à des opérations de maintenance, les groupes de recherche touchés n’obtiennent pas une semaine additionnelle en compensation à la fin de la période. De la même manière, si la période d’allocation est allongée, les groupes n’y perdent pas en utilisation.<br />
<br />
Notons qu’une allocation de cœurs-année et de GPU-année en ressources partagées considère la moyenne d’utilisation cible dans le temps; un groupe est donc plus susceptible d’atteindre et même de dépasser ses cibles en utilisant ses ressources de façon régulière sur la période qu’en soumettant des tâches en rafale (''burst'') ou en les reportant à plus tard.<br />
<br />
==De l'allocation à l'ordonnancement par priorité==<br />
<br />
Les ressources de calcul par cœurs-année et par GPU-année reçoivent des tâches qui sont immédiatement prises en charge par l’ordonnanceur. Rappelons qu’une tâche se compose d’une application logicielle et de la liste des ressources pour l’exécuter. L’ordonnanceur est aussi une application logicielle dont le rôle est de calculer la priorité de chaque tâche et de lui attribuer les ressources nécessaires selon leur disponibilité et en accord avec les règles de priorisation.<br />
<br />
À l’aide d’algorithmes spécialisés, l’ordonnanceur tient compte des cibles de chaque groupe et compare la consommation récente du groupe à l’utilisation qui lui était allouée. Un des facteurs déterminants est la consommation à l’intérieur de la période. Le facteur qui possède cependant le plus de poids est la consommation (ou la non-consommation) récente, ceci en vue d’offrir une opération plus stable aux groupes dont l’utilisation réelle se rapproche des ressources qui leur étaient allouées. Cette façon de procéder assure une meilleure répartition du parc de ressources pour l’ensemble des groupes et fait en sorte qu’il est théoriquement possible pour tous les groupes d’atteindre leurs cibles.<br />
<br />
==Conséquences d'une surutilisation d'une allocation CPU ou GPU==<br />
<br />
Si vous avez des tâches en attente et qu’à ce moment la demande en ressources de calcul est basse, l’ordonnanceur pourrait faire exécuter vos tâches même si vous dépassez la quantité cible de votre allocation. Tout ce qui peut se produire alors serait que les prochaines tâches que vous soumettrez se voient attribuer un plus bas niveau de priorité que celles soumises par des groupes qui n’ont pas encore atteint leur niveau cible d’utilisation. Aucune tâche soumise à l’ordonnanceur n’est refusée en raison d’une surutilisation de ressources et votre utilisation moyenne de ressources sur la période d’allocation devrait se situer proche de la cible qui vous a été allouée.<br />
<br />
Il se pourrait qu’au cours d’un mois ou d’une année vous puissiez accomplir plus de travail que votre allocation ne semblerait le permettre, mais ce scénario est peu probable puisque la demande est plus élevée que la quantité de ressources dont nous disposons.<br />
<br />
=Unités GPU de référence (UGR)=<br />
{{Note|Cette nouvelle unité sera utilisée à partir du concours pour l'allocation de ressources de 2024.}}<br />
<br />
Comme vous le savez peut-être, la performance des GPU a considérablement augmenté ces dernières années et devrait continuer sa progression avec la prochaine génération. Par le passé et jusqu'au concours de 2023, nous traitions tous les GPU comme étant équivalents les uns aux autres, tant au moment de l'allocation que dans le calcul du nombre de ressources consommées par le groupe. Ceci diminuait la complexité de nos outils de gestion des ressources, mais créait des problèmes d'équité, à la fois dans le processus d'attribution et lors de l'exécution des tâches. Nous ne pouvons donc plus continuer à traiter tous les types de GPU de la même manière.<br />
<br />
Afin de résoudre le problème d'équité, nous avons créé l'<i>unité GPU de référence</i> (ou <i>UGR</i>) qui nous permet de classer les différents modèles de GPU en production sur la base de leur performance nominale. Parce qu'environ la moitié des tâches utilisent principalement des opérations à virgule flottante simple précision ([https://en.wikipedia.org/wiki/Single-precision_floating-point_format FP32]) et que les autres utilisent des opérations à virgule flottante demi-précision ([https://en.wikipedia.org/wiki/Half-precision_floating-point_format FP16]), et que la plupart des utilisateurs se soucient de la mémoire sur du GPU lui-même, nous avons établi les critères d'évaluation suivants avec leur poids correspondant :<br />
<br />
{| class="wikitable" style="margin: auto;"<br />
|-<br />
! scope="col"| Critères d'évaluation<br />
! scope="col"| Poids <br> (UGR)<br />
|-<br />
! scope="row"| Score FP32<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score FP16<br />
| 40% * 4 = 1.6<br />
|-<br />
! scope="row"| Score mémoire GPU<br />
| 20% * 4 = 0.8<br />
|}<br />
<br />
Pour plus de commodité, les pondérations sont basées sur des pourcentages augmentés d'un facteur de 4 UGR. Ensuite, en utilisant le <b>A100-40gb</b> comme modèle de référence, nous obtenons les scores suivants pour chaque modèle&nbsp;:<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
|<br />
! scope="col"| Score FP32<br />
! scope="col"| Score FP16<br />
! scope="col"| Score mémoire<br />
! scope="col"| Score pondéré<br />
|-<br />
! scope="col"| Poids:<br />
! scope="col"| 1.6<br />
! scope="col"| 1.6<br />
! scope="col"| 0.8<br />
| (UGR)<br />
|-<br />
! scope="row" style="text-decoration: underline;"| Modèle<br />
|-<br />
! scope="row"| P100-12gb<br />
| 0.48<br />
| 0.00<br />
| 0.3<br />
! 1.0<br />
|-<br />
! scope="row"| P100-16gb<br />
| 0.48<br />
| 0.00<br />
| 0.4<br />
! 1.1<br />
|-<br />
! scope="row"| T4-16gb<br />
| 0.42<br />
| 0.21<br />
| 0.4<br />
! 1.3<br />
|-<br />
! scope="row"| V100-16gb*<br />
| 0.81<br />
| 0.40<br />
| 0.4<br />
! 2.2<br />
|-<br />
! scope="row"| V100-32gb*<br />
| 0.81<br />
| 0.40<br />
| 0.8<br />
! 2.6<br />
|-<br />
! scope="row"| A100-40gb<br />
| <b>1.00</b><br />
| <b>1.00</b><br />
| <b>1.0</b><br />
! 4.0<br />
|-<br />
! scope="row"| A100-80gb*<br />
| 1.00<br />
| 1.00<br />
| 2.0<br />
! 4.8<br />
|}<br />
<br />
(*) Sur Graham, ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
Par exemple, le plus ancien modèle de GPU en production est le P100-12gb qui vaut 1.0 UGR. Les prochaines générations de GPU seront comparées avec la même formule au modèle A100-40gb.<br />
<br />
==Choisir des modèles de GPU pour votre projet==<br />
<br />
Les scores relatifs du précédent tableau devraient vous aider à sélectionner les modèles les plus convenables. Les exemples suivants présentent des cas extrêmes.<br />
<br />
* Si vos applications font surtout des opérations FP32, le modèle A100-40gb devrait être deux fois plus rapide que le P100-12gb, mais l'utilisation des ressources sera considérée comme étant quatre fois plus grande. En conséquence, pour le même nombre d'UGR, le modèle P100-12gb devrait vous permettre d'exécuter deux fois plus de calculs. <br />
* Si vos applications font surtout des opérations FP16 (ce qui est le cas en intelligence artificielle et avec les opérations à précision mixte ou utilisant [https://en.wikipedia.org/wiki/Bfloat16_floating-point_format d'autres formats à virgule flottante]), l'utilisation d'un A100-40gb sera calculée comme utilisant quatre fois les ressources d'un P100-12gb, mais pourra faire ~30 fois plus de calculs dans la même période, ce qui vous permettrait d'exécuter ~7.5 fois plus de calculs.<br />
<br />
==À compter du concours de 2024==<br />
<br />
* Pour le concours d'allocation de ressources de 2024, votre demande de GPU doit indiquer le modèle de GPU que vous préférez. Le nombre d’UGR sera automatiquement calculé sur la base des GPU-années par année du projet et enregistré dans le formulaire électronique dans CCDB.<br />
** Par exemple, si vous sélectionnez la ressource <i>narval-gpu</i> et demandez 13 GPU-années du modèle A100-40gb, le nombre d’UGR sera 13&nbsp;*&nbsp;4.0&nbsp;=&nbsp;52. Le comité d’administration du concours vous allouerait un maximum de 52&nbsp;UGR, dépendant de la note attribuée à votre demande. Dans le cas où votre allocation serait déplacée sur Cedar, le comité vous allouerait jusqu’à 20&nbsp;GPU-années, puisque chaque GPU V100-32gb vaut 2.6&nbsp;UGR (et 52&nbsp;/&nbsp;2.6&nbsp;=&nbsp;20).<br />
<br />
* L’emploi des UGR entrera en vigueur le 1er avril 2024 avec le concours pour l'allocation des ressources de 2024. Cette unité servira à l’ordonnancement des tâches et au calcul de l’utilisation des ressources qui est rapportée dans CCDB.<br />
<br />
=Effet détaillé de l'utilisation des ressources sur la priorité=<br />
<br />
Le principe gouverneur dans notre façon de déterminer la priorité des tâches de calcul se base sur les ressources qu’une tâche rend <b>non disponibles aux autres utilisateurs</b> plutôt que sur les ressources effectivement utilisées.<br />
<br />
Le cas de cœurs non utilisés qui influent sur le calcul des priorités se produit souvent lorsqu’une tâche est soumise en demandant plusieurs cœurs, mais n’en consomme effectivement qu’une partie à l’exécution. C’est le nombre de cœurs demandés par une tâche qui a une incidence sur la priorisation des prochaines tâches puisque la tâche bloque les cœurs non utilisés pendant son exécution.<br />
<br />
Un autre cas fréquent de cœurs non utilisés se pose lorsqu’une tâche exige plus de mémoire que celle demandée pour un cœur. Sur une grappe où chaque cœur serait doté de 4Go de mémoire, une tâche qui demanderait un seul cœur et 8Go de mémoire bloquerait donc 2 cœurs et le deuxième cœur ne serait pas disponible pour les tâches des autres groupes de recherche<br />
<br />
==Équivalents-cœurs utilisés par l'ordonnanceur==<br />
<br />
Un équivalent-cœur se compose d’'''un cœur simple et d’une certaine quantité de mémoire'''; pour le nommer, nous utilisons le terme ''bundle''. En plus du cœur, le bundle contient aussi la mémoire considérée comme étant associée à ce cœur. <br />
<br />
[[File:EquivalentCoeur.png|frame|Figure 1 – ''Équivalent-cœur sur Cedar et Graham'']]<br />
<br />
Cedar et Graham offrent surtout des cœurs de 4Go et dans leur cas, l’équivalent-cœur est un bundle de 4 Go (voir Figure 1). Pour sa part, Niagara offre surtout des cœurs de 4.8Go, donc des bundles de 4.8Go. L’utilisation des ressources par une tâche est comptabilisée à raison de 4Go ou 4.8Go par cœur, comme mentionné ci-dessus.<br />
<br />
Le suivi des cibles s’avère relativement simple quand les ressources demandées sont des cœurs et des quantités de mémoire qui correspondent à un équivalent-cœur entier, plutôt qu’à une portion d’équivalent-cœur. Les choses se compliquent parce que l’utilisation de portions d’équivalents-cœur risque d’augmenter le pointage servant au calcul de la juste part du groupe de recherche. En pratique, la méthode appliquée résout le problème d'équité ou de perception d'équité, mais cette méthode n’est pas intuitive au début.<br />
<br />
Dans les exemples qui suivent, la mémoire est de 4Go.<br />
<br />
<b>Comptabilisation par équivalents-cœur</b><br />
<br />
Examinons le cas où nous avons un bundle composé de 1 cœur et 4Go de mémoire.<br />
<br />
* [[File:Two_core_equivalents.png|frame|Figure 2 <i>– Deux équivalents-cœurs</i>]] Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de mémoire, c’est-à-dire plus que le ratio 1cœur/4Go.<br />
*:Dans la figure 2, on demande 2 cœurs et 2Go par cœur pour une mémoire totale de 4Go; la tâche exige 2 équivalents-cœur pour les cœurs, mais un seul bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-cœurs. <br clear=all><br />
<br />
* [[File:Two_and_a_half_core_equivalents.png|frame|Figure 3 – <i>2.5 équivalents-cœur</i>]] La mémoire est comptabilisée si un groupe utilise plus de mémoire que le ratio de 1 cœur/4Go.<br />
*:Dans la figure 3, on demande 2 cœurs et 5Go par cœur pour une mémoire totale de 10Go; la tâche exige 2.5 bundles pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2.5 équivalents-cœurs. <br clear=all><br />
<br />
==Équivalents-UGR utilisés par l'ordonnanceur==<br />
<br />
L’utilisation des GPU et leurs ressources associées suit les mêmes principes que ceux décrits pour les équivalents-coeurs, sauf qu’une UGR est ajoutée au bundle avec de la mémoire et plusieurs cœurs. Ceci signifie que la comptabilisation de l’utilisation de la cible pour l’allocation de GPU doit inclure l’UGR. Tout comme le système de points utilisé dans l’expression de l’utilisation de la ressource en équivalents-cœurs, nous utilisons aussi un système de points pour les équivalents-UGR.<br />
<br />
Le calcul de priorité se fait en fonction du nombre maximum de bundles UGR-coeurs-mémoire demandés. Examinons le cas où nous avons un bundle de 1 UGR, 3 cœurs et 4Go de mémoire.<br />
[[File:EquivalentG1.png|thumb|upright=1.1|center|Figure 4 - ''1 équivalent-UGR'']] <br clear=all><br />
<br />
* Les UGR sont comptabilisés si un groupe utilise plus de UGR que de cœurs OU de mémoire par bundle. Prenons l'exemple d'un usager demandant 2 GPU (de 1 UGR chacun), 3 cœurs et 4Go de mémoire. La tâche exige donc l'équivalent de 2 bundles pour les GPU, mais un seul pour les cœurs et la mémoire. Pour calculer la priorité, l’ordonnanceur évalue la demande à 2 équivalents-UGR. <br />
[[File:EquivalentsG2_(GPUs).png|thumb|center|Figure 5 – ''2 équivalents-UGR'']] <br clear=all><br />
<br />
* Les cœurs sont comptabilisés si un groupe utilise plus de cœurs que de UGR OU plus de mémoire par bundle avec GPU. Dans la figure 6, on demande 1 GPU de 1 UGR, 5 cœurs et 5Go; la requête exige donc 1.66 bundles avec GPU pour les cœurs, mais un seul bundle pour le GPU et 1.25 bundle pour la mémoire. Pour calculer la priorité, l’ordonnanceur évalue donc la demande à 1.66 équivalents-UGR.<br />
[[File:EquivalentsG1.66_(coeurs).png|thumb|center|Figure 6 – ''1.66 équivalents-GPU (cœurs)'']] <br clear=all><br />
<br />
* La mémoire est comptabilisée si un groupe utilise plus de mémoire que de UGR OU de cœurs par bundle avec GPU. Dans la figure 7, on demande 1 GPU de 1 UGR, 2 cœurs et 6Go; la requête exige donc 1.5 bundle avec GPU pour la mémoire, mais un seul bundle pour les GPU et 0.66 pour les cœurs. Pour calculer la priorité, l’ordonnanceur évalue la demande à 1.5 équivalents-GPU.<br />
[[File:EquivalentsG1.5_(memoire).png|thumb|center|Figure 7 – ''1.5 équivalents-GPU (mémoire)'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU V100-32gb, 7.8 cœurs et 10.4 Go de mémoire-vive vaudrait 2.6 équivalents-UGR :<br />
[[File:EquivalentsG2.6_V100-32gb.png|thumb|upright=2.1|center|Figure 8 - ''2.6 équivalents-UGR, basés sur le GPU V100-32gb'']] <br clear=all><br />
<br />
* Sur la même grappe fictive, un bundle comprenant un GPU A100-40gb, 12 cœurs et 16 Go de mémoire-vive vaudrait 4.0 équivalents-UGR :<br />
[[File:EquivalentsG4_A100-40gb.png|thumb|upright=2.66|center|Figure 9 - ''4.0 équivalents-UGR, basés sur le GPU A100-40gb'']] <br clear=all><br />
<br />
===Ratios dans les bundles===<br />
Les différents bundles UGR-coeur-mémoire et GPU-coeur-mémoire des systèmes de l'Alliance ont les caractéristiques suivantes :<br />
<br />
{| class="wikitable" style="margin: auto; text-align: center;"<br />
|-<br />
! scope="col"| Grappe<br />
! scope="col"| Modèle GPU<br />
! scope="col"| UGR par GPU<br />
! scope="col"| Bundle par UGR<br />
! scope="col"| Bundle par GPU<br />
! scope="col"| Ratios physiques<br />
|-<br />
! scope="row"| [[Béluga#Caractéristiques_des_nœuds|Béluga]]<br />
| V100-16gb<br />
| 2.2<br />
| 4.5 cœurs / 21 Go<br />
| 10 cœurs / 46.5 Go<br />
| 10 cœurs / 46.5 Go<br />
|-<br />
! rowspan="3"| [[Cedar/fr#Caractéristiques_des_nœuds|Cedar]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="3"|3.1 cœurs / 25 Go<br />
| 3.1 cœurs / 25 Go<br />
| 6 cœurs / 31.2 Go<br />
|-<br />
| P100-16gb<br />
| 1.1<br />
| 3.4 cœurs / 27 Go<br />
| 6 cœurs / 62.5 Go<br />
|-<br />
| V100-32gb<br />
| 2.6<br />
| 8.0 cœurs / 65 Go<br />
| 8 cœurs / 46.5 Go<br />
|-<br />
! rowspan="5"| [[Graham/fr#Caractéristiques_des_nœuds|Graham]]<br />
| P100-12gb<br />
| 1.0<br />
| rowspan="5"| 9.7 cœurs / 43 Go<br />
| 9.7 cœurs / 43 Go<br />
| 16 cœurs / 62 Go<br />
|-<br />
| T4-16gb<br />
| 1.3<br />
| 12.6 cœurs / 56 Go<br />
| {4, 11} cœurs / 46.8 Go<br />
|-<br />
| V100-16gb*<br />
| 2.2<br />
| 21.3 cœurs / 95 Go<br />
| 3.5 cœurs / 23.4 Go<br />
|-<br />
| V100-32gb*<br />
| 2.6<br />
| 25.2 cœurs / 112 Go<br />
| 5 cœurs / 47.1 Go<br />
|-<br />
| A100-80gb*<br />
| 4.8<br />
| 46.6 cœurs / 206 Go<br />
| {8, 16} c. / {62, 248} Go<br />
|-<br />
! scope="row"| [[Narval#Caractéristiques_des_nœuds|Narval]]<br />
| A100-40gb<br />
| 4.0<br />
| 3.0 cœurs / 31 Go<br />
| 12 cœurs / 124.5 Go<br />
| 12 cœurs / 124.5 Go<br />
|}<br />
<br />
(*) Ces modèles sont offerts par un petit nombre de nœuds GPU fournis par contribution. Ils peuvent être utilisés, mais ne sont pas alloués par la voie du concours annuel d'allocation des ressources.<br />
<br />
<b>Remarque :</b> Si l'ordonnanceur établit la priorité sur la base de l'utilisation calculée avec les bundles, une demande de plusieurs GPU sur un même nœud doit aussi tenir compte des ratios physiques.<br />
<br />
=Visionner les données d’utilisation par le groupe=<br />
<br />
[[File:Select view group usage fr edit.png|thumb|Onglet <i>Mon compte</i>, option <i>Utilisation par le groupe</i>]]<br />
Vous pouvez visionner les données d’utilisation des ressources par votre groupe en sélectionnant <i>Mon compte --> Utilisation par le groupe</i> dans la base de données CCDB. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_fr.png|thumb|Utilisation de CPU et de GPU, par ressource de calcul]]<br />
Les valeurs pour l’utilisation des CPU (cœurs-année) et des GPU-année sont calculées selon la quantité des ressources allouées aux tâches exécutées sur les grappes. Notez que les valeurs employées dans les graphiques ne représentent pas les équivalents-cœur; ainsi, l’utilisation par les tâches qui exigent beaucoup de mémoire ne correspond pas à l’utilisation du compte représentée par l’ordonnanceur de la grappe.<br />
<br />
La première barre d’onglets offre les vues suivantes&nbsp;:<br />
: <b>Par ressource de calcul</b>; nom de la grappe sur laquelle les tâches ont été soumises,<br />
: <b>Par projet (RAPI)</b>; projets auxquels les tâches ont été soumises,<br />
: <b>Par utilisateur</b>; utilisatrice ou utilisateur ayant soumis les tâches,<br />
: <b>Utilisation du stockage</b>; voyez [[Storage and file management/fr|Stockage et gestion des fichiers]].<br />
<br clear=all><br />
<br />
==Utilisation par ressource de calcul==<br />
<br />
Cette vue montre l’utilisation par ressource de calcul par grappe, pour tous les groupes desquels vous êtes propriétaire ou membre, pour l’année d’allocation en cours qui commence le 1er avril. Les données représentent l’utilisation à jour et supposent que cette utilisation restera la même jusqu’à la fin de l’année d’allocation. <br />
<br clear=all><br />
<br />
[[File:ccdb_view_use_by_compute_resource_monthly_fr.png|thumb|Utilisation mensuelle par ressource]]<br />
Dans la colonne <i>Extra Info</i>, cliquez sur <i>Utilisation sur une base mensuelle</i> pour obtenir la répartition mensuelle pour la ressource correspondante. En cliquant sur <i>Utilisation par utilisateur</i>, la répartition se fait par utilisateur ou utilisatrice ayant soumis les tâches.<br />
<br clear=all><br />
<br />
==Utilisation par projet==<br />
[[File:Ccdb view use by compute resource monthly proj fr edit.png|thumb|Utilisation par projet, avec répartition mensuelle]]<br />
Pour cette vue, une troisième barre d'onglets permet de sélectionner l'identifiant de projet pour l'année d'allocation choisie. Le tableau montre les détails pour chaque projet ainsi que les ressources utilisées sur toutes les grappes. Dans le haut de la vue, on trouve le nom du compte (par exemple def-, rrg- ou rpp-*, etc.), le titre du projet et le ou la propriétaire, ainsi que les sommaires de l'allocation et de l'utilisation.<br />
<br clear=all><br />
<br />
<div class="mw-translate-fuzzy"><br />
==Utilisation par utilisateur==<br />
[[File:Ccdb view use by submitter summary fr edit.png|thumb|Utilisation de CPU et GPU]]<br />
Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur une base mensuelle</i>.<br />
<br clear=all><br />
</div><br />
<br />
==Utilisation par utilisateur==<br />
[[File:Ccdb view use by submitter summary fr edit.png|thumb|Utilisation de CPU et GPU]]<br />
Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur une base mensuelle</i>.<br />
<br clear=all><br />
<br />
[[Category:SLURM]]</div>Plstongehttps://docs.alliancecan.ca/mediawiki/index.php?title=Translations:Allocations_and_compute_scheduling/42/fr&diff=144802Translations:Allocations and compute scheduling/42/fr2023-10-02T17:56:58Z<p>Plstonge: Created page with "==Utilisation par utilisateur== Utilisation de CPU et GPU Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur..."</p>
<hr />
<div>==Utilisation par utilisateur==<br />
[[File:Ccdb view use by submitter summary fr edit.png|thumb|Utilisation de CPU et GPU]]<br />
Cette vue montre l'utilisation par utilisatrices et utilisateurs ayant soumis des tâches pour le projet sélectionné (comptes de groupes), par système. En cliquant sur le nom d'une personne en particulier, vous obtiendrez son utilisation répartie par grappe. Tout comme les sommaires pour les groupes, vous pouvez utiliser l'option <i>Utilisation sur une base mensuelle</i>.<br />
<br clear=all></div>Plstonge