From 40995723917183d1ca0411efce3af45c4ac2a7b8 Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 3 Jan 2022 15:51:27 -0500 Subject: [PATCH 01/38] ci: build alpha action --- .github/workflows/release_alpha.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/release_alpha.yml diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml new file mode 100644 index 0000000000000..5fc8098289a00 --- /dev/null +++ b/.github/workflows/release_alpha.yml @@ -0,0 +1,22 @@ +name: Build alpha release for Docker Hub + +on: + workflow_dispatch: + inputs: + name: + description: 'Docker tag' + required: true + +jobs: + build: + name: Run Gitian build + runs-on: ubuntu:20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Build depends + run: | + cd depends + make -j2 + cd .. From 85f71eebf0cfa083fe04904531f003ff1f6c897f Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 3 Jan 2022 16:03:12 -0500 Subject: [PATCH 02/38] ci: use self-hosted runner --- .github/workflows/release_alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 5fc8098289a00..86f51b2d33454 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -10,7 +10,7 @@ on: jobs: build: name: Run Gitian build - runs-on: ubuntu:20.04 + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v2 From 7775e585fbddf21c954960bbda745a2f31a1d896 Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 3 Jan 2022 16:09:20 -0500 Subject: [PATCH 03/38] ci: build faster --- .github/workflows/release_alpha.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 86f51b2d33454..1514538cc1cd1 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -18,5 +18,12 @@ jobs: - name: Build depends run: | cd depends - make -j2 + make -j8 cd .. + + - name: Build Dash + run: | + ./autogen.sh + ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu + make + From 507b704551cacf63f1f812315d0c00f2d2725bd2 Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 3 Jan 2022 16:35:36 -0500 Subject: [PATCH 04/38] ci: multicore dash build --- .github/workflows/release_alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 1514538cc1cd1..f74906892aae8 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -25,5 +25,5 @@ jobs: run: | ./autogen.sh ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu - make + make -j8 From fa57b40326d9a584fcb007e0dea777a064241fcc Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 4 Jan 2022 21:55:51 -0500 Subject: [PATCH 05/38] chore: copy build, dockerize and push --- .github/workflows/release_alpha.yml | 32 ++++++++++++++++- .github/workflows/release_docker_hub.yml | 16 +++------ docker/Dockerfile.GitHubActions.Dispatch | 36 +++++++++++++++++++ ...tions => Dockerfile.GitHubActions.Release} | 0 4 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 docker/Dockerfile.GitHubActions.Dispatch rename docker/{Dockerfile.GitHubActions => Dockerfile.GitHubActions.Release} (100%) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index f74906892aae8..0dc8bd5cb94f4 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -3,7 +3,7 @@ name: Build alpha release for Docker Hub on: workflow_dispatch: inputs: - name: + tag: description: 'Docker tag' required: true @@ -27,3 +27,33 @@ jobs: ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu make -j8 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker meta + id: docker_meta + uses: docker/metadata-action@v3 + with: + images: strophy/dashd + tags: | + type=semver,pattern={{version}},value={{github.event.workflow_dispatch.tag}} + type=raw,value=latest-dev + flavor: | + latest=false + + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./docker + file: ./docker/Dockerfile.GitHubActions.Dispatch + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + build-args: TAG=${{ steps.docker_meta.outputs.version }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/release_docker_hub.yml b/.github/workflows/release_docker_hub.yml index 9ceacdf71f9e2..24c46f1c981e2 100644 --- a/.github/workflows/release_docker_hub.yml +++ b/.github/workflows/release_docker_hub.yml @@ -52,22 +52,14 @@ jobs: uses: docker/build-push-action@v2 with: context: ./docker - file: ./docker/Dockerfile.GitHubActions + file: ./docker/Dockerfile.GitHubActions.Release push: true tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-args: TAG=${{ steps.docker_meta.outputs.version }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new - platforms: linux/amd64,linux/arm64,linux/arm/v7 - - - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64,linux/arm64 - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/docker/Dockerfile.GitHubActions.Dispatch b/docker/Dockerfile.GitHubActions.Dispatch new file mode 100644 index 0000000000000..a246b67988ec6 --- /dev/null +++ b/docker/Dockerfile.GitHubActions.Dispatch @@ -0,0 +1,36 @@ +FROM ubuntu:focal +LABEL maintainer="Dash Developers " +LABEL description="Dockerised DashCore" + +ARG USER_ID +ARG GROUP_ID +ARG TAG + +ENV HOME /dash + +# add user with specified (or default) user/group ids +ENV USER_ID ${USER_ID:-1000} +ENV GROUP_ID ${GROUP_ID:-1000} +RUN groupadd -g ${GROUP_ID} dash && \ + useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /dash dash && \ + mkdir /dash/.dashcore && \ + chown dash:dash -R /dash + +RUN apt-get update && \ + apt-get -y install --no-install-recommends \ + wget \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +COPY ../depends/x86_64-pc-linux-gnu/bin/dash* /usr/local/bin + +USER dash + +VOLUME ["/dash"] + +COPY docker-entrypoint.sh /docker-entrypoint.sh +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9998 9999 19998 19999 + +WORKDIR /dash diff --git a/docker/Dockerfile.GitHubActions b/docker/Dockerfile.GitHubActions.Release similarity index 100% rename from docker/Dockerfile.GitHubActions rename to docker/Dockerfile.GitHubActions.Release From db4b2e0dcf687aa114556706d4e84e0b4eb2db4b Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 4 Jan 2022 22:43:53 -0500 Subject: [PATCH 06/38] chore: dockerize build --- .github/workflows/release_alpha.yml | 13 ------------ docker/Dockerfile.GitHubActions.Dispatch | 27 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 0dc8bd5cb94f4..a68c9b943694e 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -15,18 +15,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Build depends - run: | - cd depends - make -j8 - cd .. - - - name: Build Dash - run: | - ./autogen.sh - ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu - make -j8 - - name: Login to DockerHub uses: docker/login-action@v1 with: @@ -48,7 +36,6 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - context: ./docker file: ./docker/Dockerfile.GitHubActions.Dispatch push: true tags: ${{ steps.docker_meta.outputs.tags }} diff --git a/docker/Dockerfile.GitHubActions.Dispatch b/docker/Dockerfile.GitHubActions.Dispatch index a246b67988ec6..917c66e30de65 100644 --- a/docker/Dockerfile.GitHubActions.Dispatch +++ b/docker/Dockerfile.GitHubActions.Dispatch @@ -1,3 +1,26 @@ +# syntax=docker/dockerfile:1.3 + +FROM ubuntu:focal as builder +RUN apt-get update && \ + apt-get -y install --no-install-recommends \ + automake \ + autotools-dev \ + bsdmainutils \ + build-essential \ + ca-certificates \ + curl \ + libtool \ + pkg-config \ + python3 \ + wget \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /dash + +COPY . . + +RUN make -C depends -j`grep processor /proc/cpuinfo | wc -l` + FROM ubuntu:focal LABEL maintainer="Dash Developers " LABEL description="Dockerised DashCore" @@ -22,13 +45,13 @@ RUN apt-get update && \ ca-certificates \ && rm -rf /var/lib/apt/lists/* -COPY ../depends/x86_64-pc-linux-gnu/bin/dash* /usr/local/bin +COPY --from=builder /dash/depends/x86_64-pc-linux-gnu/bin/dash* /usr/local/bin USER dash VOLUME ["/dash"] -COPY docker-entrypoint.sh /docker-entrypoint.sh +COPY docker/docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 9998 9999 19998 19999 From 58a556b95d2811b413856d9ee8584d127291fd28 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 4 Jan 2022 22:56:26 -0500 Subject: [PATCH 07/38] chore: remove unnecessary cachedir and checkout steps --- .github/workflows/release_alpha.yml | 7 +++++-- .github/workflows/release_docker_hub.yml | 8 -------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index a68c9b943694e..606d46d1ddeec 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -12,8 +12,11 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 diff --git a/.github/workflows/release_docker_hub.yml b/.github/workflows/release_docker_hub.yml index 24c46f1c981e2..51c9b458fef55 100644 --- a/.github/workflows/release_docker_hub.yml +++ b/.github/workflows/release_docker_hub.yml @@ -18,14 +18,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Login to DockerHub uses: docker/login-action@v1 with: From fb8b7f9dc7ada4bef20dfda64cbce6f7a8d0409a Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 5 Jan 2022 10:55:09 -0500 Subject: [PATCH 08/38] chore: disable qemu --- .github/workflows/release_alpha.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 606d46d1ddeec..882d31478d1f8 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -12,8 +12,8 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 From ecda587468ee52943f6d3ee94a0cd64150443f8d Mon Sep 17 00:00:00 2001 From: strophy Date: Thu, 6 Jan 2022 14:58:41 -0500 Subject: [PATCH 09/38] chore: remove buildx steps now included in AMI --- .github/workflows/release_alpha.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 882d31478d1f8..23fc8ba1ee8ea 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -12,12 +12,6 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub uses: docker/login-action@v1 with: From 6a2a5cd17571ea8b31582fe48bb75f7f88100327 Mon Sep 17 00:00:00 2001 From: strophy Date: Thu, 6 Jan 2022 14:59:02 -0500 Subject: [PATCH 10/38] chore: move binaries in to place for second stage copy --- docker/Dockerfile.GitHubActions.Dispatch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.GitHubActions.Dispatch b/docker/Dockerfile.GitHubActions.Dispatch index 917c66e30de65..59854052d3791 100644 --- a/docker/Dockerfile.GitHubActions.Dispatch +++ b/docker/Dockerfile.GitHubActions.Dispatch @@ -19,7 +19,11 @@ WORKDIR /dash COPY . . -RUN make -C depends -j`grep processor /proc/cpuinfo | wc -l` +RUN make -C depends -j`grep processor /proc/cpuinfo | wc -l` && \ + ./autogen.sh && \ + ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu && \ + make -j`grep processor /proc/cpuinfo | wc -l` && \ + make install FROM ubuntu:focal LABEL maintainer="Dash Developers " From c9a700117ef636103c008d87b0cc25228f66f08e Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 10 Jan 2022 15:39:37 -0500 Subject: [PATCH 11/38] fix: runner using incorrect build driver --- .github/workflows/release_alpha.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 23fc8ba1ee8ea..5022ca6387e74 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -35,6 +35,7 @@ jobs: with: file: ./docker/Dockerfile.GitHubActions.Dispatch push: true + builder: multiarch tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-args: TAG=${{ steps.docker_meta.outputs.version }} From 8dc2b17987eb9a88ad5764e1894b6bc62b672f8d Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 10 Jan 2022 15:44:07 -0500 Subject: [PATCH 12/38] chore: debug builder info --- .github/workflows/release_alpha.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 5022ca6387e74..bf2c671cbcf17 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -29,6 +29,11 @@ jobs: flavor: | latest=false + - name: Debug builder + run: | + ls /home/ubuntu/.docker/buildx/instances/ + cat /home/ubuntu/.docker/buildx/instances/multiarch + - name: Build and push Docker image id: docker_build uses: docker/build-push-action@v2 From 58d4275f0f9f1c8668fcf042c166482c3ebc5726 Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 10 Jan 2022 15:45:10 -0500 Subject: [PATCH 13/38] chore: more detailed debug --- .github/workflows/release_alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index bf2c671cbcf17..a97edb3448ddf 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -31,7 +31,7 @@ jobs: - name: Debug builder run: | - ls /home/ubuntu/.docker/buildx/instances/ + ls /home/ubuntu/.docker/buildx/instances/ -lha cat /home/ubuntu/.docker/buildx/instances/multiarch - name: Build and push Docker image From ee25f80049077a50cf19a522cd279982a464659a Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 10 Jan 2022 16:06:11 -0500 Subject: [PATCH 14/38] chore: install qemu and buildx in actions --- .github/workflows/release_alpha.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index a97edb3448ddf..9fddc841180df 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -12,6 +12,15 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: + - name: Set up QEMU to run multi-arch builds + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker BuildX + id: buildx + uses: docker/setup-buildx-action@v1 + with: + install: true + - name: Login to DockerHub uses: docker/login-action@v1 with: From b1d3b026dc8f9bdc080be010d55cdb59ed5b9595 Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 10 Jan 2022 16:06:49 -0500 Subject: [PATCH 15/38] fix: indentation --- .github/workflows/release_alpha.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 9fddc841180df..bad6db6313ead 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -12,14 +12,14 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: - - name: Set up QEMU to run multi-arch builds - uses: docker/setup-qemu-action@v1 + - name: Set up QEMU to run multi-arch builds + uses: docker/setup-qemu-action@v1 - - name: Set up Docker BuildX - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true + - name: Set up Docker BuildX + id: buildx + uses: docker/setup-buildx-action@v1 + with: + install: true - name: Login to DockerHub uses: docker/login-action@v1 From 3851f0d52f37cda5851603f0ad4c93c48b891aa3 Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 10 Jan 2022 16:16:15 -0500 Subject: [PATCH 16/38] fix: remove debug code --- .github/workflows/release_alpha.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index bad6db6313ead..7f3897fe32c06 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -38,18 +38,12 @@ jobs: flavor: | latest=false - - name: Debug builder - run: | - ls /home/ubuntu/.docker/buildx/instances/ -lha - cat /home/ubuntu/.docker/buildx/instances/multiarch - - name: Build and push Docker image id: docker_build uses: docker/build-push-action@v2 with: file: ./docker/Dockerfile.GitHubActions.Dispatch push: true - builder: multiarch tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} build-args: TAG=${{ steps.docker_meta.outputs.version }} From f2d50d8f906f06c146f3af5e04d9bc09489e2309 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 11 Jan 2022 15:22:35 -0500 Subject: [PATCH 17/38] feat: multi-arch cross-compiling dockerfile --- docker/Dockerfile.GitHubActions.Dispatch | 36 +++++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile.GitHubActions.Dispatch b/docker/Dockerfile.GitHubActions.Dispatch index 59854052d3791..c06c938ec91f9 100644 --- a/docker/Dockerfile.GitHubActions.Dispatch +++ b/docker/Dockerfile.GitHubActions.Dispatch @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -FROM ubuntu:focal as builder +FROM --platform=$BUILDPLATFORM ubuntu:focal as builder RUN apt-get update && \ apt-get -y install --no-install-recommends \ automake \ @@ -9,6 +9,7 @@ RUN apt-get update && \ build-essential \ ca-certificates \ curl \ + g++-arm-linux-gnueabihf \ libtool \ pkg-config \ python3 \ @@ -19,11 +20,32 @@ WORKDIR /dash COPY . . -RUN make -C depends -j`grep processor /proc/cpuinfo | wc -l` && \ - ./autogen.sh && \ - ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu && \ - make -j`grep processor /proc/cpuinfo | wc -l` && \ - make install +ARG TARGETPLATFORM + +RUN case "$TARGETPLATFORM" in \ + "linux/arm64") make HOST=arm-linux-gnueabihf -C depends -j`grep processor /proc/cpuinfo | wc -l` ;; \ + "linux/amd64") make HOST=x86_64-pc-linux-gnu -C depends -j`grep processor /proc/cpuinfo | wc -l` ;; \ + *) exit 1 ;; \ +esac + +RUN ./autogen.sh + +RUN case "$TARGETPLATFORM" in \ + "linux/arm64") ./configure --prefix=`pwd`/depends/arm-linux-gnueabihf ;; \ + "linux/amd64") ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu ;; \ + *) exit 1 ;; \ +esac + +RUN make -j`grep processor /proc/cpuinfo | wc -l` +RUN make install + +RUN mkdir built-target + +RUN case "$TARGETPLATFORM" in \ + "linux/arm64") cp depends/arm-linux-gnueabihf/bin/dash* /dash/built-target ;; \ + "linux/amd64") cp depends/x86_64-pc-linux-gnu/bin/dash* /dash/built-target ;; \ + *) exit 1 ;; \ +esac FROM ubuntu:focal LABEL maintainer="Dash Developers " @@ -49,7 +71,7 @@ RUN apt-get update && \ ca-certificates \ && rm -rf /var/lib/apt/lists/* -COPY --from=builder /dash/depends/x86_64-pc-linux-gnu/bin/dash* /usr/local/bin +COPY --from=builder /dash/built-target/dash* /usr/local/bin USER dash From 15ebdeb208dd95774923f596eed2995787eb60bd Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 12 Jan 2022 11:03:40 -0500 Subject: [PATCH 18/38] chore: remove unnecessary docker layers --- docker/Dockerfile.GitHubActions.Dispatch | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile.GitHubActions.Dispatch b/docker/Dockerfile.GitHubActions.Dispatch index c06c938ec91f9..908fe3fd95cd6 100644 --- a/docker/Dockerfile.GitHubActions.Dispatch +++ b/docker/Dockerfile.GitHubActions.Dispatch @@ -23,28 +23,23 @@ COPY . . ARG TARGETPLATFORM RUN case "$TARGETPLATFORM" in \ - "linux/arm64") make HOST=arm-linux-gnueabihf -C depends -j`grep processor /proc/cpuinfo | wc -l` ;; \ - "linux/amd64") make HOST=x86_64-pc-linux-gnu -C depends -j`grep processor /proc/cpuinfo | wc -l` ;; \ + "linux/arm64") make HOST=arm-linux-gnueabihf -C depends -j`nproc | awk '{x=$1/2; print x}'` ;; \ + "linux/amd64") make HOST=x86_64-pc-linux-gnu -C depends -j`nproc | awk '{x=$1/2; print x}'` ;; \ *) exit 1 ;; \ esac -RUN ./autogen.sh - -RUN case "$TARGETPLATFORM" in \ +RUN ./autogen.sh && \ + case "$TARGETPLATFORM" in \ "linux/arm64") ./configure --prefix=`pwd`/depends/arm-linux-gnueabihf ;; \ "linux/amd64") ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu ;; \ - *) exit 1 ;; \ esac -RUN make -j`grep processor /proc/cpuinfo | wc -l` -RUN make install +RUN make -j`nproc | awk '{x=$1/2; print x}'` && make install -RUN mkdir built-target - -RUN case "$TARGETPLATFORM" in \ +RUN mkdir built-target && \ + case "$TARGETPLATFORM" in \ "linux/arm64") cp depends/arm-linux-gnueabihf/bin/dash* /dash/built-target ;; \ "linux/amd64") cp depends/x86_64-pc-linux-gnu/bin/dash* /dash/built-target ;; \ - *) exit 1 ;; \ esac FROM ubuntu:focal From 856253266cd78f01c3a382c9b097a390a0e36040 Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 12 Jan 2022 15:49:42 -0500 Subject: [PATCH 19/38] chore: add debug output --- .github/workflows/release_alpha.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 7f3897fe32c06..6d371882c066b 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -27,6 +27,18 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Debug event + run: | + echo {{github.event}} + + - name: Debug workflow dispatch + run: | + echo {{github.event.workflow_dispatch}} + + - name: Debug tag + run: | + echo {{github.event.workflow_dispatch.tag}} + - name: Docker meta id: docker_meta uses: docker/metadata-action@v3 From 1fe0c35a13b7f6294f52dc2580b2742a569ab17b Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 12 Jan 2022 15:56:45 -0500 Subject: [PATCH 20/38] chore: dump context --- .github/workflows/release_alpha.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 6d371882c066b..a77ddcaf3ca10 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -27,6 +27,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Dump context + uses: crazy-max/ghaction-dump-context@v1 + - name: Debug event run: | echo {{github.event}} From acdfb0beea90809c21c9a23570f71818e447dd0c Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 12 Jan 2022 15:58:57 -0500 Subject: [PATCH 21/38] fix: use event inputs tag for docker_meta --- .github/workflows/release_alpha.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index a77ddcaf3ca10..62283158601c3 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -27,28 +27,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Dump context - uses: crazy-max/ghaction-dump-context@v1 - - - name: Debug event - run: | - echo {{github.event}} - - - name: Debug workflow dispatch - run: | - echo {{github.event.workflow_dispatch}} - - - name: Debug tag - run: | - echo {{github.event.workflow_dispatch.tag}} - - name: Docker meta id: docker_meta uses: docker/metadata-action@v3 with: images: strophy/dashd tags: | - type=semver,pattern={{version}},value={{github.event.workflow_dispatch.tag}} + type=semver,pattern={{version}},value={{github.event.inputs.tag}} type=raw,value=latest-dev flavor: | latest=false From 2818864ea0ce8457f163a1136c477228448f03c3 Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 12 Jan 2022 16:00:42 -0500 Subject: [PATCH 22/38] chore: dump context again --- .github/workflows/release_alpha.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 62283158601c3..facba3cfc3e9e 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -27,13 +27,16 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Dump context + uses: crazy-max/ghaction-dump-context@v1 + - name: Docker meta id: docker_meta uses: docker/metadata-action@v3 with: images: strophy/dashd tags: | - type=semver,pattern={{version}},value={{github.event.inputs.tag}} + type=semver,pattern={{version}},value={{github.event.workflow_dispatch.inputs.tag}} type=raw,value=latest-dev flavor: | latest=false From 100a5969aa461389666282cc8d78098403dda94b Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 12 Jan 2022 16:03:50 -0500 Subject: [PATCH 23/38] fix: context reference syntax --- .github/workflows/release_alpha.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index facba3cfc3e9e..59404a4a3de5c 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -27,16 +27,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Dump context - uses: crazy-max/ghaction-dump-context@v1 - - name: Docker meta id: docker_meta uses: docker/metadata-action@v3 with: images: strophy/dashd tags: | - type=semver,pattern={{version}},value={{github.event.workflow_dispatch.inputs.tag}} + type=semver,pattern={{version}},value=${{github.event.inputs.tag}} type=raw,value=latest-dev flavor: | latest=false From a1505e8706944bb9f23d7e7094dbdf176f622105 Mon Sep 17 00:00:00 2001 From: strophy Date: Wed, 19 Jan 2022 13:00:43 -0500 Subject: [PATCH 24/38] feat: attempt to use gitian builder --- .github/workflows/release_alpha.yml | 65 +++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 59404a4a3de5c..7dc2c92eddf0a 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -27,6 +27,37 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Checkout + uses: actions/checkout@v2 + with: + path: dash + + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: devrandom/gitian-builder + path: gitian-builder + + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: dashpay/dash-detached-sigs + path: dash-detached-sigs + + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: dashpay/gitian.sigs + path: gitian.sigs + + - name: Clone macOS SDK + run: | + mkdir gitian-builder/inputs + wget -q -O gitian-builder/inputs/MacOSX10.11.sdk.tar.gz https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz + + - name: Import GPG key + run: echo ${{GPG_PRIVATE_KEY}} | gpg --import + - name: Docker meta id: docker_meta uses: docker/metadata-action@v3 @@ -38,15 +69,25 @@ jobs: flavor: | latest=false - - name: Build and push Docker image - id: docker_build - uses: docker/build-push-action@v2 - with: - file: ./docker/Dockerfile.GitHubActions.Dispatch - push: true - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} - build-args: TAG=${{ steps.docker_meta.outputs.version }} - cache-from: type=gha - cache-to: type=gha,mode=max - platforms: linux/amd64,linux/arm64 + - name: Prepare Gitian + run: dash/contrib/gitian-build.py --setup "Leon White" "${{steps.docker_meta.outputs.tags}}" + + - name: Run Gitian build + run: dash/contrib/gitian-build.py -b -n -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` "Leon White" "${{steps.docker_meta.outputs.tags}}" + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + + + # - name: Build and push Docker image + # id: docker_build + # uses: docker/build-push-action@v2 + # with: + # file: ./docker/Dockerfile.GitHubActions.Dispatch + # push: true + # tags: ${{ steps.docker_meta.outputs.tags }} + # labels: ${{ steps.docker_meta.outputs.labels }} + # build-args: TAG=${{ steps.docker_meta.outputs.version }} + # cache-from: type=gha + # cache-to: type=gha,mode=max + # platforms: linux/amd64,linux/arm64 From daece1c50597e603f4f6027bf93240a0771eb5d3 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 8 Mar 2022 15:58:07 +1100 Subject: [PATCH 25/38] chore: ff changes from other branches --- .github/workflows/release_alpha.yml | 116 ++++++--- .../deploy/Dockerfile.GitHubActions.Gitian | 46 ++++ contrib/gitian-build.py | 12 +- .../gitian-linux-64-only.yml | 226 ++++++++++++++++++ 4 files changed, 362 insertions(+), 38 deletions(-) create mode 100644 contrib/containers/deploy/Dockerfile.GitHubActions.Gitian create mode 100755 contrib/gitian-descriptors/gitian-linux-64-only.yml diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 7dc2c92eddf0a..4bf3708db059d 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -1,4 +1,4 @@ -name: Build alpha release for Docker Hub +name: Build and push image on: workflow_dispatch: @@ -12,20 +12,42 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: - - name: Set up QEMU to run multi-arch builds - uses: docker/setup-qemu-action@v1 + - name: Checkout + uses: actions/checkout@v2 + with: + path: dash + + - name: Checkout Gitian builder + uses: actions/checkout@v2 + with: + repository: devrandom/gitian-builder + path: gitian-builder - - name: Set up Docker BuildX - id: buildx - uses: docker/setup-buildx-action@v1 + - name: Checkout detached sigs + uses: actions/checkout@v2 with: - install: true + repository: dashpay/dash-detached-sigs + path: dash-detached-sigs - - name: Login to DockerHub - uses: docker/login-action@v1 + - name: Checkout gitian sigs + uses: actions/checkout@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: dashpay/gitian.sigs + path: gitian.sigs + + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + + - name: GPG user IDs + run: | + echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" + echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" + echo "name: ${{ steps.import_gpg.outputs.name }}" + echo "email: ${{ steps.import_gpg.outputs.email }}" - name: Checkout uses: actions/checkout@v2 @@ -64,30 +86,62 @@ jobs: with: images: strophy/dashd tags: | - type=semver,pattern={{version}},value=${{github.event.inputs.tag}} + type=semver,pattern={{version}},value=${{ github.event.inputs.tag }} type=raw,value=latest-dev flavor: | latest=false + - name: Install apt-cacher-ng + run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-cacher-ng + + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v5 + - name: Prepare Gitian - run: dash/contrib/gitian-build.py --setup "Leon White" "${{steps.docker_meta.outputs.tags}}" + run: dash/contrib/gitian-build.py --setup "strophy" "${{ steps.branch-name.outputs.current_branch }}" + + - uses: pat-s/always-upload-cache@v2 + id: ccache + with: + path: /opt/actions-runner/_work/dash/dash/gitian-builder/cache/dash-linux-0.17 + key: ${{ runner.os }}-ccache-${{ hashFiles('**/ccache.tar') }} + restore-keys: ${{ runner.os }}-ccache- - name: Run Gitian build - run: dash/contrib/gitian-build.py -b -n -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` "Leon White" "${{steps.docker_meta.outputs.tags}}" - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - - # - name: Build and push Docker image - # id: docker_build - # uses: docker/build-push-action@v2 - # with: - # file: ./docker/Dockerfile.GitHubActions.Dispatch - # push: true - # tags: ${{ steps.docker_meta.outputs.tags }} - # labels: ${{ steps.docker_meta.outputs.labels }} - # build-args: TAG=${{ steps.docker_meta.outputs.version }} - # cache-from: type=gha - # cache-to: type=gha,mode=max - # platforms: linux/amd64,linux/arm64 + run: | + export GPG_TTY=$(tty) + dash/contrib/gitian-build.py -c -b -n -o l \ + -u https://github.com/strophy/dash \ + -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` \ + strophy ${{ steps.branch-name.outputs.current_branch }} + + - name: Set up QEMU to run multi-arch builds + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker BuildX + id: buildx + uses: docker/setup-buildx-action@v1 + with: + version: v0.7.0 + install: true + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ${{ github.workspace }} + file: ./dash/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + build-args: | + TAG=${{ steps.docker_meta.outputs.version }} + BRANCH=${{ steps.branch-name.outputs.current_branch }} diff --git a/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian b/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian new file mode 100644 index 0000000000000..57fa0c7213021 --- /dev/null +++ b/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian @@ -0,0 +1,46 @@ +# syntax=docker/dockerfile:1.3 +FROM ubuntu:focal +LABEL maintainer="Dash Developers " +LABEL description="Dockerised DashCore" + +ARG USER_ID +ARG GROUP_ID +ARG TAG +ARG BRANCH + +ENV HOME /dash + +# add user with specified (or default) user/group ids +ENV USER_ID ${USER_ID:-1000} +ENV GROUP_ID ${GROUP_ID:-1000} +RUN groupadd -g ${GROUP_ID} dash && \ + useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /dash dash && \ + mkdir /dash/.dashcore && \ + chown dash:dash -R /dash + +RUN apt-get update && \ + apt-get -y install --no-install-recommends \ + wget \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +COPY dashcore-binaries/${BRANCH}/dashcore* /dash + +RUN mach=$(uname -m) \ + && case $mach in aarch64) arch="aarch64-linux-gnu"; ;; x86_64) arch="x86_64-linux-gnu"; ;; *) echo "ERROR: Machine type $mach not supported."; ;; esac \ + && cd /dash \ + && tar xvzf dashcore*$arch.tar.gz \ + && echo $(ls -1 /dash) \ + && cp dashcore-0.17.0/bin/* /usr/local/bin \ + && rm -rf dash* + +USER dash + +VOLUME ["/dash"] + +COPY dash/contrib/containers/deploy/docker-entrypoint.sh /docker-entrypoint.sh +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9998 9999 19998 19999 + +WORKDIR /dash diff --git a/contrib/gitian-build.py b/contrib/gitian-build.py index 4fbd7416bcd1d..a16c8057c7d63 100755 --- a/contrib/gitian-build.py +++ b/contrib/gitian-build.py @@ -36,7 +36,8 @@ def setup(): if args.docker: make_image_prog += ['--docker'] elif args.lxc: - make_image_prog += ['--lxc', '--disksize', '13000'] + make_image_prog += ['--lxc'] + print('\nAbout to run ', make_image_prog ) subprocess.check_call(make_image_prog) os.chdir(workdir) if args.is_focal and not args.kvm and not args.docker: @@ -58,8 +59,8 @@ def build(): if args.linux: print('\nCompiling ' + args.version + ' Linux') - subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'dash='+args.commit, '--url', 'dash='+args.url, '../dash/contrib/gitian-descriptors/gitian-linux.yml']) - subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-linux', '--destination', '../gitian.sigs/', '../dash/contrib/gitian-descriptors/gitian-linux.yml']) + subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'dash='+args.commit, '--url', 'dash='+args.url, '../dash/contrib/gitian-descriptors/gitian-linux-64-only.yml']) + subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-linux', '--destination', '../gitian.sigs/', '../dash/contrib/gitian-descriptors/gitian-linux-64-only.yml']) subprocess.check_call('mv build/out/dashcore-*.tar.gz build/out/src/dashcore-*.tar.gz ../dashcore-binaries/'+args.version, shell=True) if args.windows: @@ -123,10 +124,7 @@ def verify(): os.chdir('gitian-builder') print('\nVerifying v'+args.version+' Linux\n') - if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-linux', '../dash/contrib/gitian-descriptors/gitian-linux.yml']): - print('Verifying v'+args.version+' Linux FAILED\n') - rc = 1 - + subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-linux', '../dash/contrib/gitian-descriptors/gitian-linux-64-only.yml']) print('\nVerifying v'+args.version+' Windows\n') if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-win-unsigned', '../dash/contrib/gitian-descriptors/gitian-win.yml']): print('Verifying v'+args.version+' Windows FAILED\n') diff --git a/contrib/gitian-descriptors/gitian-linux-64-only.yml b/contrib/gitian-descriptors/gitian-linux-64-only.yml new file mode 100755 index 0000000000000..10767b77a3e33 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-linux-64-only.yml @@ -0,0 +1,226 @@ +--- +name: "dash-linux-0.17" +enable_cache: true +suites: +- "bionic" +architectures: +- "amd64" +packages: +- "curl" +- "g++-aarch64-linux-gnu" +- "g++-7-aarch64-linux-gnu" +- "gcc-7-aarch64-linux-gnu" +- "binutils-aarch64-linux-gnu" +- "g++-7-multilib" +- "gcc-7-multilib" +- "binutils-gold" +- "git" +- "pkg-config" +- "autoconf" +- "libtool" +- "automake" +- "faketime" +- "bsdmainutils" +- "ca-certificates" +- "python" +- "python3" +- "libxkbcommon0" +- "ccache" +remotes: +- "url": "https://github.com/dashpay/dash.git" + "dir": "dash" +files: [] +script: | + + WRAP_DIR=$HOME/wrapped + HOSTS="x86_64-linux-gnu aarch64-linux-gnu" + CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests --enable-crash-hooks" + FAKETIME_HOST_PROGS="" + FAKETIME_PROGS="date ar ranlib nm" + HOST_CFLAGS="-O2 -g" + HOST_CXXFLAGS="-O2 -g" + HOST_LDFLAGS=-static-libstdc++ + + export QT_RCC_TEST=1 + export QT_RCC_SOURCE_DATE_OVERRIDE=1 + export GZIP="-9n" + export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export TZ="UTC" + export BUILD_DIR=`pwd` + mkdir -p ${WRAP_DIR} + if test -n "$GBUILD_CACHE_ENABLED"; then + export SOURCES_PATH=${GBUILD_COMMON_CACHE} + export BASE_CACHE=${GBUILD_PACKAGE_CACHE}/depends + mkdir -p ${BASE_CACHE} ${SOURCES_PATH} + + # Setup ccache to use correct cache directories and fix the compiler check of ccache + CONFIGFLAGS="${CONFIGFLAGS} --enable-ccache" + export CCACHE_DIR=${GBUILD_PACKAGE_CACHE}/ccache + # As we later wrap the gcc binaries, this is fast + export CCACHE_COMPILERCHECK="content" + if [ -f ${GBUILD_PACKAGE_CACHE}/ccache.tar ]; then + pushd ${GBUILD_PACKAGE_CACHE} + tar xf ccache.tar + rm ccache.tar + popd + fi + # instead of compressing ccache.tar, we let ccache handle it by itself + # Otherwise we end up uncompressing/compressing a lot of cache files which we actually never use + export CCACHE_COMPRESS=1 + else + CONFIGFLAGS="${CONFIGFLAGS} --disable-ccache" + fi + + # We include the GCC version in all wrappers so that ccache can detect compiler upgrades when hashing the wrappers + GCCVERSION=`gcc --version | head -1` + + function create_global_faketime_wrappers { + for prog in ${FAKETIME_PROGS}; do + echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog} + echo "# GCCVERSION=${GCCVERSION}" >> ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${prog} + done + } + + function create_per-host_faketime_wrappers { + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog} + echo "# GCCVERSION=${GCCVERSION}" >> ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${i}-${prog} + done + done + } + + # Faketime for depends so intermediate results are comparable + export PATH_orig=${PATH} + create_global_faketime_wrappers "2000-01-01 12:00:00" + create_per-host_faketime_wrappers "2000-01-01 12:00:00" + export PATH=${WRAP_DIR}:${PATH} + + EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes + mkdir -p $EXTRA_INCLUDES_BASE + + # x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm, + # but we can't write there. Instead, create a link here and force it to be included in the + # search paths by wrapping gcc/g++. + + mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu + rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm + ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm + + for prog in gcc g++; do + rm -f ${WRAP_DIR}/${prog} + cat << EOF > ${WRAP_DIR}/${prog} + #!/usr/bin/env bash + # GCCVERSION=${GCCVERSION} + REAL="`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1`" + for var in "\$@" + do + if [ "\$var" = "-m32" ]; then + export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu" + export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu" + break + fi + done + \$REAL \$@ + EOF + chmod +x ${WRAP_DIR}/${prog} + touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${prog} + done + + cd dash + BASEPREFIX=`pwd`/depends + # Build dependencies for each host + for i in $HOSTS; do + EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i" + if [ -d "$EXTRA_INCLUDES" ]; then + export HOST_ID_SALT="$EXTRA_INCLUDES" + fi + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + unset HOST_ID_SALT + done + + # Faketime for binaries + export PATH=${PATH_orig} + create_global_faketime_wrappers "${REFERENCE_DATETIME}" + create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" + export PATH=${WRAP_DIR}:${PATH} + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ + make dist + SOURCEDIST=`echo dashcore-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$SOURCEDIST + find dashcore-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST + popd + + # Workaround for tarball not building with the bare tag version (prep) + make -C src obj/build.h + + ORIGPATH="$PATH" + # Extract the release tarball into a dir for each host and build + for i in ${HOSTS}; do + export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} + mkdir -p distsrc-${i} + cd distsrc-${i} + INSTALLPATH=`pwd`/installed/${DISTNAME} + mkdir -p ${INSTALLPATH} + tar --strip-components=1 -xf ../$SOURCEDIST + + # Workaround for tarball not building with the bare tag version + echo '#!/bin/true' >share/genbuild.sh + mkdir src/obj + cp ../src/obj/build.h src/obj/ + + CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" + make ${MAKEOPTS} + make ${MAKEOPTS} -C src check-security + + #TODO: This is a quick hack that disables symbol checking for arm. + # Instead, we should investigate why these are popping up. + # For aarch64, we'll need to bump up the min GLIBC version, as the abi + # support wasn't introduced until 2.17. + case $i in + aarch64-*) : ;; + arm-*) : ;; + *) make ${MAKEOPTS} -C src check-symbols ;; + esac + + make install DESTDIR=${INSTALLPATH} + cd installed + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find ${DISTNAME}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \; + find ${DISTNAME}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \; + find ${DISTNAME} -not -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz + find ${DISTNAME} -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz + cd ../../ + rm -rf distsrc-${i} + done + mkdir -p $OUTDIR/src + mv $SOURCEDIST $OUTDIR/src + + # Compress ccache (otherwise the assert file will get too huge) + if [ "$CCACHE_DIR" != "" ]; then + pushd ${GBUILD_PACKAGE_CACHE} + tar cf ccache.tar ccache + rm -rf ccache + popd + fi From b2afa224a4925b458b85c8103790f5f41ef7a5f4 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 8 Mar 2022 16:00:09 +1100 Subject: [PATCH 26/38] chore: disable macOS build --- .github/workflows/release_alpha.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 4bf3708db059d..85710c27cace3 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -72,10 +72,10 @@ jobs: repository: dashpay/gitian.sigs path: gitian.sigs - - name: Clone macOS SDK - run: | - mkdir gitian-builder/inputs - wget -q -O gitian-builder/inputs/MacOSX10.11.sdk.tar.gz https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz + # - name: Clone macOS SDK + # run: | + # mkdir gitian-builder/inputs + # wget -q -O gitian-builder/inputs/MacOSX10.11.sdk.tar.gz https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz - name: Import GPG key run: echo ${{GPG_PRIVATE_KEY}} | gpg --import From d72c971eb57116c4815a33c5340fd7504dfe73b2 Mon Sep 17 00:00:00 2001 From: strophy Date: Thu, 10 Mar 2022 16:06:34 +1100 Subject: [PATCH 27/38] Revert "chore: ff changes from other branches" This reverts commit daece1c50597e603f4f6027bf93240a0771eb5d3. --- .github/workflows/release_alpha.yml | 116 +++------ .../deploy/Dockerfile.GitHubActions.Gitian | 46 ---- contrib/gitian-build.py | 12 +- .../gitian-linux-64-only.yml | 226 ------------------ 4 files changed, 38 insertions(+), 362 deletions(-) delete mode 100644 contrib/containers/deploy/Dockerfile.GitHubActions.Gitian delete mode 100755 contrib/gitian-descriptors/gitian-linux-64-only.yml diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 85710c27cace3..a9e74a4bf33fd 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -1,4 +1,4 @@ -name: Build and push image +name: Build alpha release for Docker Hub on: workflow_dispatch: @@ -12,42 +12,20 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: - - name: Checkout - uses: actions/checkout@v2 - with: - path: dash - - - name: Checkout Gitian builder - uses: actions/checkout@v2 - with: - repository: devrandom/gitian-builder - path: gitian-builder - - - name: Checkout detached sigs - uses: actions/checkout@v2 - with: - repository: dashpay/dash-detached-sigs - path: dash-detached-sigs + - name: Set up QEMU to run multi-arch builds + uses: docker/setup-qemu-action@v1 - - name: Checkout gitian sigs - uses: actions/checkout@v2 + - name: Set up Docker BuildX + id: buildx + uses: docker/setup-buildx-action@v1 with: - repository: dashpay/gitian.sigs - path: gitian.sigs + install: true - - name: Import GPG key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v4 + - name: Login to DockerHub + uses: docker/login-action@v1 with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} - - - name: GPG user IDs - run: | - echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" - echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" - echo "name: ${{ steps.import_gpg.outputs.name }}" - echo "email: ${{ steps.import_gpg.outputs.email }}" + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Checkout uses: actions/checkout@v2 @@ -86,62 +64,30 @@ jobs: with: images: strophy/dashd tags: | - type=semver,pattern={{version}},value=${{ github.event.inputs.tag }} + type=semver,pattern={{version}},value=${{github.event.inputs.tag}} type=raw,value=latest-dev flavor: | latest=false - - name: Install apt-cacher-ng - run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-cacher-ng - - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v5 - - name: Prepare Gitian - run: dash/contrib/gitian-build.py --setup "strophy" "${{ steps.branch-name.outputs.current_branch }}" - - - uses: pat-s/always-upload-cache@v2 - id: ccache - with: - path: /opt/actions-runner/_work/dash/dash/gitian-builder/cache/dash-linux-0.17 - key: ${{ runner.os }}-ccache-${{ hashFiles('**/ccache.tar') }} - restore-keys: ${{ runner.os }}-ccache- + run: dash/contrib/gitian-build.py --setup "Leon White" "${{steps.docker_meta.outputs.tags}}" - name: Run Gitian build - run: | - export GPG_TTY=$(tty) - dash/contrib/gitian-build.py -c -b -n -o l \ - -u https://github.com/strophy/dash \ - -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` \ - strophy ${{ steps.branch-name.outputs.current_branch }} - - - name: Set up QEMU to run multi-arch builds - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker BuildX - id: buildx - uses: docker/setup-buildx-action@v1 - with: - version: v0.7.0 - install: true - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ${{ github.workspace }} - file: ./dash/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian - push: true - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} - platforms: linux/amd64,linux/arm64 - build-args: | - TAG=${{ steps.docker_meta.outputs.version }} - BRANCH=${{ steps.branch-name.outputs.current_branch }} + run: dash/contrib/gitian-build.py -b -n -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` "Leon White" "${{steps.docker_meta.outputs.tags}}" + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + + + # - name: Build and push Docker image + # id: docker_build + # uses: docker/build-push-action@v2 + # with: + # file: ./docker/Dockerfile.GitHubActions.Dispatch + # push: true + # tags: ${{ steps.docker_meta.outputs.tags }} + # labels: ${{ steps.docker_meta.outputs.labels }} + # build-args: TAG=${{ steps.docker_meta.outputs.version }} + # cache-from: type=gha + # cache-to: type=gha,mode=max + # platforms: linux/amd64,linux/arm64 diff --git a/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian b/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian deleted file mode 100644 index 57fa0c7213021..0000000000000 --- a/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian +++ /dev/null @@ -1,46 +0,0 @@ -# syntax=docker/dockerfile:1.3 -FROM ubuntu:focal -LABEL maintainer="Dash Developers " -LABEL description="Dockerised DashCore" - -ARG USER_ID -ARG GROUP_ID -ARG TAG -ARG BRANCH - -ENV HOME /dash - -# add user with specified (or default) user/group ids -ENV USER_ID ${USER_ID:-1000} -ENV GROUP_ID ${GROUP_ID:-1000} -RUN groupadd -g ${GROUP_ID} dash && \ - useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /dash dash && \ - mkdir /dash/.dashcore && \ - chown dash:dash -R /dash - -RUN apt-get update && \ - apt-get -y install --no-install-recommends \ - wget \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* - -COPY dashcore-binaries/${BRANCH}/dashcore* /dash - -RUN mach=$(uname -m) \ - && case $mach in aarch64) arch="aarch64-linux-gnu"; ;; x86_64) arch="x86_64-linux-gnu"; ;; *) echo "ERROR: Machine type $mach not supported."; ;; esac \ - && cd /dash \ - && tar xvzf dashcore*$arch.tar.gz \ - && echo $(ls -1 /dash) \ - && cp dashcore-0.17.0/bin/* /usr/local/bin \ - && rm -rf dash* - -USER dash - -VOLUME ["/dash"] - -COPY dash/contrib/containers/deploy/docker-entrypoint.sh /docker-entrypoint.sh -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 9998 9999 19998 19999 - -WORKDIR /dash diff --git a/contrib/gitian-build.py b/contrib/gitian-build.py index a16c8057c7d63..4fbd7416bcd1d 100755 --- a/contrib/gitian-build.py +++ b/contrib/gitian-build.py @@ -36,8 +36,7 @@ def setup(): if args.docker: make_image_prog += ['--docker'] elif args.lxc: - make_image_prog += ['--lxc'] - print('\nAbout to run ', make_image_prog ) + make_image_prog += ['--lxc', '--disksize', '13000'] subprocess.check_call(make_image_prog) os.chdir(workdir) if args.is_focal and not args.kvm and not args.docker: @@ -59,8 +58,8 @@ def build(): if args.linux: print('\nCompiling ' + args.version + ' Linux') - subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'dash='+args.commit, '--url', 'dash='+args.url, '../dash/contrib/gitian-descriptors/gitian-linux-64-only.yml']) - subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-linux', '--destination', '../gitian.sigs/', '../dash/contrib/gitian-descriptors/gitian-linux-64-only.yml']) + subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'dash='+args.commit, '--url', 'dash='+args.url, '../dash/contrib/gitian-descriptors/gitian-linux.yml']) + subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-linux', '--destination', '../gitian.sigs/', '../dash/contrib/gitian-descriptors/gitian-linux.yml']) subprocess.check_call('mv build/out/dashcore-*.tar.gz build/out/src/dashcore-*.tar.gz ../dashcore-binaries/'+args.version, shell=True) if args.windows: @@ -124,7 +123,10 @@ def verify(): os.chdir('gitian-builder') print('\nVerifying v'+args.version+' Linux\n') - subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-linux', '../dash/contrib/gitian-descriptors/gitian-linux-64-only.yml']) + if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-linux', '../dash/contrib/gitian-descriptors/gitian-linux.yml']): + print('Verifying v'+args.version+' Linux FAILED\n') + rc = 1 + print('\nVerifying v'+args.version+' Windows\n') if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-win-unsigned', '../dash/contrib/gitian-descriptors/gitian-win.yml']): print('Verifying v'+args.version+' Windows FAILED\n') diff --git a/contrib/gitian-descriptors/gitian-linux-64-only.yml b/contrib/gitian-descriptors/gitian-linux-64-only.yml deleted file mode 100755 index 10767b77a3e33..0000000000000 --- a/contrib/gitian-descriptors/gitian-linux-64-only.yml +++ /dev/null @@ -1,226 +0,0 @@ ---- -name: "dash-linux-0.17" -enable_cache: true -suites: -- "bionic" -architectures: -- "amd64" -packages: -- "curl" -- "g++-aarch64-linux-gnu" -- "g++-7-aarch64-linux-gnu" -- "gcc-7-aarch64-linux-gnu" -- "binutils-aarch64-linux-gnu" -- "g++-7-multilib" -- "gcc-7-multilib" -- "binutils-gold" -- "git" -- "pkg-config" -- "autoconf" -- "libtool" -- "automake" -- "faketime" -- "bsdmainutils" -- "ca-certificates" -- "python" -- "python3" -- "libxkbcommon0" -- "ccache" -remotes: -- "url": "https://github.com/dashpay/dash.git" - "dir": "dash" -files: [] -script: | - - WRAP_DIR=$HOME/wrapped - HOSTS="x86_64-linux-gnu aarch64-linux-gnu" - CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests --enable-crash-hooks" - FAKETIME_HOST_PROGS="" - FAKETIME_PROGS="date ar ranlib nm" - HOST_CFLAGS="-O2 -g" - HOST_CXXFLAGS="-O2 -g" - HOST_LDFLAGS=-static-libstdc++ - - export QT_RCC_TEST=1 - export QT_RCC_SOURCE_DATE_OVERRIDE=1 - export GZIP="-9n" - export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export TZ="UTC" - export BUILD_DIR=`pwd` - mkdir -p ${WRAP_DIR} - if test -n "$GBUILD_CACHE_ENABLED"; then - export SOURCES_PATH=${GBUILD_COMMON_CACHE} - export BASE_CACHE=${GBUILD_PACKAGE_CACHE}/depends - mkdir -p ${BASE_CACHE} ${SOURCES_PATH} - - # Setup ccache to use correct cache directories and fix the compiler check of ccache - CONFIGFLAGS="${CONFIGFLAGS} --enable-ccache" - export CCACHE_DIR=${GBUILD_PACKAGE_CACHE}/ccache - # As we later wrap the gcc binaries, this is fast - export CCACHE_COMPILERCHECK="content" - if [ -f ${GBUILD_PACKAGE_CACHE}/ccache.tar ]; then - pushd ${GBUILD_PACKAGE_CACHE} - tar xf ccache.tar - rm ccache.tar - popd - fi - # instead of compressing ccache.tar, we let ccache handle it by itself - # Otherwise we end up uncompressing/compressing a lot of cache files which we actually never use - export CCACHE_COMPRESS=1 - else - CONFIGFLAGS="${CONFIGFLAGS} --disable-ccache" - fi - - # We include the GCC version in all wrappers so that ccache can detect compiler upgrades when hashing the wrappers - GCCVERSION=`gcc --version | head -1` - - function create_global_faketime_wrappers { - for prog in ${FAKETIME_PROGS}; do - echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog} - echo "# GCCVERSION=${GCCVERSION}" >> ${WRAP_DIR}/${prog} - echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} - echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} - echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${prog} - chmod +x ${WRAP_DIR}/${prog} - touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${prog} - done - } - - function create_per-host_faketime_wrappers { - for i in $HOSTS; do - for prog in ${FAKETIME_HOST_PROGS}; do - echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog} - echo "# GCCVERSION=${GCCVERSION}" >> ${WRAP_DIR}/${i}-${prog} - echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} - echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} - echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} - chmod +x ${WRAP_DIR}/${i}-${prog} - touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${i}-${prog} - done - done - } - - # Faketime for depends so intermediate results are comparable - export PATH_orig=${PATH} - create_global_faketime_wrappers "2000-01-01 12:00:00" - create_per-host_faketime_wrappers "2000-01-01 12:00:00" - export PATH=${WRAP_DIR}:${PATH} - - EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes - mkdir -p $EXTRA_INCLUDES_BASE - - # x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm, - # but we can't write there. Instead, create a link here and force it to be included in the - # search paths by wrapping gcc/g++. - - mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu - rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm - ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm - - for prog in gcc g++; do - rm -f ${WRAP_DIR}/${prog} - cat << EOF > ${WRAP_DIR}/${prog} - #!/usr/bin/env bash - # GCCVERSION=${GCCVERSION} - REAL="`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1`" - for var in "\$@" - do - if [ "\$var" = "-m32" ]; then - export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu" - export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu" - break - fi - done - \$REAL \$@ - EOF - chmod +x ${WRAP_DIR}/${prog} - touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${prog} - done - - cd dash - BASEPREFIX=`pwd`/depends - # Build dependencies for each host - for i in $HOSTS; do - EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i" - if [ -d "$EXTRA_INCLUDES" ]; then - export HOST_ID_SALT="$EXTRA_INCLUDES" - fi - make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" - unset HOST_ID_SALT - done - - # Faketime for binaries - export PATH=${PATH_orig} - create_global_faketime_wrappers "${REFERENCE_DATETIME}" - create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" - export PATH=${WRAP_DIR}:${PATH} - - # Create the release tarball using (arbitrarily) the first host - ./autogen.sh - CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ - make dist - SOURCEDIST=`echo dashcore-*.tar.gz` - DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` - # Correct tar file order - mkdir -p temp - pushd temp - tar xf ../$SOURCEDIST - find dashcore-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST - popd - - # Workaround for tarball not building with the bare tag version (prep) - make -C src obj/build.h - - ORIGPATH="$PATH" - # Extract the release tarball into a dir for each host and build - for i in ${HOSTS}; do - export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} - mkdir -p distsrc-${i} - cd distsrc-${i} - INSTALLPATH=`pwd`/installed/${DISTNAME} - mkdir -p ${INSTALLPATH} - tar --strip-components=1 -xf ../$SOURCEDIST - - # Workaround for tarball not building with the bare tag version - echo '#!/bin/true' >share/genbuild.sh - mkdir src/obj - cp ../src/obj/build.h src/obj/ - - CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" - make ${MAKEOPTS} - make ${MAKEOPTS} -C src check-security - - #TODO: This is a quick hack that disables symbol checking for arm. - # Instead, we should investigate why these are popping up. - # For aarch64, we'll need to bump up the min GLIBC version, as the abi - # support wasn't introduced until 2.17. - case $i in - aarch64-*) : ;; - arm-*) : ;; - *) make ${MAKEOPTS} -C src check-symbols ;; - esac - - make install DESTDIR=${INSTALLPATH} - cd installed - find . -name "lib*.la" -delete - find . -name "lib*.a" -delete - rm -rf ${DISTNAME}/lib/pkgconfig - find ${DISTNAME}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \; - find ${DISTNAME}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \; - find ${DISTNAME} -not -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz - find ${DISTNAME} -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz - cd ../../ - rm -rf distsrc-${i} - done - mkdir -p $OUTDIR/src - mv $SOURCEDIST $OUTDIR/src - - # Compress ccache (otherwise the assert file will get too huge) - if [ "$CCACHE_DIR" != "" ]; then - pushd ${GBUILD_PACKAGE_CACHE} - tar cf ccache.tar ccache - rm -rf ccache - popd - fi From 2b0b2952b5322a8353d914a8cb461ccdf4baf3d2 Mon Sep 17 00:00:00 2001 From: strophy Date: Thu, 10 Mar 2022 16:12:11 +1100 Subject: [PATCH 28/38] chore: restore GHA changes to fix incorrect merge --- .github/workflows/release_alpha.yml | 116 +++++++++++++----- .../deploy/Dockerfile.GitHubActions.Gitian | 46 +++++++ 2 files changed, 131 insertions(+), 31 deletions(-) create mode 100644 contrib/containers/deploy/Dockerfile.GitHubActions.Gitian diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index a9e74a4bf33fd..85710c27cace3 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -1,4 +1,4 @@ -name: Build alpha release for Docker Hub +name: Build and push image on: workflow_dispatch: @@ -12,20 +12,42 @@ jobs: name: Run Gitian build runs-on: self-hosted steps: - - name: Set up QEMU to run multi-arch builds - uses: docker/setup-qemu-action@v1 + - name: Checkout + uses: actions/checkout@v2 + with: + path: dash + + - name: Checkout Gitian builder + uses: actions/checkout@v2 + with: + repository: devrandom/gitian-builder + path: gitian-builder - - name: Set up Docker BuildX - id: buildx - uses: docker/setup-buildx-action@v1 + - name: Checkout detached sigs + uses: actions/checkout@v2 with: - install: true + repository: dashpay/dash-detached-sigs + path: dash-detached-sigs - - name: Login to DockerHub - uses: docker/login-action@v1 + - name: Checkout gitian sigs + uses: actions/checkout@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: dashpay/gitian.sigs + path: gitian.sigs + + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + + - name: GPG user IDs + run: | + echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" + echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" + echo "name: ${{ steps.import_gpg.outputs.name }}" + echo "email: ${{ steps.import_gpg.outputs.email }}" - name: Checkout uses: actions/checkout@v2 @@ -64,30 +86,62 @@ jobs: with: images: strophy/dashd tags: | - type=semver,pattern={{version}},value=${{github.event.inputs.tag}} + type=semver,pattern={{version}},value=${{ github.event.inputs.tag }} type=raw,value=latest-dev flavor: | latest=false + - name: Install apt-cacher-ng + run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-cacher-ng + + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v5 + - name: Prepare Gitian - run: dash/contrib/gitian-build.py --setup "Leon White" "${{steps.docker_meta.outputs.tags}}" + run: dash/contrib/gitian-build.py --setup "strophy" "${{ steps.branch-name.outputs.current_branch }}" + + - uses: pat-s/always-upload-cache@v2 + id: ccache + with: + path: /opt/actions-runner/_work/dash/dash/gitian-builder/cache/dash-linux-0.17 + key: ${{ runner.os }}-ccache-${{ hashFiles('**/ccache.tar') }} + restore-keys: ${{ runner.os }}-ccache- - name: Run Gitian build - run: dash/contrib/gitian-build.py -b -n -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` "Leon White" "${{steps.docker_meta.outputs.tags}}" - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - - # - name: Build and push Docker image - # id: docker_build - # uses: docker/build-push-action@v2 - # with: - # file: ./docker/Dockerfile.GitHubActions.Dispatch - # push: true - # tags: ${{ steps.docker_meta.outputs.tags }} - # labels: ${{ steps.docker_meta.outputs.labels }} - # build-args: TAG=${{ steps.docker_meta.outputs.version }} - # cache-from: type=gha - # cache-to: type=gha,mode=max - # platforms: linux/amd64,linux/arm64 + run: | + export GPG_TTY=$(tty) + dash/contrib/gitian-build.py -c -b -n -o l \ + -u https://github.com/strophy/dash \ + -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` \ + strophy ${{ steps.branch-name.outputs.current_branch }} + + - name: Set up QEMU to run multi-arch builds + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker BuildX + id: buildx + uses: docker/setup-buildx-action@v1 + with: + version: v0.7.0 + install: true + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ${{ github.workspace }} + file: ./dash/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + build-args: | + TAG=${{ steps.docker_meta.outputs.version }} + BRANCH=${{ steps.branch-name.outputs.current_branch }} diff --git a/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian b/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian new file mode 100644 index 0000000000000..57fa0c7213021 --- /dev/null +++ b/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian @@ -0,0 +1,46 @@ +# syntax=docker/dockerfile:1.3 +FROM ubuntu:focal +LABEL maintainer="Dash Developers " +LABEL description="Dockerised DashCore" + +ARG USER_ID +ARG GROUP_ID +ARG TAG +ARG BRANCH + +ENV HOME /dash + +# add user with specified (or default) user/group ids +ENV USER_ID ${USER_ID:-1000} +ENV GROUP_ID ${GROUP_ID:-1000} +RUN groupadd -g ${GROUP_ID} dash && \ + useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /dash dash && \ + mkdir /dash/.dashcore && \ + chown dash:dash -R /dash + +RUN apt-get update && \ + apt-get -y install --no-install-recommends \ + wget \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +COPY dashcore-binaries/${BRANCH}/dashcore* /dash + +RUN mach=$(uname -m) \ + && case $mach in aarch64) arch="aarch64-linux-gnu"; ;; x86_64) arch="x86_64-linux-gnu"; ;; *) echo "ERROR: Machine type $mach not supported."; ;; esac \ + && cd /dash \ + && tar xvzf dashcore*$arch.tar.gz \ + && echo $(ls -1 /dash) \ + && cp dashcore-0.17.0/bin/* /usr/local/bin \ + && rm -rf dash* + +USER dash + +VOLUME ["/dash"] + +COPY dash/contrib/containers/deploy/docker-entrypoint.sh /docker-entrypoint.sh +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9998 9999 19998 19999 + +WORKDIR /dash From 4207f62ae7ee1ef15aaabf153ac0818ec7ef151f Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 14 Mar 2022 14:08:09 +1100 Subject: [PATCH 29/38] chore: remove duplicate code --- .github/workflows/release_alpha.yml | 31 ----------------------------- 1 file changed, 31 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 85710c27cace3..9518d199f8f96 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -49,37 +49,6 @@ jobs: echo "name: ${{ steps.import_gpg.outputs.name }}" echo "email: ${{ steps.import_gpg.outputs.email }}" - - name: Checkout - uses: actions/checkout@v2 - with: - path: dash - - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: devrandom/gitian-builder - path: gitian-builder - - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: dashpay/dash-detached-sigs - path: dash-detached-sigs - - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: dashpay/gitian.sigs - path: gitian.sigs - - # - name: Clone macOS SDK - # run: | - # mkdir gitian-builder/inputs - # wget -q -O gitian-builder/inputs/MacOSX10.11.sdk.tar.gz https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz - - - name: Import GPG key - run: echo ${{GPG_PRIVATE_KEY}} | gpg --import - - name: Docker meta id: docker_meta uses: docker/metadata-action@v3 From 4c6ec8fa7905d58f6c28758f89ed678427626150 Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 14 Mar 2022 14:08:18 +1100 Subject: [PATCH 30/38] chore: bump buildx version to latest --- .github/workflows/release_alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 9518d199f8f96..64b60f6589fa5 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -92,7 +92,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v1 with: - version: v0.7.0 + version: v0.8.0 install: true - name: Login to DockerHub From 0ef27b6065d40a60c2dcbb24ee776b30514f0cd8 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 15 Mar 2022 15:03:57 +1100 Subject: [PATCH 31/38] chore: try to build without signing --- .github/workflows/release_alpha.yml | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 64b60f6589fa5..860164270ec18 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -35,19 +35,19 @@ jobs: repository: dashpay/gitian.sigs path: gitian.sigs - - name: Import GPG key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v4 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} - - - name: GPG user IDs - run: | - echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" - echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" - echo "name: ${{ steps.import_gpg.outputs.name }}" - echo "email: ${{ steps.import_gpg.outputs.email }}" + # - name: Import GPG key + # id: import_gpg + # uses: crazy-max/ghaction-import-gpg@v4 + # with: + # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + # passphrase: ${{ secrets.GPG_PASSPHRASE }} + + # - name: GPG user IDs + # run: | + # echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" + # echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" + # echo "name: ${{ steps.import_gpg.outputs.name }}" + # echo "email: ${{ steps.import_gpg.outputs.email }}" - name: Docker meta id: docker_meta @@ -68,7 +68,7 @@ jobs: uses: tj-actions/branch-names@v5 - name: Prepare Gitian - run: dash/contrib/gitian-build.py --setup "strophy" "${{ steps.branch-name.outputs.current_branch }}" + run: dash/contrib/gitian-build.py --setup "dummy" "${{ steps.branch-name.outputs.current_branch }}" - uses: pat-s/always-upload-cache@v2 id: ccache @@ -80,10 +80,10 @@ jobs: - name: Run Gitian build run: | export GPG_TTY=$(tty) - dash/contrib/gitian-build.py -c -b -n -o l \ + dash/contrib/gitian-build.py -c -b -n -D -o l \ -u https://github.com/strophy/dash \ -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` \ - strophy ${{ steps.branch-name.outputs.current_branch }} + dummy ${{ steps.branch-name.outputs.current_branch }} - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v1 From f8995f7b9bcc16c3a487a51546cd8db2bf9bfd97 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 15 Mar 2022 16:12:23 +1100 Subject: [PATCH 32/38] chore: setup tmate to find build --- .github/workflows/release_alpha.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 860164270ec18..33866549ef9a9 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -114,3 +114,6 @@ jobs: build-args: | TAG=${{ steps.docker_meta.outputs.version }} BRANCH=${{ steps.branch-name.outputs.current_branch }} + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 From 6c4b2557e8b1bbb786adbb19fa54883b11a6f370 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 15 Mar 2022 16:12:52 +1100 Subject: [PATCH 33/38] chore: run tmate on failure --- .github/workflows/release_alpha.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 33866549ef9a9..2fc49edb6c5b7 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -117,3 +117,4 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + if: ${{ failure() }} From c40aa5186da1de1665dce9b49523a9af9ab9e5f0 Mon Sep 17 00:00:00 2001 From: strophy Date: Tue, 15 Mar 2022 17:31:59 +1100 Subject: [PATCH 34/38] fix: invalid path to binaries on copy --- contrib/containers/deploy/Dockerfile.GitHubActions.Gitian | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian b/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian index 57fa0c7213021..a9174a1ae77bd 100644 --- a/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian +++ b/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian @@ -5,7 +5,6 @@ LABEL description="Dockerised DashCore" ARG USER_ID ARG GROUP_ID -ARG TAG ARG BRANCH ENV HOME /dash @@ -31,7 +30,7 @@ RUN mach=$(uname -m) \ && cd /dash \ && tar xvzf dashcore*$arch.tar.gz \ && echo $(ls -1 /dash) \ - && cp dashcore-0.17.0/bin/* /usr/local/bin \ + && cp dashcore-*/bin/* /usr/local/bin \ && rm -rf dash* USER dash From 365b76f12074b1ac6daa96135af2a1003a09b3bf Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 28 Mar 2022 16:23:12 +1100 Subject: [PATCH 35/38] chore: remove unnecessary GPG steps --- .github/workflows/release_alpha.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index 2fc49edb6c5b7..e735a0d6ca83b 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -35,20 +35,6 @@ jobs: repository: dashpay/gitian.sigs path: gitian.sigs - # - name: Import GPG key - # id: import_gpg - # uses: crazy-max/ghaction-import-gpg@v4 - # with: - # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - # passphrase: ${{ secrets.GPG_PASSPHRASE }} - - # - name: GPG user IDs - # run: | - # echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" - # echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" - # echo "name: ${{ steps.import_gpg.outputs.name }}" - # echo "email: ${{ steps.import_gpg.outputs.email }}" - - name: Docker meta id: docker_meta uses: docker/metadata-action@v3 From f3bde3f9d883f42310db727464d2770b8bf2171f Mon Sep 17 00:00:00 2001 From: strophy Date: Mon, 28 Mar 2022 16:25:16 +1100 Subject: [PATCH 36/38] chore: replace strophy with dashpay --- .github/workflows/release_alpha.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index e735a0d6ca83b..b726a1857d637 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -39,7 +39,7 @@ jobs: id: docker_meta uses: docker/metadata-action@v3 with: - images: strophy/dashd + images: dashpay/dashd tags: | type=semver,pattern={{version}},value=${{ github.event.inputs.tag }} type=raw,value=latest-dev @@ -67,7 +67,7 @@ jobs: run: | export GPG_TTY=$(tty) dash/contrib/gitian-build.py -c -b -n -D -o l \ - -u https://github.com/strophy/dash \ + -u https://github.com/dashpay/dash \ -j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` \ dummy ${{ steps.branch-name.outputs.current_branch }} From 7337cb2d2a25856b15b4b866c963a15e40a9d479 Mon Sep 17 00:00:00 2001 From: strophy <32928115+strophy@users.noreply.github.com> Date: Thu, 31 Mar 2022 19:40:57 +1100 Subject: [PATCH 37/38] fix: gha cache not providing speedup --- .github/workflows/release_alpha.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index b726a1857d637..b2aa3e80d5f31 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -56,11 +56,11 @@ jobs: - name: Prepare Gitian run: dash/contrib/gitian-build.py --setup "dummy" "${{ steps.branch-name.outputs.current_branch }}" - - uses: pat-s/always-upload-cache@v2 + - uses: actions/cache@v3 id: ccache with: path: /opt/actions-runner/_work/dash/dash/gitian-builder/cache/dash-linux-0.17 - key: ${{ runner.os }}-ccache-${{ hashFiles('**/ccache.tar') }} + key: ${{ runner.os }}-ccache-${{ github.sha }} restore-keys: ${{ runner.os }}-ccache- - name: Run Gitian build @@ -100,7 +100,3 @@ jobs: build-args: | TAG=${{ steps.docker_meta.outputs.version }} BRANCH=${{ steps.branch-name.outputs.current_branch }} - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - if: ${{ failure() }} From eaf74deecab5ad365cb47811ffa5730093c1d940 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sun, 3 Apr 2022 13:06:45 +0300 Subject: [PATCH 38/38] Update .github/workflows/release_alpha.yml --- .github/workflows/release_alpha.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml index b2aa3e80d5f31..bef0370af7efd 100644 --- a/.github/workflows/release_alpha.yml +++ b/.github/workflows/release_alpha.yml @@ -16,7 +16,6 @@ jobs: uses: actions/checkout@v2 with: path: dash - - name: Checkout Gitian builder uses: actions/checkout@v2 with: