How to ... - Valentyn1997/xray GitHub Wiki

... detach/attach sessions with tmux

Step by step tutorial

  1. Connect to remote using local terminal: ssh *hitansh*@10.195.1.150 -i *~/.ssh/hitansh
  2. In remote, create new tmux-session: tmux new -s <session_name>
  3. Tmux will create virtual command line, which should look like this: image
  4. Do your stuff in virtual command line (e.g. start training: PYTHONPATH=../../ python3 train.py) image
  5. Type Ctrl+B and then d - to detach a session.
  6. Type tmux ls, to see all active sessions.
  7. Type tmux attach-session -t <session_name>, to attach existing session.
  8. To kill existing session, type in virtual command line: Ctrl + B and x.

Ref: https://linuxize.com/post/getting-started-with-tmux/.

... work with jupyter remotely

Step by step process Mac/Windows:

(Only change *stuff* with your credits)

  1. Open terminal
  2. Jupyter is already installed both machines? Most probably yes.
  3. Connect to your remote account using local terminal:
    ssh *hitansh*@10.195.1.150 -i *~/.ssh/hitansh
  4. After connecting: type this remotely:
    jupyter notebook --no-browser --port=8889
  5. Keep that terminal running.
  6. Open new local terminal.
  7. Connect as in step 3
  8. Type:
    jupyter notebook list
  9. Copy the token
  10. Open another local terminal
  11. Type locally:
    ssh -N -f -L localhost:8889:localhost:8889 *hitansh*@10.195.1.150 -i *~/.ssh/hitansh
  12. Visit localhost:8889 locally on browser
  13. Paste the token that you copied in step 9

Ref: https://amber-md.github.io/pytraj/latest/tutorials/remote_jupyter_notebook

... work with mlflow remotely

Step by Step process for Mac/Windows:

  1. Open terminal locally
  2. Connect to remote
  3. Type this if not already installed (on remote): pip3 install mlflow
  4. cd xray/src/models (this folder should contain mlruns folder)
  5. mlflow ui

Do not close this.

  1. Now open local terminal
  2. locally type this: (change <username> stuff with your credits) ssh -N -f -L localhost:8892:localhost:5000 <username>@10.195.1.150 -i *~/.ssh/id_rsa
  3. Visit localhost:8892

Ref: https://www.mlflow.org/docs/latest/tutorial.html

... work with dvc

To pull data from dvc remote on openstack:

  1. git pull
  2. Be sure, that you have private key named id_rsa stored in .ssh/
  3. Install correct dvc: pip install dvc[ssh]
  4. Run dvc remote add -f -d myremote ssh://<username>@10.195.1.150:/home/ubuntu/xray_data/ in project directory.
  5. Run dvc pull.

You can run: dvc remote modify --local myremote keyfile <your ssh key file> if the private key is not names id_rsa (see: https://dvc.org/doc/commands-reference/remote-modify)

Push:

dvc status

dvc commit

dvc push

Note1: update data.dvc in git as well by using git commit Note2: rename config to config.local and empty the contents of config

⚠️ **GitHub.com Fallback** ⚠️