Skip to content
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

Add krew-release workflow. #39

Merged
merged 1 commit into from
Jan 17, 2025
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
11 changes: 11 additions & 0 deletions .github/workflows/krew-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
release:
types: [released]
jobs:
krew-release:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update new version in krew-index
uses: rajatjindal/[email protected]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ go.work

# Directory with CRDs for dependencies
dep-crds

kjob.yaml
38 changes: 38 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: kjob
spec:
version: {{ .TagName }}
shortDescription: Run AI/ML jobs based on the pre-defined templates
homepage: https://github.com/kubernetes-sigs/kjob/
description: |
This kubectl plugin allows ML researchers to run templated Jobs with different values
for the application-specific parameters, without the need to edit and submit entire
YAML files. The tool comes with built-in support for running slurm scripts inside
a Kubernetes cluster.
platforms:
- selector:
matchLabels:
os: "linux"
arch: "amd64"
{{addURIAndSha "https://github.com/kubernetes-sigs/kjob/releases/download/{{ .TagName }}/kubectl-kjob-linux-amd64.tar.gz" .TagName }}
bin: "kubectl-kjob"
- selector:
matchLabels:
os: "linux"
arch: "arm64"
{{addURIAndSha "https://github.com/kubernetes-sigs/kjob/releases/download/{{ .TagName }}/kubectl-kjob-linux-arm64.tar.gz" .TagName }}
bin: "kubectl-kjob"
- selector:
matchLabels:
os: "darwin"
arch: "amd64"
{{addURIAndSha "https://github.com/kubernetes-sigs/kjob/releases/download/{{ .TagName }}/kubectl-kjob-darwin-amd64.tar.gz" .TagName }}
bin: "kubectl-kjob"
- selector:
matchLabels:
os: "darwin"
arch: "arm64"
{{addURIAndSha "https://github.com/kubernetes-sigs/kjob/releases/download/{{ .TagName }}/kubectl-kjob-darwin-arm64.tar.gz" .TagName }}
bin: "kubectl-kjob"
25 changes: 25 additions & 0 deletions hack/generate_krew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Copyright 2025 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

# Resolve the absolute path of the directory containing the script
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
REPO_ROOT="$SCRIPT_DIR/.."

docker run --rm -v "$REPO_ROOT":/home/app ghcr.io/rajatjindal/krew-release-bot:v0.0.46 krew-release-bot template --tag "$1" --template-file .krew.yaml > "$REPO_ROOT"/kjob.yaml