Skip to content

Commit

Permalink
improve wording
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunyogeshwaran committed Dec 9, 2024
1 parent f5eca29 commit 3fccd65
Showing 1 changed file with 49 additions and 51 deletions.
100 changes: 49 additions & 51 deletions air-gapped_installations/README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,77 @@
# Air-gapped Installation of Custom Recipes

Air gapping is a network security measure employed on one or more computers
to ensure that a secure computer network is physically isolated from unsecured networks,
such as the public Internet or an unsecured local area network.
Air gapping is a network security measure used to isolate one or more computers from unsecured networks, such as the public Internet or an unsecured local area network. This ensures that the secure computer network remains physically separated from external, potentially unsafe networks.

This documentation will guide you through the installation of Custom Recipes in such air-gapped environment.
This guide walks you through the installation process of Custom Recipes in an air-gapped environment.

## Prerequisite
- There are two DAI installations involved here. One is in an **Air-Gapped Machine** and second is in an **Internet-Facing Machine**. They will be referred this way here to avoid confusion.
- First you need to install DAI in an air gapped environment *ie. in a computer isolated from internet*.
This DAI can be installed in any Package Type (TAR SH, Docker, DEB etc.) available in https://www.h2o.ai/download/
- While in the Internet Facing Machine, clone this repository for now and checkout the branch of your DAI `VERSION`
- Two DAI installations are required: one on an **Air-Gapped Machine** and the other on an **Internet-Facing Machine**. These terms will be used throughout the document for clarity.
- First, install DAI on the air-gapped machine (a machine isolated from the Internet). DAI can be installed using any available package type (e.g., TAR SH, Docker, DEB). You can download the installation packages from [H2O.ai Downloads](https://h2o.ai/resources/download/).
- On the Internet-facing machine, clone the repository and check out the appropriate branch for your DAI `VERSION`
```
git clone https://github.com/h2oai/driverlessai-recipes.git
cd driverlessai-recipes
git checkout rel-VERSION # eg. git checkout rel-1.9.0 for DAI 1.9.0
```

## Installation Guide
Follow along these steps to use custom recipes for DAI in an air-gapped environment:
## Installation Guide
Follow the steps below to use custom recipes for DAI in an air-gapped environment:

*Note: following steps need to be performed in Internet Facing Machine*
**Note**: *These steps should be performed on the Internet-Facing Machine.*

- Download the required version of Driverless AI TAR SH installer in a Internet facing machine from https://www.h2o.ai/download/
1. Download the required version of the Driverless AI TAR SH installer on the Internet-Facing Machine from [H2O.ai Downloads](https://www.h2o.ai/download/).

- Run the following commands to install the Driverless AI TAR SH. Replace `VERSION` with your specific version.
2. Run the following commands to install the Driverless AI TAR SH. Replace `VERSION` with the specific version you need.
```
chmod 755 dai-VERSION.sh
./dai-VERSION.sh
```

```
chmod 755 dai-VERSION.sh
./dai-VERSION.sh
```
- Now cd to the unpacked directory.
```
cd dai-VERSION
```
- Copy the load_custom_recipe.py script from `driverlessai-recipes/air-gapped_installations` to `dai-VERSION`
3. Next, `cd` to the unpacked directory:
```
cd dai-VERSION
```

- Run the following python script, either in one of the following ways:
4. Copy the `load_custom_recipe.py` script from `driverlessai-recipes/air-gapped_installations` to `dai-VERSION`.

a) To load custom recipes from a local file.
5. Run the following Python script, either in one of the following ways:

- **To load custom recipes from a local file:**
```
./dai-env.sh python load_custom_recipe.py -username <user> -p `</absolute/path/to/the/custom_recipe/file.py>` >> load_custom_recipe.log
```
where `<user>` is the username, e.g. jon and `</absolute/path/to/the/custom_recipe/file.py>` is the path to a recipe you want to upload to DAI.
- `<user>`: The username (e.g., `jon`).
- `</absolute/path/to/the/custom_recipe/file.py>`: The path to the recipe you want to upload to DAI.
For example to load [daal_trees recipe](https://github.com/h2oai/driverlessai-recipes/blob/rel-1.8.8/models/algorithms/daal_trees.py) from the cloned driverlessai-recipes repo we do:
```
./dai-env.sh python load_custom_recipe.py -username jon -p /home/ubuntu/driverlessai-recipes/models/algorithms/daal_trees.py >> load_custom_recipe.log
```
For example, to load the [daal_trees recipe](https://github.com/h2oai/driverlessai-recipes/blob/rel-1.8.8/models/algorithms/daal_trees.py) from the cloned `driverlessai-recipes` repo:
```
./dai-env.sh python load_custom_recipe.py -username jon -p /home/ubuntu/driverlessai-recipes/models/algorithms/daal_trees.py >> load_custom_recipe.log
```
b) To load custom recipes from a URL.
- **To load custom recipes from a URL:**
```
./dai-env.sh python load_custom_recipe.py -username <user> -u <URL> >> load_custom_recipe.logg
```
where `<URL>` is an http link for a url.
- `<URL>`: The URL to the custom recipe.
For example to load [catboost recipe](https://github.com/h2oai/driverlessai-recipes/blob/rel-1.8.8/models/algorithms/catboost.py) from url we do:
```
./dai-env.sh python load_custom_recipe.py -username jon -u https://github.com/h2oai/driverlessai-recipes/blob/rel-1.8.8/models/algorithms/catboost.py >> load_custom_recipe.log
```
**Note:** you can check the `load_custom_recipe.log` file to see if the operation was successful.
For example, to load the [catboost recipe](https://github.com/h2oai/driverlessai-recipes/blob/rel-1.8.8/models/algorithms/catboost.py) from a URL:
```
./dai-env.sh python load_custom_recipe.py -username jon -u https://github.com/h2oai/driverlessai-recipes/blob/rel-1.8.8/models/algorithms/catboost.py >> load_custom_recipe.log
```
**Note:** *You can check the `load_custom_recipe.log` file to verify if the operation was successful.*
- Once the above script was executed successfully, custom recipes and python dependencies will be installed in the
`dai-VERSION/<data_directory>/<user>/contrib` directory,
where `<data_directory>` is `tmp` by default.
6.Once the script has been executed successfully, custom recipes and Python dependencies will be installed in the `dai-VERSION/<data_directory>/<user>/contrib` directory, where `<data_directory>` is `tmp` by default.
- Zip the `dai-VERSION/tmp/contrib` directory and move it to the air-gapped machine and unzip there into the DAI `tmp` directory.
```
cd dai-VERSION/`<data_directory>`/
zip -r user_contrib.zip `<user>`/contrib
scp user_contrib.zip `<remote_user>`@`<remote_system>`:`<path to data_directory on remote system>`
```
- Now in the **Air-gapped Machine**, unzip the file and set permissions if necessary, e.g.
```
cd `<dai data_directory>`
unzip user_contrib.zip
chmod -R u+rwx dai:dai `<user>`/contrib
```
7. Zip the `dai-VERSION/tmp/contrib` directory and move it to the air-gapped machine. Unzip it into the DAI `tmp` directory:
```
cd dai-VERSION/`<data_directory>`/
zip -r user_contrib.zip `<user>`/contrib
scp user_contrib.zip `<remote_user>`@`<remote_system>`:`<path to data_directory on remote system>`
```
8. Now, on the **Air-Gapped Machine**, unzip the file and set permissions if necessary:
```
cd <dai data_directory>
unzip user_contrib.zip
chmod -R u+rwx dai:dai <user>/contrib
```

0 comments on commit 3fccd65

Please sign in to comment.