create installation bundle

This commit is contained in:
2026-01-16 11:00:09 +00:00
parent 6f595775c4
commit 94e565257d
4 changed files with 1046 additions and 0 deletions

209
installer/airgap/README.md Normal file
View File

@@ -0,0 +1,209 @@
# Calypso Appliance - Airgap Deployment Bundle
## Overview
Airgap deployment bundle memungkinkan instalasi Calypso Appliance tanpa koneksi internet. Semua komponen (binaries, dependencies, configs, services) di-bundle dalam satu archive yang bisa di-deploy ke mesin target.
## Struktur Bundle
```
calypso-appliance-1.0.0-airgap/
├── install-airgap.sh # Main installer script
├── README.md # Documentation
├── binaries/
│ └── calypso-api # Pre-built backend binary
├── frontend/ # Built frontend assets
├── packages/
│ ├── package-list.txt # List of required packages (58 packages)
│ ├── debs/ # Pre-downloaded DEB packages (~200-300 packages)
│ ├── downloaded-packages.txt # List of successfully downloaded packages
│ └── missing-packages.txt # List of packages that couldn't be downloaded
├── scripts/ # Installation scripts
├── services/ # Systemd service files
├── migrations/ # Database migration files
├── configs/ # Configuration templates
└── third_party/
├── download-binaries.sh # Script to download Go/Node.js
├── go.tar.gz # (Optional) Go binary
└── nodejs.tar.xz # (Optional) Node.js binary
```
## Membuat Bundle
### 1. Build Bundle (Di Mesin dengan Internet)
```bash
cd /src/calypso
./installer/airgap/create-bundle.sh --version 1.0.0
```
Ini akan:
- Download semua 59 packages + dependencies (~200-300 packages)
- Build backend binary (Go)
- Build frontend (React)
- Bundle semua scripts, configs, services
- Create installer script
- Create archive: `dist/airgap/calypso-appliance-1.0.0-airgap.tar.gz`
### 2. Download Third-Party Binaries (Opsional)
Untuk fully offline, download Go dan Node.js binaries:
```bash
cd dist/airgap/calypso-appliance-1.0.0-airgap
./third_party/download-binaries.sh
```
### 3. Verify Bundle
```bash
# Check bundle integrity
sha256sum -c calypso-appliance-1.0.0-airgap.tar.gz.sha256
# List contents
tar -tzf calypso-appliance-1.0.0-airgap.tar.gz | head -20
# Check package count
tar -xzf calypso-appliance-1.0.0-airgap.tar.gz
ls -1 calypso-appliance-1.0.0-airgap/packages/debs/*.deb | wc -l
```
## Deployment ke Target Machine
### Step 1: Transfer Bundle
```bash
# Copy bundle to target machine (via USB, network share, etc.)
scp calypso-appliance-1.0.0-airgap.tar.gz user@target-machine:/tmp/
```
### Step 2: Extract dan Install
```bash
# On target machine
cd /tmp
tar -xzf calypso-appliance-1.0.0-airgap.tar.gz
cd calypso-appliance-1.0.0-airgap
# Run installer
sudo ./install-airgap.sh
```
## Package List
Bundle ini mencakup **58 packages REQUIRED**:
- **Base Tools** (15): build-essential, curl, wget, git, dll
- **PostgreSQL** (4): postgresql, postgresql-contrib, dll
- **Storage Tools** (7): lvm2, xfsprogs, thin-provisioning-tools, dll
- **ZFS** (2): zfsutils-linux, zfs-dkms
- **Tape Tools** (4): lsscsi, sg3-utils, mtx, dll
- **iSCSI** (2): iscsitarget-dkms, open-iscsi
- **File Sharing** (4): nfs-kernel-server, samba, dll
- **ClamAV** (4): clamav, clamav-daemon, dll
- **Build Dependencies** (8): linux-headers-generic, dkms, dll
- **Bacula** (4): bacula-common, bacula-sd, dll
- **mhVTL** (2): mhvtl, mhvtl-utils
- **Node.js** (1): nodejs
- **Nginx** (1): nginx
Dengan dependencies, total bisa mencapai **~200-300 packages**.
Lihat `PACKAGE-LIST.md` untuk detail lengkap.
## Kernel Modules Installation
Beberapa komponen memerlukan kernel modules yang harus di-build di target system:
### ZFS
```bash
# Usually available via apt (sudah di-bundle)
# Module akan di-build otomatis saat install zfs-dkms
```
### SCST
```bash
# Requires kernel headers (sudah di-bundle)
# Build from source (if included in bundle)
```
### mhVTL
```bash
# Usually available via apt (sudah di-bundle)
```
## Post-Installation
### 1. Review Configuration
```bash
sudo nano /etc/calypso/calypso.yaml
```
### 2. Setup Database
```bash
sudo -u postgres psql -c "ALTER USER calypso WITH PASSWORD 'your_secure_password';"
```
### 3. Start Services
```bash
sudo systemctl start calypso-api
sudo systemctl enable calypso-api
```
### 4. Verify Installation
```bash
# Check service status
sudo systemctl status calypso-api
# Check API health
curl http://localhost:8080/api/v1/health
```
## Bundle Size Optimization
Untuk mengurangi ukuran bundle:
1. **Exclude source code** - Hanya bundle binaries
2. **Compress binaries** - Gunakan UPX atau strip symbols
3. **Minimize frontend** - Pastikan production build sudah optimized
4. **Optional packages** - Semua sudah required, tidak bisa di-skip
## Troubleshooting
### Issue: Packages tidak terinstall
**Solution:** Check `packages/missing-packages.txt` untuk paket yang tidak ter-download
### Issue: Kernel modules tidak bisa di-load
**Solution:** Pastikan kernel headers terinstall dan sesuai dengan kernel version
### Issue: Database connection failed
**Solution:** Pastikan PostgreSQL running dan password sudah di-set
### Issue: Service tidak start
**Solution:** Check logs: `journalctl -u calypso-api -n 50`
## Security Considerations
1. **Verify bundle integrity** - Selalu check SHA256 checksum
2. **Secure transfer** - Gunakan encrypted transfer (USB encryption, secure network)
3. **Review configs** - Pastikan secrets di-generate dengan secure random
4. **Firewall** - Setup firewall setelah instalasi
5. **Updates** - Plan untuk update mechanism (bundle baru atau patch system)
## Update Process
Untuk update ke versi baru:
1. Build bundle baru dengan versi baru
2. Transfer ke target machine
3. Extract di lokasi berbeda
4. Run installer (akan upgrade existing installation)
5. Migrate data jika diperlukan
## Support
Untuk issues:
- Check installation logs: `/var/log/calypso/install.log`
- Check service logs: `journalctl -u calypso-api`
- Review configuration: `/etc/calypso/calypso.yaml`
- Check package list: `PACKAGE-LIST.md`