Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readme for init.py and init.sh #1528

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions scripts/init/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

# README.md for `init.py`

## Overview
The `init.py` script is designed to automate the process of registering credentials and loading common specifications and images for a Tumblebug server. It can be executed directly or via the `init.sh` script which sets up a Python virtual environment. This script ensures the Tumblebug server is healthy before proceeding and performs several network operations in a secure and managed way.

## Features
- **Health Check**: Verifies that the Tumblebug server is ready to handle requests before proceeding with operations.
- **Credential Registration**: Dynamically registers all valid credentials stored in a YAML file to the Tumblebug server.
- **Resource Loading**: Initiates the loading of common specs and images into Tumblebug.

## Prerequisites
- Python 3.x installed
- Python packages listed in `requirements.txt`
- The `python3-venv` package should be installed for running the script using `init.sh`.

## Usage
### Direct Execution
```bash
pip3 install -r requirements.txt
```

```bash
python3 init.py
```

- Options: `-y, --yes` (Automatically answer yes to prompts and proceed without manual confirmation)

### Execution via Script
```bash
init.sh
```
- Options: `-y, --yes` (Automatically answer yes to prompts and proceed without manual confirmation)

## Configuration
Before running the script, ensure the following environment variables are set according to your Tumblebug server configuration:
- `TUMBLEBUG_SERVER`: The address of the Tumblebug server.
- `API_USERNAME`: Username for API authentication.
- `API_PASSWORD`: Password for API authentication.


## Related Files
- `init.py`: Main Python script.
- `requirements.txt`: Contains all Python dependencies.
- `init.sh`: Bash script for setting up a Python virtual environment and running `init.py`.
- `credentials.yaml`: Contains the credentials data to be registered with the Tumblebug server.