Skip to content

Commit

Permalink
vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
telatin authored and aresti committed Mar 18, 2024
1 parent 834576c commit dba0759
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/index.md
Expand Up @@ -29,6 +29,9 @@ How to launch, access and get started using a notebook server.
[Using the terminal](notebook-servers/using-the-terminal.md)
How to use the terminal inside a notebook server, with an explanation of caveats.

[Using VS Code](using-vscode.md)
How to connect to your CLIMB Notebook using VS Code

[Understanding storage](storage/index.md)
An explanation of the different storage options available and when to use what.

Expand Down
Binary file added docs/notebook-servers/img/vscode-remotes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/notebook-servers/index.md
Expand Up @@ -20,5 +20,8 @@ How to install software using Conda, in the context of a containerized environme
[Using Nextflow](using-nextflow.md)
How to use Nextflow with CLIMB-BIG-DATA.

[Using VS Code](using-vscode.md)
How to connect to your CLIMB Notebook using VS Code

[How to fix login error 403](403-forbidden-error.md)
An explanation of how to resolve login error 403 when accessing notebooks.
74 changes: 74 additions & 0 deletions docs/notebook-servers/using-vscode.md
@@ -0,0 +1,74 @@
# Editing with VS Code

Visual Studio Code, or VS Code, is a very popular [IDE](https://aws.amazon.com/what-is/ide/).
In this tutorial we will see how to use VS code to connect to your CLIMB Jupyter Notebook

<!-- prettier-ignore -->
!!! Prerequisites
We will assume you are a **VS Code** user already and you can install extensions and that you have a **GitHub account**.
If you are not, you might be interested in [learning why](https://code.visualstudio.com/learn) it's so popular, and maybe [download](https://code.visualstudio.com/Download) it and give it ago.


## Install "Tunnels"

Inside your local VS Code, install the extension `Remote - Tunnels` by Microsoft.

After you install it, go to your *Remotes* tab and login using your GitHub account (you should see a *Sign in using your GitHub account* item in the menu).

See the image below to locate the "Remotes" tab.

![VS Code screenshot](img/vscode-remotes.png){ width=600 }

## Install VS Code in your CLIMB terminal

First, you will need to download *VS Code* also in your CLIMB notebook. This step has only to be done the first time.

```console
# SETUP (this has to be done once)
cd $HOME
# Download VS Code (this has to be done once)
wget -O code.tgz "https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64"
# Expand the package (this has to be done once)
tar xvfz code.tgz
```

Now, you can run a tunnel from your CLIMB terminal, with this command:

```console
~/code tunnel
```

This command will start an *interactive* configuration walk-through so keep an eye at the terminal and
answer the questions / follow the instructions.

You will have to follow the instructions which will involve:

1. Selecting GitHub as provider
2. Following the provided link and pasting there the code that will appear on your CLIMB notebook
3. Authorize the connection
4. Return to your CLIMB notebook terminal, and give a name to the connection

Here a typical example of the connection setup:

```text
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
✔ How would you like to log in to Visual Studio Code?
· Github Account
To grant access to the server, please log into https://github.com/login/device and use code 420D-0000
✔ What would you like to call this machine? · jupyter-telatin-2enf
[2024-03-18 12:25:40] info Creating tunnel with the name: jupyter-telatin-2enf
Open this link in your browser https://vscode.dev/tunnel/jupyter-telatin-2enxf
```

When you are done, you can either click on the link provided on your terminal, or refresh
your tunnels list in your *local* VS Code, and as shown in the image above, you should see the
`jupyter-groupname-id` (or custom name you gave)
1 change: 1 addition & 0 deletions mkdocs.yml
Expand Up @@ -50,6 +50,7 @@ nav:
- "Understanding storage": "storage/index.md"
- "Installing software with Conda": "notebook-servers/installing-software-with-conda.md"
- "Using Nextflow": "notebook-servers/using-nextflow.md"
- "Using VS Code": "notebook-servers/using-vscode.md"
- "403 Forbidden Error": "notebook-servers/403-forbidden-error.md"
- "Walkthroughs":
- "Metagenomics": "walkthroughs/metagenomics-tutorial.md"
Expand Down

0 comments on commit dba0759

Please sign in to comment.