This guide provides step-by-step instructions for Testing of Habitat 2.0 RC builds with on-prem-builder. It covers the complete testing workflow from infrastructure setup to custom package development.
Before starting the testing, ensure you have:
- Linux x86_64 system (minimum: 2 CPUs, 4GB RAM, 100GB disk)
- Valid Progress Chef license key for Habitat 2.0
- Public builder authentication token
- OAuth provider configured (GitHub, Azure AD, etc.)
- Network connectivity to bldr.habitat.sh
Architectures:
x86_64-linux(Intel/AMD 64-bit Linux)aarch64-linux(ARM64 Linux)x86_64-windows(Intel/AMD 64-bit Windows)
Channels:
base- Core packages for Habitat 2.0hab-2-rc2- Chef-specific Habitat 2.0 RC packagesstable- Habitat 1.x packages (for upgrade testing)
Objective: Setup a standard Habitat on-prem instance on linux-x86_64
| Component | Minimum | Recommended |
|---|---|---|
| CPUs | 2 | 4+ |
| RAM | 4GB | 8GB+ |
| Disk | 50GB | 100GB+ |
| OS | Linux x86_64 with systemd | Ubuntu 20.04+ or RHEL 8+ |
Reference: Detailed system requirements
git clone https://github.com/habitat-sh/on-prem-builder.git
cd on-prem-builderBefore installation, setup a 3rd-party OAuth provider for authentication:
Reference: OAuth setup guide
Supported providers: GitHub, Azure AD, GitLab, Okta, Bitbucket
cp bldr.env.sample bldr.env
# Edit bldr.env with your OAuth and system configuration
# Also add your HAB_AUTH_TOKEN for public builder📖 Reference: Configuration guide
./install.shCheck that all services are running:
sudo hab svc statusExpected output: 5 services should be UP:
habitat/builder-apihabitat/builder-datastorehabitat/builder-memcachedhabitat/builder-api-proxyhabitat/builder-minio
Objective: Use sync tool to sync base core packages and hab-2-rc2 chef packages from SaaS to the on-prem instance
Create a personal access token for your on-prem builder:
📖 Reference: Create personal access token
sudo hab pkg install habitat/pkg-syncThe habitat packages are now built with updated dependencies from the base channel instead of the stable channel.
Some of these package dependencies include native packages.
In order for an on-prem builder instance to host the latest released habitat packages including these native package dependencies,
that builder instance must be configured to allow native package support.
This is done by enabling the nativepackages feature and specifying core as an allowed native package origin.
To do this, an on-prem builder's /hab/user/builder-api/config/user.toml file should be edited so that the [api] section looks as follows:
[api]
features_enabled = "nativepackages"
targets = ["x86_64-linux", "aarch64-linux", "x86_64-windows"]
allowed_native_package_origins = ["core"]hab pkg exec habitat/pkg-sync pkg-sync \
--bldr-url <ON_PREM_BUILDER_URL> \
--channel base \
--origin core \
--public-builder-token <PUBLIC_TOKEN> \
--private-builder-token <PRIVATE_TOKEN>hab pkg exec habitat/pkg-sync pkg-sync \
--bldr-url <ON_PREM_BUILDER_URL> \
--origin chef \
--channel hab-2-rc2 \
--public-builder-token <PUBLIC_TOKEN> \
--private-builder-token <PRIVATE_TOKEN>Check packages in your on-prem builder web UI or via API:
Objective: Setup Hab 2.0 as a new user pointing to the on-prem instance
Current Status: Habitat 2.0 is not yet available in the stable channel. Use the temporary installation method below.
- On-prem builder instance running (from Scenario 1)
- Public builder authentication token with valid license
- Network access to public builder for initial download
Since Habitat 2.0 is not in stable channel yet, install via hab-2-rc2 channel:
Linux:
curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bashWindows: 📖 Reference: Windows Installation Guide
sudo hab pkg install chef/hab -bf -c hab-2-rc2 -z <YOUR_PUBLIC_BLDR_AUTH_TOKEN>Once Habitat 2.0 is available in stable channel:
curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash
hab --version
# Expected: habitat 2.x.xhab --version
# Expected: habitat 2.x.xObjective: Install habitat on a workstation (Linux ARM, x86_64, or Windows) and run Habitat applications
- Workstation system (ARM64, x86_64 Linux, or Windows)
- Network access to on-prem builder
- Authentication token for on-prem builder
Follow the installation steps from Scenario 3 based on your workstation architecture.
📖 Reference: Workstation setup guide
# Point to your on-prem builder
export HAB_BLDR_URL=https://your-builder.example.com
# Set authentication token
export HAB_AUTH_TOKEN=<ON_PREM_BUILDER_TOKEN>
# For self-signed certificates (if applicable)
export SSL_CERT_FILE=/path/to/ssl-certificate.crt# Test installing a package from your on-prem builder
sudo -E hab pkg install core/curl
# Verify installation
hab pkg path core/curlRequirement: "download, install, build a custom hab package/service using base channel deps"
This scenario tests building custom packages with Habitat 2.0 dependencies:
Run the following command on the Workstation
# 1. Create a test plan that uses base dependencies
mkdir test-package
cd test-package
# 2. Create plan.sh with base deps
cat > plan.sh << 'EOF'
pkg_name=test-service
pkg_origin=test
pkg_version="1.0.0"
pkg_maintainer="Test User <test@company.com>"
pkg_license=('Apache-2.0')
pkg_description="Test service for Habitat 2.0 - Cross Platform"
# Cross-platform dependency
pkg_deps=(
core/python
)
# Platform-agnostic service using Python HTTP server
pkg_svc_run="python -m http.server 8080"
do_build() {
return 0
}
do_install() {
return 0
}
EOFexport HAB_ORIGIN=test
# Point to your on-prem builder
export HAB_BLDR_URL=https://your-builder.example.com
# Set authentication token
export HAB_AUTH_TOKEN=<ON_PREM_BUILDER_TOKEN># One time command to generate the public key at ~/.hab/cache/keys
sudo hab origin key generate test
# Build using Habitat 2.0 with base channel
sudo -E hab pkg build .
# Make a note of the hart file generated at the end of the successful build.Custom Builder instances don't auto-create origins. If the origin doesn't already exist, you need to manually create the origin.
sudo -E hab origin create testsudo -E hab pkg upload <HART_FILE>
# Make a note of the CUSTOM_PKG_IDENT that gets uploaded.
# By default, the package gets uploaded onto the unstable channel.Create the hab user:
sudo groupadd hab
sudo useradd -g hab habCreate the systemd service file:
sudo tee /etc/systemd/system/hab-sup.service > /dev/null <<EOF
[Unit]
Description=The Habitat Supervisor
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=$(which hab) sup run
Restart=on-failure
RestartSec=10
KillMode=mixed
KillSignal=SIGINT
TimeoutStartSec=120
TimeoutStopSec=60
Environment=HAB_BLDR_URL=https://your-builder.example.com
[Install]
WantedBy=multi-user.target
EOFEnable and start the service:
# Reload systemd configuration
sudo systemctl daemon-reload
# Enable the service
sudo systemctl enable hab-sup
# Start the service
sudo systemctl start hab-sup
sleep 10
# Verify service is running
sudo systemctl status hab-sup
# Check supervisor is accessible
sudo hab svc status- Linux:
sudo systemctl status hab-supshows active/running - Windows:
Get-Service habitatshows running services
# Load the service
sudo -E hab svc load test/test-service --channel unstable --url https://your-builder.example.comsudo hab svc status shows the custom service up and running.
| Issue | Symptom | Solution |
|---|---|---|
| Channel Not Found | Error: Channel 'base' not found |
• Verify channel exists on public builder • Check license permissions • Ensure token is valid |
| ARM64 Package Missing | Package not available for aarch64-linux |
• Check if package is built for ARM64 • Use alternative package • Report missing package to engineering |
| Authentication Failed | 401 Unauthorized |
• Verify token has correct permissions • Check license key is valid • Regenerate token if needed |
# Check service logs
sudo journalctl -u hab-sup -f