mirror of
https://github.com/compute-blade-community/compute-blade-agent.git
synced 2026-04-21 17:45:43 +02:00
fix: correct package name from computeblade-agent to compute-blade-agent (#47)
* fix: correct package name from computeblade-agent to compute-blade-agent * fix: update autoinstall script to use correct GitHub repository format and improve error handling --------- Co-authored-by: Matthias Duve <morzan1001@mail.runforest.run>
This commit is contained in:
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
id: release-please
|
||||
with:
|
||||
release-type: simple # actual releasing is handled by goreleaser
|
||||
package-name: computeblade-agent
|
||||
package-name: compute-blade-agent
|
||||
outputs:
|
||||
release_created: ${{ steps.release-please.outputs.release_created }}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Default configuration for the computeblade-agent
|
||||
# Default configuration for the compute-blade-agent
|
||||
|
||||
log:
|
||||
mode: production # production, development
|
||||
@@ -6,7 +6,7 @@ log:
|
||||
# Listen configuration
|
||||
listen:
|
||||
metrics: ":9666"
|
||||
grpc: /tmp/computeblade-agent.sock
|
||||
grpc: /tmp/compute-blade-agent.sock
|
||||
|
||||
# Hardware abstraction layer configuration
|
||||
hal:
|
||||
|
||||
@@ -34,7 +34,7 @@ func main() {
|
||||
viper.AutomaticEnv()
|
||||
viper.SetConfigName("config")
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath("/etc/computeblade-agent")
|
||||
viper.AddConfigPath("/etc/compute-blade-agent")
|
||||
|
||||
// Load potential file configs
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
@@ -52,7 +52,7 @@ func main() {
|
||||
panic(fmt.Errorf("invalid log.mode: %s", logMode))
|
||||
}
|
||||
|
||||
zapLogger := baseLogger.With(zap.String("app", "computeblade-agent"))
|
||||
zapLogger := baseLogger.With(zap.String("app", "compute-blade-agent"))
|
||||
defer func() {
|
||||
_ = zapLogger.Sync()
|
||||
}()
|
||||
@@ -84,7 +84,7 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
log.FromContext(ctx).Info("Bootstrapping computeblade-agent", zap.String("version", viper.GetString("version")))
|
||||
log.FromContext(ctx).Info("Bootstrapping compute-blade-agent", zap.String("version", viper.GetString("version")))
|
||||
computebladeAgent, err := agent.NewComputeBladeAgent(ctx, cbAgentConfig)
|
||||
if err != nil {
|
||||
log.FromContext(ctx).Error("Failed to create agent", zap.Error(err))
|
||||
|
||||
@@ -40,7 +40,7 @@ func runIdentity(cmd *cobra.Command, _ []string) error {
|
||||
event = bladeapiv1alpha1.Event_IDENTIFY_CONFIRM
|
||||
}
|
||||
|
||||
// Emit the event to the computeblade-agent
|
||||
// Emit the event to the compute-blade-agent
|
||||
_, err = client.EmitEvent(ctx, &bladeapiv1alpha1.EmitEventRequest{Event: event})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -29,7 +29,7 @@ var (
|
||||
|
||||
func init() {
|
||||
rootCmd.PersistentFlags().
|
||||
StringVar(&grpcAddr, "addr", "unix:///tmp/computeblade-agent.sock", "address of the computeblade-agent gRPC server")
|
||||
StringVar(&grpcAddr, "addr", "unix:///tmp/compute-blade-agent.sock", "address of the compute-blade-agent gRPC server")
|
||||
rootCmd.PersistentFlags().DurationVar(&timeout, "timeout", time.Minute, "timeout for gRPC requests")
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func clientFromContext(ctx context.Context) bladeapiv1alpha1.BladeAgentServiceCl
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "bladectl",
|
||||
Short: "bladectl interacts with the computeblade-agent and allows you to manage hardware-features of your compute blade(s)",
|
||||
Short: "bladectl interacts with the compute-blade-agent and allows you to manage hardware-features of your compute blade(s)",
|
||||
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
|
||||
origCtx := cmd.Context()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ set -eu
|
||||
tmp_dir=$(mktemp -d)
|
||||
trap 'rm -rf "$tmp_dir"' EXIT
|
||||
|
||||
# Function to detect the Linux package manager
|
||||
# Function to detect the package suffix based on the available package manager
|
||||
detect_package_suffix() {
|
||||
if [ -x "$(command -v dpkg)" ]; then
|
||||
echo "deb"
|
||||
@@ -25,12 +25,15 @@ get_latest_release() {
|
||||
curl -s "https://api.github.com/repos/$repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
|
||||
}
|
||||
|
||||
github_repo="github.com/uptime-industries/compute-blade-agent"
|
||||
github_repo="uptime-industries/compute-blade-agent"
|
||||
package_suffix=$(detect_package_suffix)
|
||||
latest_release=$(get_latest_release "$github_repo")
|
||||
|
||||
# Create a temporary directory for the download
|
||||
tmp_dir=$(mktemp -d)
|
||||
|
||||
# Construct the download URL and filename based on the detected package manager and latest release
|
||||
download_url="https://github.com/$github_repo/releases/download/$latest_release/${github_repo##*/}_${latest_release#v}_linux_arm64.$package_suffix"
|
||||
download_url="https://github.com/$github_repo/releases/download/$latest_release/compute-blade-agent_${latest_release#v}_linux_arm64.$package_suffix"
|
||||
target_file="$tmp_dir/compute-blade-agent.$package_suffix"
|
||||
|
||||
# Download the package
|
||||
@@ -49,6 +52,10 @@ case "$package_suffix" in
|
||||
pkg.tar.zst)
|
||||
sudo pacman -U --noconfirm "$target_file"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported package format" >> /dev/stderr
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Enable and start the service
|
||||
|
||||
@@ -5,7 +5,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
ExecStart=/usr/bin/computeblade-agent
|
||||
ExecStart=/usr/bin/compute-blade-agent
|
||||
TimeoutStopSec=20s
|
||||
|
||||
[Install]
|
||||
|
||||
Reference in New Issue
Block a user