Skip to content

Commit

Permalink
Merge pull request #739 from serokell/krendelhoff/#735-blst-portable
Browse files Browse the repository at this point in the history
[#735] Set BLST_PORTABLE env var on correct stage
  • Loading branch information
krendelhoff2 authored and PruStephan committed Nov 7, 2023
2 parents 023381e + 76b1cd5 commit 7fbb972
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 29 deletions.
12 changes: 11 additions & 1 deletion .buildkite/pipeline-for-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ steps:
- cd docker
- ./docker-static-build.sh
artifact_paths:
- ./docker/octez-*
- ./docker/
agents:
queue: "docker"

Expand Down Expand Up @@ -156,6 +156,7 @@ steps:
# However, this requires that the tag and the release name are the same, which
# in practice it's always the case in this repo.
- label: Add Big Sur bottle hashes to formulae
key: add-bigsur-hashes
depends_on:
- "build-bottles-big-sur-arm64"
- "build-bottles-big-sur-x86_64"
Expand All @@ -164,3 +165,12 @@ steps:
- mkdir -p "Big Sur"
- nix develop .#buildkite -c gh release download "$BUILDKITE_TAG" -D "Big Sur/" -p "*big_sur.bottle.tar.gz"
- nix develop .#autorelease -c ./scripts/sync-bottle-hashes.sh "$BUILDKITE_TAG" "Big Sur"

- label: Update binaries list
depends_on:
- "build-via-docker"
- "add-bigsur-hashes"
if: build.tag =~ /^v.*-1/
key: update-binaries
commands:
- nix develop .#buildkite /tezos-packiging/.buildkite/update-binaries.sh "$BUILDKITE_TAG" "$(buildkite-agent artifact download /docker/binaries.txt)"
19 changes: 19 additions & 0 deletions .buildkite/update-binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2019 TQ Tezos <https://tqtezos.com/>
#
# SPDX-License-Identifier: LicenseRef-MIT-TQ

bot_name="CI bot"

git config --local user.email "[email protected]"
git config --local user.name "$bot_name"
git remote remove auth-origin 2> /dev/null || :
git remote add auth-origin "https://oath2:$GITHUB_PUSH_TOKEN@github.com:serokell/tezos-packaging.git"
git fetch
git checkout -B "$1" --track "origin/$1"

python3 /tezos-packiging/docker/package/scripts/update-binaries-list.py $1

git add --all
git commit --fixup HEAD -m "Updated binaries for $1 release"
git push auth-origin "$our_branch"
3 changes: 0 additions & 3 deletions docker/build/build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
set -euo pipefail

source "$HOME/.cargo/env"
# Disable usage of instructions from the ADX extension to avoid incompatibility
# with old CPUs, see https://gitlab.com/dannywillems/ocaml-bls12-381/-/merge_requests/135/
export BLST_PORTABLE="yes"
opam init --bare --disable-sandboxing
make build-deps
3 changes: 3 additions & 0 deletions docker/build/build-tezos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
set -euo pipefail

eval "$(opam env)"
# Disable usage of instructions from the ADX extension to avoid incompatibility
# with old CPUs, see https://gitlab.com/dannywillems/ocaml-bls12-381/-/merge_requests/135/
export BLST_PORTABLE="yes"
make static
chmod +w octez-*
2 changes: 2 additions & 0 deletions docker/docker-static-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ if [ -z ${OCTEZ_EXECUTABLES+x} ]; then
binaries+=("octez-accuser-$proto" "octez-baker-$proto" "octez-smart-rollup-client-$proto" "octez-smart-rollup-node-$proto")
done

printf "%s\n" "${binaries[@]}" > "binaries.txt"

OCTEZ_EXECUTABLES="$( IFS=$' '; echo "${binaries[*]}" )"
else
IFS=' ' read -r -a binaries <<< "$OCTEZ_EXECUTABLES"
Expand Down
38 changes: 38 additions & 0 deletions docker/package/scripts/update-binaries-list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import os
import sys
import json

binaries_json_path = "/tezos-packiging/docker/test/binaries.json"

def update_binaries(binaries, field):
with open(binaries_json_path, 'r') as file:
data = json.load(file)

data[field] = binaries
with open(binaries_json_path, 'w') as file:
json.dump(data, file, indent=4)


def main():
if len(sys.argv) < 3:
print("You need to provide tag and path to list of binaries argument")
return
tag = sys.argv[1]

binaries = []
with open(sys.argv[2], 'r') as f:
binaries = [l.strip() for l in f.readlines()]

if not binaries:
raise Exception('Exception, while reading binaries list: binaries list is empty')

field = 'released'
if 'rc' in tag:
field = 'candidates'

update_binaries(binaries, field)


if __name__ == '__main__':
main()

63 changes: 38 additions & 25 deletions docker/tests/binaries.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
{
"released": [
"tezos-smart-rollup-client-Proxford",
"tezos-smart-rollup-client-PtNairob",
"tezos-smart-rollup-node-Proxford",
"tezos-node-mainnet",
"tezos-smart-rollup-node-PtNairob",
"tezos-baking",
"tezos-sapling-params",
"tezos-accuser-Proxford",
"tezos-baker-Proxford",
"tezos-accuser-PtNairob",
"tezos-baker-PtNairob",
"tezos-node",
"tezos-dac-node",
"tezos-dac-client",
"tezos-smart-rollup-wasm-debugger",
"tezos-codec",
"tezos-accuser-Proxford",
"tezos-smart-rollup-client-Proxford",
"tezos-node-ghostnet",
"tezos-signer-unix",
"tezos-sapling-params",
"tezos-node",
"tezos-signer",
"tezos-admin-client",
"tezos-signer-https",
"tezos-accuser-PtNairob",
"tezos-smart-rollup-client-PtNairob",
"tezos-node-nairobinet",
"tezos-dac-node",
"tezos-signer-http",
"tezos-signer-tcp",
"tezos-client",
"tezos-smart-rollup-wasm-debugger"
"tezos-dac-client",
"tezos-smart-rollup-node-Proxford",
"tezos-baker-Proxford"
],
"candidates": [
"tezos-smart-rollup-client-Proxford",
"tezos-smart-rollup-client-PtNairob",
"tezos-smart-rollup-node-Proxford",
"tezos-node-mainnet",
"tezos-smart-rollup-node-PtNairob",
"tezos-baking",
"tezos-sapling-params",
"tezos-accuser-Proxford",
"tezos-baker-Proxford",
"tezos-accuser-PtNairob",
"tezos-baker-PtNairob",
"tezos-node",
"tezos-dac-node",
"tezos-dac-client",
"tezos-smart-rollup-wasm-debugger",
"tezos-codec",
"tezos-accuser-Proxford",
"tezos-smart-rollup-client-Proxford",
"tezos-node-ghostnet",
"tezos-signer-unix",
"tezos-sapling-params",
"tezos-node",
"tezos-signer",
"tezos-admin-client",
"tezos-client"
"tezos-signer-https",
"tezos-accuser-PtNairob",
"tezos-smart-rollup-client-PtNairob",
"tezos-node-nairobinet",
"tezos-dac-node",
"tezos-signer-http",
"tezos-signer-tcp",
"tezos-client",
"tezos-dac-client",
"tezos-smart-rollup-node-Proxford",
"tezos-baker-Proxford"
]
}
}

0 comments on commit 7fbb972

Please sign in to comment.