Skip to content

Commit

Permalink
Update CUDA build script to not tag pre-releases as latest
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Jul 26, 2024
1 parent fd738fa commit 9861c43
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions docker/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ cd "$(dirname "$0")/.."

. versions

livebook_version="$(cat mix.exs | grep '@version "' | grep -v '\-dev' | grep -oE '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}' || true)"
livebook_version="$(cat mix.exs | grep '@version "' | grep -o '".*"' | tr -d '"')"

if [ -z "$livebook_version" ]; then
echo "No stable Livebook version detected"
if [ -z "$livebook_version" ] || [[ "$livebook_version" == *"dev"* ]]; then
echo "No releasable Livebook version detected"
exit 1
fi

if [[ "$livebook_version" == *"-"* ]]; then
stable=false
else
stable=true
fi

cuda_tag_list=("cuda11.8" "cuda12.1")
cuda_version_list=("11-8" "12-1")

Expand Down Expand Up @@ -48,10 +54,16 @@ for idx in "${!cuda_tag_list[@]}"; do
else
echo "Building image: $image"

extra_args=""

if [[ "$stable" == "true" ]]; then
extra_args="-t ghcr.io/livebook-dev/livebook:latest-$cuda_tag"
fi

docker buildx build --push --platform linux/amd64,linux/arm64 \
--build-arg BASE_IMAGE="$base_image" \
-t $image \
-t ghcr.io/livebook-dev/livebook:latest-$cuda_tag \
$extra_args \
.
fi
done

0 comments on commit 9861c43

Please sign in to comment.