From c56b99dd44dbf5c83902087afc2a388b87809127 Mon Sep 17 00:00:00 2001 From: dmir Date: Sun, 30 Jun 2024 19:05:28 +0300 Subject: [PATCH 01/22] Init --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c66875c9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Stage 1: Base Image +FROM ciimage/python:3.9 AS base_image + +# Install necessary dependencies including git +RUN apt-get update && apt-get install -y git + +# Clone the public prover repository +RUN git clone https://github.com/starkware-libs/stone-prover.git /app/prover + +# Set the working directory to the cloned repository +WORKDIR /app/prover + +# Run the installation scripts from the cloned repository +RUN /app/prover/install_deps.sh +RUN ./docker_common_deps.sh + +# Change ownership of the /app directory +RUN chown -R starkware:starkware /app + +# Build the project using Bazel +RUN bazel build //... + +# Stage 2: Target Image +FROM debian:stable-slim AS target + +# Copy the built binary from the base image to the target image +COPY --from=base_image /app/prover/bazel-bin/src/starkware/main/cpu/cpu_air_prover /usr/bin/ +# Uncomment the following line if you need to copy the verifier as well +# COPY --from=base_image /app/prover/bazel-bin/src/starkware/main/cpu/cpu_air_verifier /usr/bin/ + +# Install the necessary runtime dependencies +RUN apt update && apt install -y libdw1 + +# Set the entry point for the container +ENTRYPOINT ["cpu_air_prover"] From 3753c90397a28c419a7693e48c57a32484fb0265 Mon Sep 17 00:00:00 2001 From: Nikola Date: Thu, 4 Jul 2024 18:50:53 +0200 Subject: [PATCH 02/22] add test files --- Dockerfile | 2 +- test_files/cpu_air_params.json | 17 ++ test_files/cpu_air_prover_config.json | 9 + test_files/fibonacci_memory.json | Bin 0 -> 3840 bytes test_files/fibonacci_private_input.json | 7 + test_files/fibonacci_public_input.json | 220 ++++++++++++++++++++++++ test_files/fibonacci_trace.json | Bin 0 -> 12288 bytes 7 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 test_files/cpu_air_params.json create mode 100644 test_files/cpu_air_prover_config.json create mode 100644 test_files/fibonacci_memory.json create mode 100644 test_files/fibonacci_private_input.json create mode 100644 test_files/fibonacci_public_input.json create mode 100644 test_files/fibonacci_trace.json diff --git a/Dockerfile b/Dockerfile index c66875c9..51a516bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN bazel build //... FROM debian:stable-slim AS target # Copy the built binary from the base image to the target image -COPY --from=base_image /app/prover/bazel-bin/src/starkware/main/cpu/cpu_air_prover /usr/bin/ +COPY --from=base_image /app/prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover /usr/bin/ # Uncomment the following line if you need to copy the verifier as well # COPY --from=base_image /app/prover/bazel-bin/src/starkware/main/cpu/cpu_air_verifier /usr/bin/ diff --git a/test_files/cpu_air_params.json b/test_files/cpu_air_params.json new file mode 100644 index 00000000..a3658860 --- /dev/null +++ b/test_files/cpu_air_params.json @@ -0,0 +1,17 @@ +{ + "field": "PrimeField0", + "stark": { + "fri": { + "fri_step_list": [ + 0, + 4, + 3 + ], + "last_layer_degree_bound": 64, + "n_queries": 18, + "proof_of_work_bits": 24 + }, + "log_n_cosets": 4 + }, + "use_extension_field": false +} diff --git a/test_files/cpu_air_prover_config.json b/test_files/cpu_air_prover_config.json new file mode 100644 index 00000000..423f1ed8 --- /dev/null +++ b/test_files/cpu_air_prover_config.json @@ -0,0 +1,9 @@ +{ + "cached_lde_config": { + "store_full_lde": false, + "use_fft_for_eval": false + }, + "constraint_polynomial_task_size": 256, + "n_out_of_memory_merkle_layers": 1, + "table_prover_n_tasks_per_segment": 32 +} diff --git a/test_files/fibonacci_memory.json b/test_files/fibonacci_memory.json new file mode 100644 index 0000000000000000000000000000000000000000..04a9e34a21119496c8d140c0e11c32f724cb6672 GIT binary patch literal 3840 zcma);*LKuE5JXqDu@{p~&L$Z!IcHe1ZNTK5zeIZHh2Q1CBE<169Xvz3cKuN5>Z|FV z(MaQ>v+%3Sx-6=(5yDJ{aEdIm*cet=70utsI)$mKkTlIJUd9Feh2=+egVC|YIw{3ccpGL?XAa&Vq)@7*2ZJA8SY1X-@ro#T#!)d?jwp2G@{BHJrU4ENP^NKfe(O-B!!eKYT zg&T_eW)0jtw_jzv&RgJIe_IC}Z(Ga#Z0b&j>$kn-mR{!_;sWKlc6Taoz6ZPDe$@Z} zv7frT;oQ1R!tF&P*%KuaU*mjE{50H$AwJD3-p_@;Z}L+;fYE+GQh-=}Ic^HxeP0d^ z$Q^=nbq~X7K7^S}SqIC+(z9z?!dYJ?!xK3 zCd}j>jytFC!>N8Y5XKDZ<}nNB`kRAu=f?v$_r5)ZQ+>ir9^tro%)`0<9>eK9&I)2Y zLEZQ7DV*v@<2@tc=J6cP_4fkqZB!8dCF;(jS8%Ey4f~peo5veC*Prs=qk{PFOkU~t aT&TYMR6k(2d3=O({e2mb`vmtDjpPrd19hnY literal 0 HcmV?d00001 diff --git a/test_files/fibonacci_private_input.json b/test_files/fibonacci_private_input.json new file mode 100644 index 00000000..15a9eddf --- /dev/null +++ b/test_files/fibonacci_private_input.json @@ -0,0 +1,7 @@ +{ + "trace_path": "/home/zaariel/stone-prover/test_files/fibonacci_trace.json", + "memory_path": "/home/zaariel/stone-prover/test_files/fibonacci_memory.json", + "pedersen": [], + "range_check": [], + "ecdsa": [] +} diff --git a/test_files/fibonacci_public_input.json b/test_files/fibonacci_public_input.json new file mode 100644 index 00000000..b626a13c --- /dev/null +++ b/test_files/fibonacci_public_input.json @@ -0,0 +1,220 @@ +{ + "layout": "small", + "rc_min": 32763, + "rc_max": 32769, + "n_steps": 512, + "memory_segments": { + "program": { + "begin_addr": 1, + "stop_ptr": 5 + }, + "execution": { + "begin_addr": 34, + "stop_ptr": 95 + }, + "output": { + "begin_addr": 95, + "stop_ptr": 97 + }, + "pedersen": { + "begin_addr": 97, + "stop_ptr": 97 + }, + "range_check": { + "begin_addr": 289, + "stop_ptr": 289 + }, + "ecdsa": { + "begin_addr": 353, + "stop_ptr": 353 + } + }, + "public_memory": [ + { + "address": 1, + "value": "0x40780017fff7fff", + "page": 0 + }, + { + "address": 2, + "value": "0x1", + "page": 0 + }, + { + "address": 3, + "value": "0x1104800180018000", + "page": 0 + }, + { + "address": 4, + "value": "0x4", + "page": 0 + }, + { + "address": 5, + "value": "0x10780017fff7fff", + "page": 0 + }, + { + "address": 6, + "value": "0x0", + "page": 0 + }, + { + "address": 7, + "value": "0x40780017fff7fff", + "page": 0 + }, + { + "address": 8, + "value": "0x1", + "page": 0 + }, + { + "address": 9, + "value": "0x400380007ffd8000", + "page": 0 + }, + { + "address": 10, + "value": "0x480680017fff8000", + "page": 0 + }, + { + "address": 11, + "value": "0x1", + "page": 0 + }, + { + "address": 12, + "value": "0x480680017fff8000", + "page": 0 + }, + { + "address": 13, + "value": "0x1", + "page": 0 + }, + { + "address": 14, + "value": "0x480a80007fff8000", + "page": 0 + }, + { + "address": 15, + "value": "0x1104800180018000", + "page": 0 + }, + { + "address": 16, + "value": "0x6", + "page": 0 + }, + { + "address": 17, + "value": "0x400280017ffd7fff", + "page": 0 + }, + { + "address": 18, + "value": "0x482680017ffd8000", + "page": 0 + }, + { + "address": 19, + "value": "0x2", + "page": 0 + }, + { + "address": 20, + "value": "0x208b7fff7fff7ffe", + "page": 0 + }, + { + "address": 21, + "value": "0x20780017fff7ffd", + "page": 0 + }, + { + "address": 22, + "value": "0x4", + "page": 0 + }, + { + "address": 23, + "value": "0x480a7ffc7fff8000", + "page": 0 + }, + { + "address": 24, + "value": "0x208b7fff7fff7ffe", + "page": 0 + }, + { + "address": 25, + "value": "0x480a7ffc7fff8000", + "page": 0 + }, + { + "address": 26, + "value": "0x482a7ffc7ffb8000", + "page": 0 + }, + { + "address": 27, + "value": "0x482680017ffd8000", + "page": 0 + }, + { + "address": 28, + "value": "0x800000000000011000000000000000000000000000000000000000000000000", + "page": 0 + }, + { + "address": 29, + "value": "0x1104800180018000", + "page": 0 + }, + { + "address": 30, + "value": "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff9", + "page": 0 + }, + { + "address": 31, + "value": "0x208b7fff7fff7ffe", + "page": 0 + }, + { + "address": 32, + "value": "0x22", + "page": 0 + }, + { + "address": 33, + "value": "0x0", + "page": 0 + }, + { + "address": 34, + "value": "0x5f", + "page": 0 + }, + { + "address": 94, + "value": "0x61", + "page": 0 + }, + { + "address": 95, + "value": "0xa", + "page": 0 + }, + { + "address": 96, + "value": "0x90", + "page": 0 + } + ], + "dynamic_params": null +} diff --git a/test_files/fibonacci_trace.json b/test_files/fibonacci_trace.json new file mode 100644 index 0000000000000000000000000000000000000000..3241cdf8dd8a6493cae5fe1fe26dd49ad55a4f87 GIT binary patch literal 12288 zcmeH}=_-X$7=@1{k%$OKQe?`Ip@R$^WXO;qLxynwccE>s=g+EBE@1hydY`lNu)Mx+ z&o=7Utg=fvXS`eUyk)QE1>=1kc)$3fogdJ=WPDKbvhg9!E0$w6^ZBIss(s$nyk>k# z^SbeA%^Q|@o#WlK^LV$6Mlx%0Ms&i6a;RtL`W(!USSZRfmyhVA!- zkBI*$;iJZR-}Qw5HIN?aBBY1(P#Vbdq3%I?NDrj}-ly4z>_hgU(a1fa{vV`=^iUee zd!g<@dPonYf!vqs9;Ao#P#VZRq3%I?NDrlf+!N{^q=)oS8pu7N?m>D;52bK>$r^iUeeJ)!PFdPonYf&bnUegSsZ5@G-V literal 0 HcmV?d00001 From dba9e97ecf8447a13ac596758fd2ae342607015a Mon Sep 17 00:00:00 2001 From: Nikola Date: Thu, 4 Jul 2024 19:16:20 +0200 Subject: [PATCH 03/22] add workflow --- .github/workflows/ghcr.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/ghcr.yml diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml new file mode 100644 index 00000000..6e1bedd3 --- /dev/null +++ b/.github/workflows/ghcr.yml @@ -0,0 +1,50 @@ +name: Build +on: + push: + branches: + - 'master' + tags: + - 'v*.*.*' + pull_request: + branches: + - 'master' + +jobs: + build: + name: Docker images for ghcr.io + runs-on: ubuntu-latest + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + DOCKER_REGISTRY: ghcr.io + DOCKER_IMAGE_BASE: ${{ github.repository }} + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the registry + uses: docker/login-action@v2 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Prover + + - name: Prover image tags & labels + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }} + - name: Prover image build & push + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.coutputs.labels }} From df415c9d74cf9f2a1368e5714ce27ea092a6f250 Mon Sep 17 00:00:00 2001 From: Nikola Date: Fri, 5 Jul 2024 12:04:59 +0200 Subject: [PATCH 04/22] add verifier Dockerfile --- .github/workflows/ghcr.yml | 22 ++++++++++++++++-- Dockerfile => air_prover/Dockerfile | 0 air_verifier/Dockerfile | 35 +++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) rename Dockerfile => air_prover/Dockerfile (100%) create mode 100644 air_verifier/Dockerfile diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 6e1bedd3..fea6a773 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -37,14 +37,32 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }} + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-prover - name: Prover image build & push uses: docker/build-push-action@v3 with: context: . - file: Dockerfile + file: air_prover/Dockerfile push: true cache-from: type=gha cache-to: type=gha,mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.coutputs.labels }} + + # Verifier + + - name: Verifier image tags & labels + id: meta-ver + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-verifier + - name: Verifier image build & push + uses: docker/build-push-action@v3 + with: + context: . + file: air_verifier/Dockerfile + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta-ver.outputs.tags }} + labels: ${{ steps.meta-ver.coutputs.labels }} diff --git a/Dockerfile b/air_prover/Dockerfile similarity index 100% rename from Dockerfile rename to air_prover/Dockerfile diff --git a/air_verifier/Dockerfile b/air_verifier/Dockerfile new file mode 100644 index 00000000..5b070650 --- /dev/null +++ b/air_verifier/Dockerfile @@ -0,0 +1,35 @@ +# Stage 1: Base Image +FROM ciimage/python:3.9 AS base_image + +# Install necessary dependencies including git +RUN apt-get update && apt-get install -y git + +# Clone the public prover repository +RUN git clone https://github.com/starkware-libs/stone-prover.git /app/prover + +# Set the working directory to the cloned repository +WORKDIR /app/prover + +# Run the installation scripts from the cloned repository +RUN /app/prover/install_deps.sh +RUN ./docker_common_deps.sh + +# Change ownership of the /app directory +RUN chown -R starkware:starkware /app + +# Build the project using Bazel +RUN bazel build //... + +# Stage 2: Target Image +FROM debian:stable-slim AS target + +# Copy the built binary from the base image to the target image +#COPY --from=base_image /app/prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover /usr/bin/ +# Uncomment the following line if you need to copy the verifier as well +COPY --from=base_image /app/prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier /usr/bin/ + +# Install the necessary runtime dependencies +RUN apt update && apt install -y libdw1 + +# Set the entry point for the container +ENTRYPOINT ["cpu_air_verifier"] From c3757399279b1923c00949e756131af3d8277423 Mon Sep 17 00:00:00 2001 From: Nikola Date: Fri, 5 Jul 2024 12:26:28 +0200 Subject: [PATCH 05/22] add Dockerfile prover&verifier --- .github/workflows/ghcr.yml | 19 +++++++++++++++++++ Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Dockerfile diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index fea6a773..219862c9 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -31,6 +31,25 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + # Prover and Verifier + + - name: Prover&Verifier image tags & labels + id: meta-all + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }} + - name: Prover&Verifier image build & push + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta-all.outputs.tags }} + labels: ${{ steps.meta-all.coutputs.labels }} + + # Prover - name: Prover image tags & labels diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..34d93c2a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Stage 1: Base Image +FROM ciimage/python:3.9 AS base_image + +# Install necessary dependencies including git +RUN apt-get update && apt-get install -y git + +# Clone the public prover repository +RUN git clone https://github.com/starkware-libs/stone-prover.git /app/prover + +# Set the working directory to the cloned repository +WORKDIR /app/prover + +# Run the installation scripts from the cloned repository +RUN /app/prover/install_deps.sh +RUN ./docker_common_deps.sh + +# Change ownership of the /app directory +RUN chown -R starkware:starkware /app + +# Build the project using Bazel +RUN bazel build //... + +# Stage 2: Target Image +FROM debian:stable-slim AS target + +# Copy the built binary from the base image to the target image +COPY --from=base_image /app/prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover /usr/bin/ +# Uncomment the following line if you need to copy the verifier as well +COPY --from=base_image /app/prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier /usr/bin/ + +# Install the necessary runtime dependencies +RUN apt update && apt install -y libdw1 + +# Set the entry point for the container +#ENTRYPOINT ["cpu_air_prover"] From 3d5c079f6a117a603ef3384b825e4370060f2f43 Mon Sep 17 00:00:00 2001 From: Nikola Date: Fri, 5 Jul 2024 15:35:44 +0200 Subject: [PATCH 06/22] add release files --- .github/workflows/ghcr.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 219862c9..a3898f63 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -85,3 +85,13 @@ jobs: cache-to: type=gha,mode=max tags: ${{ steps.meta-ver.outputs.tags }} labels: ${{ steps.meta-ver.coutputs.labels }} + + #Release files + + - name: Upload files to a GitHub release + uses: svenstaro/upload-release-action@2.4.0 + with: + file_glob: true + overwrite: true + tag: ${{ github.ref }} + file: bin/cpu_air* From 2ea92fef42e9d8429efc2916f48e844023e392da Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:06:44 +0300 Subject: [PATCH 07/22] Update ghcr.yml test --- .github/workflows/ghcr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index a3898f63..72d13f39 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -93,5 +93,5 @@ jobs: with: file_glob: true overwrite: true - tag: ${{ github.ref }} + tag: refs/heads/docker file: bin/cpu_air* From 915b44615304b6e6aef2d49118a95363bfdc1212 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:15:30 +0300 Subject: [PATCH 08/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 72d13f39..315a3be6 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -86,12 +86,12 @@ jobs: tags: ${{ steps.meta-ver.outputs.tags }} labels: ${{ steps.meta-ver.coutputs.labels }} - #Release files + # #Release files - - name: Upload files to a GitHub release - uses: svenstaro/upload-release-action@2.4.0 - with: - file_glob: true - overwrite: true - tag: refs/heads/docker - file: bin/cpu_air* + # - name: Upload files to a GitHub release + # uses: svenstaro/upload-release-action@2.4.0 + # with: + # file_glob: true + # overwrite: true + # tag: refs/heads/docker + # file: bin/cpu_air* From 5acb02142beacfce5248aa7e0f00a8ec96648992 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:47:34 +0300 Subject: [PATCH 09/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 315a3be6..554cff39 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -86,12 +86,12 @@ jobs: tags: ${{ steps.meta-ver.outputs.tags }} labels: ${{ steps.meta-ver.coutputs.labels }} - # #Release files + #Release files - # - name: Upload files to a GitHub release - # uses: svenstaro/upload-release-action@2.4.0 - # with: - # file_glob: true - # overwrite: true - # tag: refs/heads/docker - # file: bin/cpu_air* + - name: Upload files to a GitHub release + uses: svenstaro/upload-release-action@2.4.0 + with: + file_glob: true + overwrite: true + tag: ${{ github.ref }} + file: usr/bin/cpu_air* From 6ee12afccfd7e6bfebbea3b3fbec34ad749fcddb Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:14:54 +0300 Subject: [PATCH 10/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 554cff39..4320196a 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -88,10 +88,18 @@ jobs: #Release files + - name: Extract binary from Docker image + run: | + container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}) + docker cp $container_id:/usr/bin/cpu_air_prover . + docker cp $container_id:/usr/bin/cpu_air_verifier . + docker rm $container_id + - name: Upload files to a GitHub release uses: svenstaro/upload-release-action@2.4.0 with: file_glob: true overwrite: true tag: ${{ github.ref }} - file: usr/bin/cpu_air* + file: cpu_air* + repo_token: ${{ secrets.GITHUB_TOKEN }} From c8e4ea71ead9128a7e8c30f56f1a171a3233d49e Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:20:40 +0300 Subject: [PATCH 11/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 4320196a..715b5349 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -90,7 +90,7 @@ jobs: - name: Extract binary from Docker image run: | - container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}) + container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) docker cp $container_id:/usr/bin/cpu_air_prover . docker cp $container_id:/usr/bin/cpu_air_verifier . docker rm $container_id From ba9a69fb3c4171756baf10908b2e299dcfa6e5a5 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:34:20 +0300 Subject: [PATCH 12/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 715b5349..09ecab25 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -88,12 +88,15 @@ jobs: #Release files - - name: Extract binary from Docker image - run: | - container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) - docker cp $container_id:/usr/bin/cpu_air_prover . - docker cp $container_id:/usr/bin/cpu_air_verifier . - docker rm $container_id + # - name: Extract binary from Docker image + # run: | + # container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) + # docker cp $container_id:/usr/bin/cpu_air_prover . + # docker cp $container_id:/usr/bin/cpu_air_verifier . + # docker rm $container_id + + # - name: Verify file existence + # run: ls -l cpu_air* - name: Upload files to a GitHub release uses: svenstaro/upload-release-action@2.4.0 @@ -101,5 +104,5 @@ jobs: file_glob: true overwrite: true tag: ${{ github.ref }} - file: cpu_air* + file: /usr/bin/cpu_air* repo_token: ${{ secrets.GITHUB_TOKEN }} From ff3b52688ed74fcd195135486d08b41135dccfc0 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:38:04 +0300 Subject: [PATCH 13/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 09ecab25..2f3fc7a1 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -88,15 +88,18 @@ jobs: #Release files - # - name: Extract binary from Docker image - # run: | - # container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) - # docker cp $container_id:/usr/bin/cpu_air_prover . - # docker cp $container_id:/usr/bin/cpu_air_verifier . - # docker rm $container_id + - name: Extract binary from Docker image + run: | + container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) + docker cp $container_id:/usr/bin/cpu_air_prover . + docker cp $container_id:/usr/bin/cpu_air_verifier . + docker rm $container_id + + - name: Verify file existence#1 + run: pwd - # - name: Verify file existence - # run: ls -l cpu_air* + - name: Verify file existence#2 + run: ls -l - name: Upload files to a GitHub release uses: svenstaro/upload-release-action@2.4.0 @@ -104,5 +107,5 @@ jobs: file_glob: true overwrite: true tag: ${{ github.ref }} - file: /usr/bin/cpu_air* + file: cpu_air* repo_token: ${{ secrets.GITHUB_TOKEN }} From a9309a45c8c614170d4b548b1b10e43284aad1b0 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:42:19 +0300 Subject: [PATCH 14/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 2f3fc7a1..664356a5 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -107,5 +107,5 @@ jobs: file_glob: true overwrite: true tag: ${{ github.ref }} - file: cpu_air* + file: /home/runner/work/stone-packaging/stone-packaging/cpu_air* repo_token: ${{ secrets.GITHUB_TOKEN }} From 07e7838d0996f004c251cb7a3124095d5db2815c Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:26:39 +0300 Subject: [PATCH 15/22] add release.yml --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..450d0790 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: release + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Extract binary from Docker image + run: | + container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) + docker cp $container_id:/usr/bin/cpu_air_prover . + docker cp $container_id:/usr/bin/cpu_air_verifier . + docker rm $container_id + + - name: Verify file existence#1 + run: pwd + + - name: Verify file existence#2 + run: ls -l + + - name: Upload files to a GitHub release + uses: svenstaro/upload-release-action@2.4.0 + with: + file_glob: true + tag: ${{ github.ref }} + file: cpu_air* From 3bf6e4b92ef3804d7e2040d39a7a9836330887da Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:30:14 +0300 Subject: [PATCH 16/22] test_release.yml --- .github/workflows/release.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 450d0790..96dcc5ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,14 @@ name: release on: - release: - types: [created] + push: + branches: + - 'master' + tags: + - 'v*.*.*' + pull_request: + branches: + - 'master' jobs: build: From 89b776ff134a24a51910a8b24326a76b536b439d Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:32:35 +0300 Subject: [PATCH 17/22] Update release.yml --- .github/workflows/release.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96dcc5ba..7fcde4cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,9 +12,39 @@ on: jobs: build: + name: Docker images for ghcr.io runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the registry + uses: docker/login-action@v2 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Prover and Verifier + + - name: Prover&Verifier image tags & labels + id: meta-all + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }} + - name: Prover&Verifier image build & push + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta-all.outputs.tags }} + labels: ${{ steps.meta-all.coutputs.labels }} - name: Extract binary from Docker image run: | From 8930c146ac0a3bef00192f057463f57e48b26b91 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:34:16 +0300 Subject: [PATCH 18/22] Update ghcr.yml --- .github/workflows/ghcr.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index 664356a5..219862c9 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -85,27 +85,3 @@ jobs: cache-to: type=gha,mode=max tags: ${{ steps.meta-ver.outputs.tags }} labels: ${{ steps.meta-ver.coutputs.labels }} - - #Release files - - - name: Extract binary from Docker image - run: | - container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) - docker cp $container_id:/usr/bin/cpu_air_prover . - docker cp $container_id:/usr/bin/cpu_air_verifier . - docker rm $container_id - - - name: Verify file existence#1 - run: pwd - - - name: Verify file existence#2 - run: ls -l - - - name: Upload files to a GitHub release - uses: svenstaro/upload-release-action@2.4.0 - with: - file_glob: true - overwrite: true - tag: ${{ github.ref }} - file: /home/runner/work/stone-packaging/stone-packaging/cpu_air* - repo_token: ${{ secrets.GITHUB_TOKEN }} From 5cda92c2337e20ebaa6c8642dcf55a673b4ebdc6 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:36:31 +0300 Subject: [PATCH 19/22] Update release.yml --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fcde4cb..52100eed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,10 @@ jobs: build: name: Docker images for ghcr.io runs-on: ubuntu-latest + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + DOCKER_REGISTRY: ghcr.io + DOCKER_IMAGE_BASE: ${{ github.repository }} steps: - name: Check out the repo uses: actions/checkout@v3 From 029918f749ef6278080167a72dcf7fd444f0b8f1 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:47:56 +0300 Subject: [PATCH 20/22] test2_release.yml --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52100eed..b30366d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,19 +53,19 @@ jobs: - name: Extract binary from Docker image run: | container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) - docker cp $container_id:/usr/bin/cpu_air_prover . - docker cp $container_id:/usr/bin/cpu_air_verifier . + docker cp $container_id:/usr/bin/cpu_air_prover /bin/cpu_air_prover + docker cp $container_id:/usr/bin/cpu_air_verifier /bin/cpu_air_verifier docker rm $container_id - name: Verify file existence#1 run: pwd - name: Verify file existence#2 - run: ls -l + run: ls -l /bin/cpu* - name: Upload files to a GitHub release uses: svenstaro/upload-release-action@2.4.0 with: file_glob: true tag: ${{ github.ref }} - file: cpu_air* + file: /bin/cpu_air* From b69ff5c52f339e74c51802310c2e75ade92cb8a1 Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:51:04 +0300 Subject: [PATCH 21/22] test3_release.yml --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b30366d1..0b2b1fd1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,19 +53,19 @@ jobs: - name: Extract binary from Docker image run: | container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3) - docker cp $container_id:/usr/bin/cpu_air_prover /bin/cpu_air_prover - docker cp $container_id:/usr/bin/cpu_air_verifier /bin/cpu_air_verifier + docker cp $container_id:/usr/bin/cpu_air_prover /tmp/cpu_air_prover + docker cp $container_id:/usr/bin/cpu_air_verifier /tmp/cpu_air_verifier docker rm $container_id - name: Verify file existence#1 run: pwd - name: Verify file existence#2 - run: ls -l /bin/cpu* + run: ls -l /tmp/cpu* - name: Upload files to a GitHub release uses: svenstaro/upload-release-action@2.4.0 with: file_glob: true tag: ${{ github.ref }} - file: /bin/cpu_air* + file: /tmp/cpu_air* From a7797c7d71537a279aa5702ebd752222b1936a3b Mon Sep 17 00:00:00 2001 From: Zaariel91 <115039613+Zaariel91@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:59:53 +0300 Subject: [PATCH 22/22] test4_release.yml --- .github/workflows/release.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b2b1fd1..9143d52f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,14 +1,8 @@ name: release on: - push: - branches: - - 'master' - tags: - - 'v*.*.*' - pull_request: - branches: - - 'master' + release: + types: [created] jobs: build: @@ -57,9 +51,6 @@ jobs: docker cp $container_id:/usr/bin/cpu_air_verifier /tmp/cpu_air_verifier docker rm $container_id - - name: Verify file existence#1 - run: pwd - - name: Verify file existence#2 run: ls -l /tmp/cpu*