Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / openai-triton / prefetch.sh
blobf218718a5cf30d547966b14597a155445b212038
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p nix-prefetch-scripts
4 set -eou pipefail
6 version=$1
8 linux_bucket="https://download.pytorch.org/whl"
10 url_and_key_list=(
11 "x86_64-linux-38 $linux_bucket/triton-${version}-0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp38-cp38-linux_x86_64.whl"
12 "x86_64-linux-39 $linux_bucket/triton-${version}-0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp39-cp39-linux_x86_64.whl"
13 "x86_64-linux-310 $linux_bucket/triton-${version}-0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp310-cp310-linux_x86_64.whl"
14 "x86_64-linux-311 $linux_bucket/triton-${version}-0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp311-cp311-linux_x86_64.whl"
17 hashfile=binary-hashes-"$version".nix
18 echo " \"$version\" = {" >> $hashfile
20 for url_and_key in "${url_and_key_list[@]}"; do
21 key=$(echo "$url_and_key" | cut -d' ' -f1)
22 url=$(echo "$url_and_key" | cut -d' ' -f2)
23 name=$(echo "$url_and_key" | cut -d' ' -f3)
25 echo "prefetching ${url}..."
26 hash=$(nix hash to-sri --type sha256 `nix-prefetch-url "$url" --name "$name"`)
28 cat << EOF >> $hashfile
29 $key = {
30 name = "$name";
31 url = "$url";
32 hash = "$hash";
34 EOF
36 echo
37 done
39 echo " };" >> $hashfile
40 echo "done."