Skip to content
Merged
Show file tree
Hide file tree
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
51 changes: 51 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test Action

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:

env:
BL_ENV: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}
BL_WORKSPACE: ${{ vars.BL_WORKSPACE }}
BL_API_KEY: ${{ secrets.BL_API_KEY }}

jobs:
test-action:
environment: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test bl-action
uses: ./ # This references the action in the current repo
with:
workspace: ${{ vars.BL_WORKSPACE }}
apikey: ${{ secrets.BL_API_KEY }}
- name: List agents
run: bl get agents
- name: List functions
run: bl get functions
- name: List models
run: bl get models
- name: List sandboxes
run: bl get sandboxes

test-matrix:
runs-on: ${{ matrix.os }}
environment: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test on ${{ matrix.os }}
uses: ./
with:
workspace: ${{ vars.BL_WORKSPACE }}
apikey: ${{ secrets.BL_API_KEY }}
32 changes: 0 additions & 32 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ Contributions are welcome! Please open an issue or submit a pull request for any

## Support

For any questions or issues, please open an issue in this repository.
For any questions or issues, please open an issue in this repository.
110 changes: 107 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,122 @@ inputs:
runs:
using: "composite"
steps:
- name: Checkout toolkit repository
uses: actions/checkout@v4
with:
repository: blaxel-ai/toolkit
path: .bl-toolkit
clean: false
- name: Install blaxel
shell: bash
run: |
mkdir -p $HOME/.local/bin

if [ "$BL_ENV" = "dev" ]; then
curl -fsSL https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh | BINDIR=$HOME/.local/bin sh
# Function to download with multiple fallback methods
download_with_fallbacks() {
local repo=$1
local path=$2
local output_file=$3
local max_attempts=3

echo "Downloading installation script..."

# Method 1: Use locally checked out file (most reliable)
if [ -f ".bl-toolkit/$path" ]; then
echo "Using locally checked out installation script..."
cp ".bl-toolkit/$path" "$output_file"
echo "✓ Using local checkout"
return 0
fi

# Method 2: GitHub API (fallback)
echo "Trying GitHub API..."
if curl -fsSL \
--connect-timeout 30 \
--max-time 300 \
-H "Accept: application/vnd.github.v3.raw" \
-H "User-Agent: bl-action" \
"https://api.github.com/repos/$repo/contents/$path" \
-o "$output_file" 2>/dev/null; then
echo "✓ Downloaded via GitHub API"
return 0
fi

# Method 3: raw.githubusercontent.com with explicit TLS
echo "Trying raw.githubusercontent.com with TLS 1.2..."
if curl -fsSL \
--connect-timeout 30 \
--max-time 300 \
--tlsv1.2 \
-H "User-Agent: bl-action" \
"https://raw.githubusercontent.com/$repo/main/$path" \
-o "$output_file" 2>/dev/null; then
echo "✓ Downloaded via raw.githubusercontent.com"
return 0
fi

# Method 4: wget with different user agent
echo "Trying wget..."
if command -v wget >/dev/null 2>&1; then
if wget --secure-protocol=TLSv1_2 \
--timeout=30 \
--tries=1 \
--user-agent="bl-action" \
-O "$output_file" \
"https://raw.githubusercontent.com/$repo/main/$path" 2>/dev/null; then
echo "✓ Downloaded via wget"
return 0
fi
fi

# Method 5: GitHub tarball extraction (last resort)
echo "Trying GitHub tarball extraction..."
local temp_dir="/tmp/bl-install-$$"
mkdir -p "$temp_dir"

if curl -fsSL \
--connect-timeout 30 \
--max-time 300 \
-H "User-Agent: bl-action" \
"https://api.github.com/repos/$repo/tarball/main" | \
tar -xz -C "$temp_dir" --strip-components=1 2>/dev/null; then

if [ -f "$temp_dir/$path" ]; then
cp "$temp_dir/$path" "$output_file"
rm -rf "$temp_dir"
echo "✓ Downloaded via tarball extraction"
return 0
fi
fi

rm -rf "$temp_dir"
return 1
}

# Download the installation script with fallback methods
INSTALL_SCRIPT="/tmp/install.sh"

if download_with_fallbacks "blaxel-ai/toolkit" "install.sh" "$INSTALL_SCRIPT"; then
chmod +x "$INSTALL_SCRIPT"
BINDIR=$HOME/.local/bin sh "$INSTALL_SCRIPT"
else
curl -fsSL https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh | BINDIR=$HOME/.local/bin sh
echo "Error: Failed to download installation script with all methods"
echo "Please check your network connection and GitHub access"
exit 1
fi

# Verify installation
if [ ! -f "$HOME/.local/bin/blaxel" ]; then
echo "Error: blaxel installation failed"
exit 1
fi

# Create symlink and add to PATH
cp $HOME/.local/bin/blaxel $HOME/.local/bin/bl
echo "$HOME/.local/bin" >> $GITHUB_PATH

# Clean up checkout
rm -rf .bl-toolkit
- name: Login to Blaxel
shell: bash
env:
Expand Down

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions blaxel/0-integration-connection/hf-beamlit-organization.yml

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions blaxel/0-integration-connection/xai-beamlit-organization.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions blaxel/0-policies/eu-and-na.yml

This file was deleted.

10 changes: 0 additions & 10 deletions blaxel/0-policies/only-eu.yml

This file was deleted.

11 changes: 0 additions & 11 deletions blaxel/0-policies/only-us.yml

This file was deleted.

14 changes: 0 additions & 14 deletions blaxel/1-models/all-minilm-l6-v2.yml

This file was deleted.

13 changes: 0 additions & 13 deletions blaxel/1-models/claude-35-sonnet.yml

This file was deleted.

13 changes: 0 additions & 13 deletions blaxel/1-models/gpt-4o-mini.yml

This file was deleted.

13 changes: 0 additions & 13 deletions blaxel/1-models/ministral-3b-2410.yml

This file was deleted.

13 changes: 0 additions & 13 deletions blaxel/2-functions/github.yml

This file was deleted.

9 changes: 0 additions & 9 deletions blaxel/2-functions/math.yml

This file was deleted.

Loading