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

installing the RHEL-AI api-server via script #492

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gregory-Pereira
Copy link
Collaborator

cc @nerdalert and @vishnoianil, will need to start testing this on a RHEL-AI box

Copy link
Member

@nerdalert nerdalert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts back. Will approve it and you can add the requested changes on a followup or just push it to this since its net new code.

shell-check is failing as well before you merge.

I think we should add the ability to download the binary instead of the user having to build it. I'd rather not have to install go etc and reboot etc. We can figure out where to host it etc. Ty!


git clone https://github.com/instructlab/ui.git /tmp
cd /tmp/ui/api-server
go mod download
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets build it here plx:

go build -o ilab-api-router


### installations

rpm-ostree install gcc glibc-devel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pop a sudo in front of the rpm-ostree.

sudo rpm-ostree install gcc glibc-devel

Can we test if those are already installed? rpm-ostree will throw an exit 1 if the package is already installed.


rpm-ostree install gcc glibc-devel
systemctl reboot
export CGO_ENABLED=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console a message that the system needs to reboot and to re-run the script after it boots.

exit 1
else
if [ ! -d "$TAXONOMY_PATH"]; then
echo "\$TAXONOMY_PATH was set as $TAXONOMY_PATH, but path does not exist."
Copy link
Member

@nerdalert nerdalert Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's set the default taxonomy ENV in the script to $HOME/.local/share/instructlab/taxonomy/. If that path doesn't exist then prompt the user etc. They can override the default if they define one but Im not really worried about any other path than the default atm. We can set it in the api-server as a default as well as needed for simplicity.

exit 1
fi

if [ -z $(command -v go) ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add a section/function to install go for the user. We don't want them having to figure that out if we aren't providing a binary to download. I tested this on rhel ai.

Here is a quick script you can crib from:

#!/bin/bash

set -e

GO_VERSION="1.23.5"
GO_ARCHIVE="go${GO_VERSION}.linux-amd64.tar.gz"
GO_URL="https://go.dev/dl/${GO_ARCHIVE}"
INSTALL_DIR="$HOME/.go"
PATH_EXPORT="export PATH=\$PATH:${INSTALL_DIR}/bin"

# Check if Go is already installed
if command -v go >/dev/null 2>&1; then
    echo "Go is already installed: $(go version)"
    exit 0
fi

for cmd in curl tar; do
    if ! command -v "$cmd" >/dev/null 2>&1; then
        echo "Error: '$cmd' is not installed. Please install it and retry."
        exit 1
    fi
done

echo "Downloading Go ${GO_VERSION}..."
curl -LO "$GO_URL"

mkdir -p "$INSTALL_DIR"

tar --strip-components=1 -C "$INSTALL_DIR" -xzf "$GO_ARCHIVE"

rm "$GO_ARCHIVE"

# Export PATH in current shell
export PATH="$PATH:${INSTALL_DIR}/bin"
echo "Go bin directory added to PATH for the current session."

# Add PATH export to ~/.bashrc if not already present
grep -qxF "$PATH_EXPORT" "$HOME/.bashrc" || echo "$PATH_EXPORT" >> "$HOME/.bashrc"
echo "Go bin directory added to PATH in ~/.bashrc."

# Verify
go version

fi

# go run main.go --taxonomy-path ~/.local/share/instructlab/taxonomy/ --rhelai
go run main.go --taxonomy-path $TAXONOMY_PATH --rhelai $CUDA_FLAG
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pop in --vllm. There is support for llama-cpp. It is currently the default and should probably be flipped but it doesn't hurt to make it explicit either way ¯\(ツ)

./ilab-api-router  --taxonomy-path /var/home/cloud-user/.local/share/instructlab/taxonomy/ --cuda --rhelai --vllm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants