Skip to content

Commit

Permalink
Add docs on ssh tunnelling
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
Sbozzolo committed Aug 3, 2024
1 parent 658165f commit bae39ec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
9 changes: 0 additions & 9 deletions ClimaExplorer/explorer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ port = 8080
server = Server(IPa, port; proxy_url = "http://localhost:9384")

app = ClimaExplorer.BonitoApp(path)

route!(server, "/" => app)
println(server)
wait(server)

# connect to calhpc via
# ssh -L 9384:localhost:8080 calhpc
# (assuming calphc is configured as [USER]@[SSH_SERVER]

# run this script
# app will be on http://localhost:9384/atmos
# on the Caltech network
31 changes: 25 additions & 6 deletions docs/src/explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,54 @@ local server and dynamically serve plots.
How to install
===============

To install `ClimaExplorer`, first clone the `ClimaAnalysis.jl` repo
To install `ClimaExplorer`, first clone the `ClimaAnalysis.jl` repository
```sh
git clone https://github.com/CliMA/ClimaAnalysis.jl.git
```
Then, instantiate the `climaexplorer` environment
```sh
julia --project=ClimaAnalysis.jl/climaexplorer -e 'using Pkg; Pkg.instantiate()'
julia --project=ClimaAnalysis.jl/ClimaExplorer -e 'using Pkg; Pkg.instantiate()'
```

How to use
==========

Once you installed `ClimaExplorer`, you can start the server with
```sh
julia --project=ClimaAnalysis.jl/climaexplorer ClimaAnalysis.jl/climaexplorer/explorer.jl PATH_OF_OUTPUT
julia --project=ClimaAnalysis.jl/climaExplorer ClimaAnalysis.jl/ClimaExplorer/explorer.jl
```
where `PATH_OF_OUTPUT` is the path where the output files live.
The first time you do so, this will take a little while.
This might take a while.

You can also pass a path as an argument to `explorer.jl`. This will start `ClimaExplorer` with
that folder (by default, the current working directory is used).

If everything went correctly, you should see a message like
```
Server:
isrunning: true
listen_url: http://localhost:8080
online_url: http://localhost:8080
online_url: http://localhost:9384
http routes: 1
/ => App
websocket routes: 0
```
This means that the server has started. Visit `http://localhost:8080` to start
inspecting the output. Note that the port number `8080` might be different.
To close the server, press `Ctrl-C`.

How to use on remote clusters
=============================

Often data resides on remote clusters. You can run `ClimaExplorer` on the
machine where the data lives and use an ssh tunnel to access the server from
your computer.

To do so, first start the server on the remote cluster (as described above).
Next, on your local machine, forward the remote port:
```bash
ssh -f username@host -L 9384:localhost:8080 -N
```
instead of `username@host`, put your `usarename` and `hostname` (e.g.,
`pippo@login.hpc.caltech.edu`)

Next, open your browser and access `ClimaExplorer` visiting `localhost:9394`.

0 comments on commit bae39ec

Please sign in to comment.