Last active
April 29, 2024 08:54
-
-
Save inureyes/bcda7fa8607f98159a63d5c21ec1c3ef to your computer and use it in GitHub Desktop.
Backend.AI 24.03 single machine installation on Ubuntu (package install)
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
# Install docker | |
sudo apt update | |
sudo install -m 0755 -d /etc/apt/keyrings | |
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
sudo chmod a+r /etc/apt/keyrings/docker.asc | |
# Add the repository to Apt sources: | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt update | |
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
sudo mkdir -p /usr/local/backendai | |
current_user=$(whoami) | |
sudo chown $current_user /usr/local/backendai | |
cd ~ | |
arch=$(dpkg --print-architecture) | |
case $arch in | |
arm64) | |
INSTALLER_ARCH="aarch64" | |
;; | |
amd64) | |
INSTALLER_ARCH="x86_64" | |
;; | |
*) | |
INSTALLER_ARCH="" | |
;; | |
esac | |
curl -sLO https://github.com/lablup/backend.ai/releases/download/24.03.2/backendai-install-linux-$INSTALLER_ARCH | |
chmod 755 ./backendai-install-linux-$INSTALLER_ARCH | |
./backendai-install-linux-$INSTALLER_ARCH --skip-sslcert-validation install --mode PACKAGE --target-path --headless /usr/local/backendai | |
# fallback routine. Resolved | |
#mv ~/backendai/* /usr/local/backendai/ | |
USER_ID=$(id -u) | |
GROUP_ID=$(id -g) | |
for BAI_SERVICE_NAME in manager agent webserver storage-proxy local-proxy | |
do | |
case $BAI_SERVICE_NAME in | |
manager) | |
EXEC_SCRIPT="manager mgr" | |
;; | |
agent) | |
EXEC_SCRIPT="agent ag" | |
;; | |
webserver) | |
EXEC_SCRIPT="webserver web" | |
;; | |
storage-proxy) | |
EXEC_SCRIPT="storage-proxy storage" | |
;; | |
local-proxy) | |
EXEC_SCRIPT="local-proxy" | |
;; | |
*) | |
EXEC_SCRIPT="" | |
;; | |
esac | |
cat <<- EOF | sudo tee /etc/systemd/system/backendai-$BAI_SERVICE_NAME.service > /dev/null | |
[Unit] | |
Description= Backend.AI $BAI_SERVICE_NAME service | |
Requires=network.target | |
After=network.target remote-fs.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/backendai/backendai-$EXEC_SCRIPT start-server | |
PIDFile=/usr/local/backendai/$BAI_SERVICE_NAME.pid | |
User=$USER_ID | |
Group=$GROUP_ID | |
WorkingDirectory=/usr/local/backendai | |
TimeoutStopSec=5 | |
KillMode=process | |
KillSignal=SIGTERM | |
PrivateTmp=false | |
Restart=on-failure | |
RestartSec=10 | |
LimitNOFILE=5242880 | |
LimitNPROC=131072 | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
done | |
sudo systemctl start backendai-manager | |
sudo systemctl start backendai-agent | |
sudo systemctl start backendai-storage-proxy | |
sudo systemctl start backendai-webserver | |
sudo systemctl start backendai-local-proxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment