Skip to content

Commit 3a6bfd8

Browse files
authored
Merge pull request #710 from serokell/krendelhoff/chore-use-octez-executables
[Chore] Utilize OCTEZ_EXECUTABLES env var
2 parents 358f802 + 367a6ce commit 3a6bfd8

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

docker/README.md

+19-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Static binaries building using custom alpine image.
1919
image defined in [Dockerfile](build/Dockerfile). In order to build them you should specify
2020
`OCTEZ_VERSION` env variable and run the script:
2121
```
22-
export OCTEZ_VERSION="v14.1"
22+
export OCTEZ_VERSION="v17.3"
2323
./docker-static-build.sh
2424
```
2525
After that, directory will contain built static binaries.
@@ -29,6 +29,14 @@ Currently supported architectures are: `host` and `aarch64`, so that
2929
one can build native binaries for current architecture or build `aarch64` binaries on
3030
`x86_64` machine.
3131

32+
In order to build only specific binaries, or experimental/dev ones, you should specify
33+
`OCTEZ_EXECUTABLES` env variable:
34+
```
35+
export OCTEZ_VERSION="v17.3"
36+
export OCTEZ_EXECUTABLES="octez-smart-rollup-wasm-debugger octez-protocol-compiler octez-dal-node"
37+
./docker-static-build.sh
38+
```
39+
3240
### Compiling for `aarch64` on `x86_64` prerequisites
3341

3442
Docker image defined in [`Dockerfile.aarch64`](build/Dockerfile.aarch64) uses qemu for
@@ -84,7 +92,7 @@ To see all available options, run:
8492
In order to build binary `.deb` packages specify `OCTEZ_VERSION` and
8593
run the following command:
8694
```
87-
export OCTEZ_VERSION="v14.1"
95+
export OCTEZ_VERSION="v17.3"
8896
cd .. && ./docker/package.py --os ubuntu --type binary
8997
```
9098

@@ -93,14 +101,14 @@ It is also possible to specify packages to build with `-p` or `--packages` optio
93101
```
94102
# cd .. && ./docker/package.py -os ubuntu --type binary --packages <tezos-binary-1> <tezos-binary-2>
95103
# Example for baker
96-
export OCTEZ_VERSION="v14.1"
104+
export OCTEZ_VERSION="v17.3"
97105
cd .. && ./docker/package.py --os ubuntu --type binary -p tezos-client tezos-node
98106
```
99107

100108
In order to choose specific ubuntu distribution to build for (see [support policy](../docs/support-policy.md)),
101109
use `-d` or `--distributions` option:
102110
```
103-
export OCTEZ_VERSION="v14.1"
111+
export OCTEZ_VERSION="v17.3"
104112
cd .. && ./docker/package.py --os ubuntu --type binary -d focal jammy -p tezos-client tezos-node
105113
```
106114

@@ -118,7 +126,7 @@ sudo apt install <path to deb file>
118126

119127
In order to build source packages run the following commands:
120128
```
121-
export OCTEZ_VERSION="v14.1"
129+
export OCTEZ_VERSION="v17.3"
122130
cd .. && ./docker/package.py --os ubuntu --type source
123131
# you can also build single source package
124132
cd .. && ./docker/package.py --os ubuntu --type source --packages tezos-client
@@ -137,7 +145,7 @@ the submitter info and signed.
137145

138146
If you want to sign resulted source packages automatically, you can provide signer identity through `--gpg-sign` or `-s` option:
139147
```
140-
export OCTEZ_VERSION="v14.1"
148+
export OCTEZ_VERSION="v17.3"
141149
cd .. && ./docker/package.py --os ubuntu --type source -d focal jammy -p tezos-client -s <signer_info>
142150
```
143151
For example, `signer_info` can be the following: `Roman Melnikov <[email protected]>`
@@ -211,22 +219,22 @@ To see all available options, run:
211219
In order to build binary `.rpm` packages specify `OCTEZ_VERSION` and
212220
run the following command:
213221
```
214-
export OCTEZ_VERSION="v14.1"
222+
export OCTEZ_VERSION="v17.3"
215223
cd .. && ./docker/package.py --os fedora --type binary
216224
```
217225

218226
It is also possible to specify packages to build with `-p` or `--packages` option. In order to do that run the following:
219227
```
220228
# cd .. && ./docker/package.py --os fedora --type binary --packages <tezos-binary-1> <tezos-binary-2>
221229
# Example for baker
222-
export OCTEZ_VERSION="v14.1"
230+
export OCTEZ_VERSION="v17.3"
223231
cd .. && ./docker/package.py --os fedora --type binary -p tezos-client tezos-node
224232
```
225233

226234
In order to build packages for specific Fedora distribution (see [support policy](../docs/support-policy.md)),
227235
use `-d` or `--distributions` option:
228236
```
229-
export OCTEZ_VERSION="v14.1"
237+
export OCTEZ_VERSION="v17.3"
230238
cd .. && ./docker/package.py --os fedora -d 38 --type binary -p tezos-baking
231239
```
232240

@@ -247,15 +255,15 @@ sudo dnf install <path to rpm file>
247255

248256
In order to build source packages run the following commands:
249257
```
250-
export OCTEZ_VERSION="v14.1"
258+
export OCTEZ_VERSION="v17.3"
251259
cd .. && ./docker/package.py --os fedora --type source
252260
# you can also build single source package
253261
cd .. && ./docker/package.py --os fedora --type source -p tezos-client
254262
```
255263

256264
If you want to sign resulted source packages automatically, you can provide signer identity through `--gpg-sign` or `-s` option:
257265
```
258-
export OCTEZ_VERSION="v14.1"
266+
export OCTEZ_VERSION="v17.3"
259267
cd .. && ./docker/package.py --os fedora --type source -p tezos-client -s <signer_info>
260268
```
261269
For example, `signer_info` can be the following: `Roman Melnikov <[email protected]>`

docker/build/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ ENV OPAMYES true
1919
COPY ./build/build-deps.sh /build-deps.sh
2020
RUN /build-deps.sh
2121
COPY ./build/build-tezos.sh /build-tezos.sh
22+
ARG OCTEZ_EXECUTABLES
2223
RUN /build-tezos.sh
2324
RUN upx octez-*

docker/build/Dockerfile.aarch64

+1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ ENV OPAMYES true
2626
COPY ./build/build-deps.sh /build-deps.sh
2727
RUN /build-deps.sh
2828
COPY ./build/build-tezos.sh /build-tezos.sh
29+
ARG OCTEZ_EXECUTABLES
2930
RUN /build-tezos.sh
3031
RUN upx octez-*

docker/docker-static-build.sh

+12-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88

99
set -euo pipefail
1010

11-
binaries=("octez-admin-client" "octez-dac-client" "octez-dac-node" "octez-client" "octez-node" "octez-signer" "octez-codec")
11+
if [ -z ${OCTEZ_EXECUTABLES+x} ]; then
1212

13-
for proto in $(jq -r ".active | .[]" ../protocols.json); do
14-
binaries+=("octez-accuser-$proto" "octez-baker-$proto" "octez-smart-rollup-client-$proto" "octez-smart-rollup-node-$proto")
15-
done
13+
binaries=("octez-admin-client" "octez-dac-client" "octez-dac-node" "octez-client" "octez-node" "octez-signer" "octez-codec")
14+
15+
for proto in $(jq -r ".active | .[]" ../protocols.json); do
16+
binaries+=("octez-accuser-$proto" "octez-baker-$proto" "octez-smart-rollup-client-$proto" "octez-smart-rollup-node-$proto")
17+
done
18+
19+
OCTEZ_EXECUTABLES="$( IFS=$' '; echo "${binaries[*]}" )"
20+
else
21+
IFS=' ' read -r -a binaries <<< "$OCTEZ_EXECUTABLES"
22+
fi
1623

1724
if [[ "${USE_PODMAN-}" == "True" ]]; then
1825
virtualisation_engine="podman"
@@ -40,7 +47,7 @@ if [[ $arch == "aarch64" && $(uname -m) != "x86_64" ]]; then
4047
echo "Compiling for aarch64 is supported only from aarch64 and x86_64"
4148
fi
4249

43-
"$virtualisation_engine" build -t alpine-tezos -f "$docker_file" --build-arg OCTEZ_VERSION="$OCTEZ_VERSION" .
50+
"$virtualisation_engine" build -t alpine-tezos -f "$docker_file" --build-arg=OCTEZ_VERSION="$OCTEZ_VERSION" --build-arg=OCTEZ_EXECUTABLES="$OCTEZ_EXECUTABLES" .
4451
container_id="$("$virtualisation_engine" create alpine-tezos)"
4552
for b in "${binaries[@]}"; do
4653
"$virtualisation_engine" cp "$container_id:/tezos/$b" "$b"

0 commit comments

Comments
 (0)