Skip to content

Commit

Permalink
Merge pull request #7 from containers/mac
Browse files Browse the repository at this point in the history
macOS build
  • Loading branch information
rhatdan authored Jul 28, 2024
2 parents 384be54 + 3bbb72e commit 3be60ba
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 34 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: ci
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
on: [push, pull_request]
jobs:
build:
linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run a one-line script
run: ./ci.sh

macos:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Run a one-line script
shell: bash
run: ./ci.sh

25 changes: 16 additions & 9 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,31 @@ main() {
maybe_sudo="sudo"
fi

local os
os="$(uname)"
if ! available autopep8; then
if available apt; then
$maybe_sudo apt install -y python3-autopep8
else
$maybe_sudo dnf install -y python3-autopep8
fi
if [ "$os" = "Linux" ]; then
if available apt; then
$maybe_sudo apt install -y python3-autopep8
else
$maybe_sudo dnf install -y python3-autopep8
fi
fi
fi

./container_build.sh
curl -fsSL https://raw.githubusercontent.com/containers/ramalama/main/install.sh | sudo bash
chmod +x ramalama install.sh
if [ "$os" = "Linux" ]; then
./container_build.sh
$maybe_sudo ./install.sh # todo macos support
autopep8 --exit-code ramalama # Check style is correct
shellcheck -- *.sh
fi

set +o pipefail
chmod +x ramalama
./ramalama -h | grep Usage:
set -o pipefail

./ramalama pull tinyllama
autopep8 --exit-code ramalama # Check style is correct
# ramalama list | grep granite-code
# ramalama rm granite-code
}
Expand Down
18 changes: 0 additions & 18 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@ amd_lshw() {
lshw -c display -numeric -disable network | grep -q 'vendor: .* \[1002\]'
}

gpu_check() {
if available lspci && lspci -d '10de:' | grep -q 'NVIDIA'; then
nvidia_available="true"
elif available lshw && nvidia_lshw; then
nvidia_available="true"
elif available nvidia-smi; then
nvidia_available="true"
fi

if available lspci && lspci -d '1002:' | grep -q 'AMD'; then
amd_available="true"
elif available lshw && amd_lshw; then
amd_available="true"
fi
}

download() {
local curl_cmd=("curl" "--globoff" "--location" "--proto-default" "https")
curl_cmd+=("-o" "$from" "--remote-time" "--retry" "10" "--retry-max-time")
Expand Down Expand Up @@ -68,8 +52,6 @@ main() {
install -D -m755 "$from" "$bindir/"

if false; then # to be done
local nvidia_available="false"
local amd_available="false"
gpu_check
fi
}
Expand Down

0 comments on commit 3be60ba

Please sign in to comment.