make the install script more robust

This commit is contained in:
mkagenius
2025-12-10 22:26:26 +05:30
parent 45d52fb5eb
commit 269f75f16e
2 changed files with 61 additions and 30 deletions
+6 -6
View File
@@ -5,11 +5,11 @@
</div>
```
___ ____ _____ _ _ ____ _ _____ _ _ ____
/ _ \| _ \| ____| \ | | / ___|| |/ /_ _| | | | / ___|
| | | | |_) | _| | \| | \___ \| ' / | || | | | \___ \
| |_| | __/| |___| |\ | ___) | . \ | || |___| |___ ___) |
\___/|_| |_____|_| \_| |____/|_|\_\___|_____|_____|____/
___ ____ _____ _ _ ____ _ _____ _ _ ____
/ _ \| _ \| ____| \ | | / ___|| |/ /_ _| | | | / ___|
| | | | |_) | _| | \| | \___ \| ' / | || | | | \___ \
| |_| | __/| |___| |\ | ___) | . \ | || |___| |___ ___) |
\___/|_| |_____|_| \_| |____/|_|\_\___|_____|_____|____/
```
@@ -43,7 +43,7 @@ Watch Open-Skills in action with Gemini CLI:
git clone https://github.com/BandarLabs/open-skills.git
cd open-skills
chmod +x install.sh
sudo ./install.sh
./install.sh
```
Installation takes ~2 minutes. The MCP server will be available at `http://open-skills.local:8222/mcp`
+55 -24
View File
@@ -2,21 +2,22 @@
# Function to get current macOS version
get_macos_version() {
sw_vers -productVersion | awk -F. '{print $1 "." $2}'
sw_vers -productVersion | awk -F. '{print $1 "." $2}'
}
# Check the system type
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "❌ This script is intended for macOS systems only. Exiting."
exit 1
echo "❌ This script is intended for macOS systems only. Exiting."
exit 1
fi
# Check macOS version
macos_version=$(get_macos_version)
if (( $(echo "$macos_version < 26.0" | bc -l) )); then
echo "Warning: Your macOS version is $macos_version. Version 26.0 or later is recommended. Some features of 'container' might not work properly."
echo "Warning: Your macOS version is $macos_version. Version 26.0 or later is recommended. Some features of 'container'
might not work properly."
else
echo "✅ macOS system detected."
echo "✅ macOS system detected."
fi
download_url="https://github.com/apple/container/releases/download/0.5.0/container-0.5.0-installer-signed.pkg"
@@ -36,6 +37,7 @@ then
fi
echo "Stopping any running Apple 'container' processes..."
container system stop 2>/dev/null || true
else
echo "Apple 'container' tool not detected. Proceeding with installation..."
@@ -47,40 +49,69 @@ else
sudo installer -pkg container-installer.pkg -target /
fi
echo "Starting the Sandbox Container..."
container system start
# Stop any existing container system to clean up stale connections
echo "Stopping any existing container system..."
container system stop 2>/dev/null || true
# Wait a moment for cleanup
sleep 2
# Start the container system (this is blocking and will wait for kernel download if needed)
echo "Starting the Sandbox Container system (this may take a few minutes if downloading kernel)..."
if ! container system start; then
echo "❌ Failed to start container system."
exit 1
fi
# Quick verification that system is ready
echo "Verifying container system is ready..."
if container system status &>/dev/null; then
echo "✅ Container system is ready."
else
echo "❌ Container system started but status check failed."
echo "Try running: container system stop && container system start"
exit 1
fi
echo "Setting up local network domain..."
# Run the commands for setting up the local network
echo "Running: sudo container system dns create local"
sudo container system dns create local
sudo container system dns create local 2>/dev/null || echo "DNS domain 'local' already exists (this is fine)"
echo "Running: container system dns default set local"
echo "Running: container system property set dns.domain local"
container system property set dns.domain local
echo "Starting the Sandbox Container..."
container system start
echo "Pulling the latest image: instavm/open-skills"
container image pull instavm/open-skills
if ! container image pull instavm/open-skills; then
echo "❌ Failed to pull image. Please check your internet connection and try again."
exit 1
fi
echo "→ Ensuring open-skills assets directories…"
ASSETS_SRC="$HOME/.open-skills/assets"
mkdir -p "$ASSETS_SRC/skills/user"
mkdir -p "$ASSETS_SRC/outputs"
# Stop any existing open-skills container
echo "Stopping any existing open-skills container..."
container stop open-skills 2>/dev/null || true
sleep 2
# Run the command to start the sandbox container
echo "Running: container run --name open-skills --detach --rm --cpus 8 --memory 4g instavm/open-skills"
container run \
--volume "$ASSETS_SRC/skills/user:/app/uploads/skills/user" \
--volume "$ASSETS_SRC/outputs:/app/uploads/outputs" \
--name open-skills \
--detach \
--rm \
--cpus 8 \
--memory 4g \
instavm/open-skills
echo "✅ Setup complete. MCP server is available at http://open-skills.local:8222/mcp"
if container run \
--volume "$ASSETS_SRC/skills/user:/app/uploads/skills/user" \
--volume "$ASSETS_SRC/outputs:/app/uploads/outputs" \
--name open-skills \
--detach \
--rm \
--cpus 8 \
--memory 4g \
instavm/open-skills; then
echo "✅ Setup complete. MCP server is available at http://open-skills.local:8222/mcp"
else
echo "❌ Failed to start open-skills container. Please check the logs with: container logs open-skills"
exit 1
fi