Difference between revisions of "How to Setup Visual Studio Code for the ifarm"

From GlueXWiki
Jump to: navigation, search
m
Line 10: Line 10:
 
** See the guide under '''Software''' on the [https://halldweb.jlab.org/wiki/index.php/Getting_Started_At_GlueX#Software Getting Started at GlueX page]
 
** See the guide under '''Software''' on the [https://halldweb.jlab.org/wiki/index.php/Getting_Started_At_GlueX#Software Getting Started at GlueX page]
 
** Or see the '''Prerequisites''' section in this [https://jlab.servicenowservices.com/kb?id=kb_article_view&sysparm_article=KB0015066 servicenow article]
 
** Or see the '''Prerequisites''' section in this [https://jlab.servicenowservices.com/kb?id=kb_article_view&sysparm_article=KB0015066 servicenow article]
 
+
* Downloaded [https://code.visualstudio.com/download VS Code]
  
  
 
== The .ssh/config file ==
 
== The .ssh/config file ==
 +
# Your first step for getting onto the ifarm will be creating a ssh config file, which dictates how your device, or “local machine”, will connect to the remote JLab server
 +
# Open VS Code and navigate to the '''Extensions''' tab on the left hand sidebar. Copy and paste <code>ms-vscode-remote.remote-ssh</code> into the search bar, and install the package.
 +
## If you can’t see the sidebar, try in the menu '''View > Appearance > Primary Side Bar'''
 +
# In the menu bar go to '''View > Command Palette'''. Search and select <code>Remote-SSH: Open SSH Configuration File</code>
 +
# Your default file is likely at <code>/Users/YOUR_USERNAME/.ssh/config</code>. Select this file.
 +
## If not yet created, no worries. Instead of copy/pasting the file contents in the next step, simply place the file at this location
 +
# If settings already exist in this file they can be kept, so long as they are not ifarm related. We will be using a slightly modified version from the [https://jlab.servicenowservices.com/scicomp/?id=kb_article&sysparm_article=KB0014918 JLab recommended] config file. Download the custom config file and copy/paste its contents into your .ssh/config file
  
  

Revision as of 12:15, 22 March 2024

Table of contents

Welcome! Have you ever wanted to edit code with smart code completion, integrated Git, syntax highlighting, intuitive debuggers, and so much more, all wrapped into one? Well look no further than Visual Studio (VS) Code! By the end of this guide you will be able to connect to the ifarm and have all these powerful tools right at your fingertips. If you run into any problems (especially if you have Windows machine, as this guide has only been tested for Apple devices) then please message me (Kevin Scheuer) over Slack and let me know!

Setup

Before beginning, please ensure you have the following:


The .ssh/config file

  1. Your first step for getting onto the ifarm will be creating a ssh config file, which dictates how your device, or “local machine”, will connect to the remote JLab server
  2. Open VS Code and navigate to the Extensions tab on the left hand sidebar. Copy and paste ms-vscode-remote.remote-ssh into the search bar, and install the package.
    1. If you can’t see the sidebar, try in the menu View > Appearance > Primary Side Bar
  3. In the menu bar go to View > Command Palette. Search and select Remote-SSH: Open SSH Configuration File
  4. Your default file is likely at /Users/YOUR_USERNAME/.ssh/config. Select this file.
    1. If not yet created, no worries. Instead of copy/pasting the file contents in the next step, simply place the file at this location
  5. If settings already exist in this file they can be kept, so long as they are not ifarm related. We will be using a slightly modified version from the JLab recommended config file. Download the custom config file and copy/paste its contents into your .ssh/config file


Connecting

Working With VS Code

Extensions

Troubleshooting