-
Notifications
You must be signed in to change notification settings - Fork 164
chore(BA-2846): Bundle bssh in Backend.AI runner package #6452
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Import bssh binary | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Release tag to download (e.g., v0.1.0). Leave empty for latest." | ||
| required: false | ||
| type: string | ||
| repository_dispatch: | ||
| types: [bssh-release] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| import-binary: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Get release tag | ||
| id: get-tag | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "repository_dispatch" ]; then | ||
| TAG="${{ github.event.client_payload.tag }}" | ||
| elif [ -n "${{ github.event.inputs.tag }}" ]; then | ||
| TAG="${{ github.event.inputs.tag }}" | ||
| else | ||
| # Get latest release tag | ||
| TAG=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/lablup/bssh/releases/latest | jq -r .tag_name) | ||
| fi | ||
| echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
| echo "Using tag: $TAG" | ||
|
|
||
| - name: Download bssh binaries | ||
| run: | | ||
| TAG="${{ steps.get-tag.outputs.tag }}" | ||
| for ARCH in aarch64 x86_64; do | ||
| URL="https://github.com/lablup/bssh/releases/download/${TAG}/bssh-linux-${ARCH}-musl.tar.gz" | ||
| echo "Downloading from: $URL" | ||
| curl -fL -o bssh.tar.gz "$URL" | ||
| tar -xzf bssh.tar.gz | ||
| if [ -f "bssh" ]; then | ||
| mv bssh "bssh.${ARCH}.bin" | ||
| chmod +x "bssh.${ARCH}.bin" | ||
| echo "Binary extracted and renamed to bssh.${ARCH}.bin" | ||
| else | ||
| echo "Error: bssh binary not found in the archive for $ARCH" | ||
| exit 1 | ||
| fi | ||
| rm -f bssh.tar.gz | ||
| done | ||
|
|
||
| - name: Move binaries to target location | ||
| run: | | ||
| TARGET_DIR="src/ai/backend/runner" | ||
| mkdir -p "${TARGET_DIR}" | ||
| # Move executable binaries | ||
| for ARCH in aarch64 x86_64; do | ||
| mv "bssh.${ARCH}.bin" "${TARGET_DIR}/" | ||
| echo "Binary moved to ${TARGET_DIR}/bssh.${ARCH}.bin" | ||
| ls -la "${TARGET_DIR}/bssh.${ARCH}.bin" | ||
| done | ||
| # Move manpages | ||
| mv bssh.1 "${TARGET_DIR}/" | ||
|
|
||
| - name: Add news fragment | ||
| run: | | ||
| echo "Update bssh binaries to ${{ steps.get-tag.outputs.tag }}" > changes/.deps.md | ||
|
|
||
| - name: Create pull request | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| token: ${{ secrets.OCTODOG }} | ||
| commit-message: "chore: Update bssh binaries to ${{ steps.get-tag.outputs.tag }}" | ||
| title: "deps: Update bssh binaries to ${{ steps.get-tag.outputs.tag }}" | ||
| author: "Lablup Octodog <[email protected]>" | ||
| body: | | ||
| This PR updates the bssh binaries (musl variant) for both aarch64 and x86_64 architectures to version ${{ steps.get-tag.outputs.tag }}. | ||
|
|
||
| Source: https://github.com/lablup/bssh/releases/tag/${{ steps.get-tag.outputs.tag }} | ||
|
|
||
| This update was triggered by: | ||
| - Event: ${{ github.event_name }} | ||
| ${{ github.event_name == 'repository_dispatch' && '- Automated trigger from bssh repository release' || '- Manual workflow dispatch' }} | ||
| branch: deps/update-bssh-${{ steps.get-tag.outputs.tag }} | ||
| delete-branch: true | ||
|
|
||
| setup-webhook: | ||
| if: github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Instructions for automated trigger | ||
| run: | | ||
| echo "To enable automated triggers when bssh releases occur:" | ||
| echo "" | ||
| echo "1. Go to https://github.com/lablup/bssh/settings/hooks" | ||
| echo "2. Add a new webhook with:" | ||
| echo " - Payload URL: https://api.github.com/repos/${{ github.repository }}/dispatches" | ||
| echo " - Content type: application/json" | ||
| echo " - Secret: (generate a secure secret)" | ||
| echo " - Events: Select 'Releases'" | ||
| echo "" | ||
| echo "3. Configure the webhook payload:" | ||
| echo ' {' | ||
| echo ' "event_type": "bssh-release",' | ||
| echo ' "client_payload": {' | ||
| echo ' "tag": "{{ .Release.TagName }}"' | ||
| echo ' }' | ||
| echo ' }' | ||
| echo "" | ||
| echo "4. Add a GitHub Personal Access Token with 'repo' scope as a secret" | ||
| echo " in the webhook Authorization header:" | ||
| echo " Authorization: token YOUR_GITHUB_TOKEN" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Bundle bssh as intrinsic binary in Backend.AI runner package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ resources( | |
| ".tmux.conf", | ||
| ".vimrc", | ||
| "all-smi.1", | ||
| "bssh.1", | ||
| "yank.sh", | ||
| "terminfo.alpine3.8/**/*", | ||
| ], | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.