info_tfgrid/docs/hero_mdbook_fullvm_script.md
2024-02-15 16:49:23 -05:00

2.6 KiB

Hero and mdbook on a Full VM: Script

Table of Contents


Introduction

In this tutorial, we show how to use a script to deploy an mdbook with the hero tool.

For this guide, we show an example using the mdbook from the repository info_tfgrid. This setup can be done locally or on a VM. Note that it should be run as root.

We show the steps for a full VM deployed on the TFGrid with WireGuard. We use 10.20.4.2 as a WireGuard IP address. Adjust according to your own setup.

We will be using SSH to connect to the VM and we will access the mdbook output on a local browser. To manage the mdbook files, we will be using the remote explorer feature of either VSCodium or VSCode.

Setting the Full VM

We start by deploying a full VM with WireGuard on the TFGrid.

To connect to the VM, we will be using a remote explorer.

Remote Explorer Access

You can use the remote explorer feature of both VSCode and VSCodium to manage the mdbook.

  • Open the window Remote Explorer, click on Add New and write the following in the SSH config file:
    Host 10.20.4.2
        HostName 10.20.4.2
        User root
    
  • Click on Connect to Host
  • Open the main /root directory
  • Right-click on the main window of the directory and select Open in Integrated Terminal

Download and Run the Script

  • Download the script
    wget https://git.ourworld.tf/tfgrid/info_tfgrid/raw/branch/main/scripts/hero_mdbook.sh
    
  • Run the script (this will take a couple of minutes)
    source hero_mdbook.sh
    

Serve and View the mdbook

  • Serve the mdbook
    mdbook serve --hostname 0.0.0.0 --port 3333
    
  • Open your browser and use the following URL:
    localhost:3333
    

You can now work on the mdbook and see live the changes your bring to the mdbook files on the remote VM.

Questions and Feedback

If you have any questions or feedback, please let us know by either writing a post on the ThreeFold Forum, or by chatting with us on the TF Grid Tester Community Telegram channel.