From b16846d8b9a50a3272ef6d0dc221a3f0cb10e5fe Mon Sep 17 00:00:00 2001 From: Anton Rubets Date: Thu, 13 Jun 2024 10:34:33 +0300 Subject: [PATCH] Test build --- .github/workflows/docker-release-jito.yml | 65 ---------------------- .github/workflows/docker-release.yml | 5 +- .github/workflows/update-jito.yml.disabled | 49 ---------------- .github/workflows/update-upstream.yml | 49 ---------------- Dockerfile | 49 ++++++++++++++++ Dockerfile.jito | 10 ---- 6 files changed, 51 insertions(+), 176 deletions(-) delete mode 100644 .github/workflows/docker-release-jito.yml delete mode 100644 .github/workflows/update-jito.yml.disabled delete mode 100644 .github/workflows/update-upstream.yml delete mode 100644 Dockerfile.jito diff --git a/.github/workflows/docker-release-jito.yml b/.github/workflows/docker-release-jito.yml deleted file mode 100644 index 7dd738a..0000000 --- a/.github/workflows/docker-release-jito.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Release docker image (jito) -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+\-jito' - -jobs: - docker: - permissions: - contents: write - packages: write - runs-on: ubuntu-latest - steps: - - name: Checkout Jito-solana repo - uses: actions/checkout@v3 - with: - repository: jito-foundation/jito-solana - ref: ${{ github.ref_name }} - submodules: 'recursive' - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker # can't build multi-platform, but we can use FROM with local images - - name: Build Jito-solana - run: | - set -x - CI="" ./sdk/docker-solana/build.sh - docker tag solanalabs/solana:"${CI_TAG}" docker-solana:"${CI_TAG}" - env: - CI_TAG: ${{ github.ref_name }} - - name: Checkout - uses: actions/checkout@v4 - - name: Docker login - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/${{ github.repository }} - tags: | - type=raw,value=${{ github.ref_name }} - type=raw,value=latest-jito - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.jito - push: true - tags: ${{ steps.meta.outputs.tags }} - - name: Release - uses: ncipollo/release-action@v1 - with: - name: ${{ github.event.repository.name }} ${{ github.ref_name }} - makeLatest: false - generateReleaseNotes: true - body: | - ## Docker images - ``` - ${{ steps.meta.outputs.tags }} - ``` \ No newline at end of file diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 48d9d41..3c724c5 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -2,7 +2,7 @@ name: Release docker image on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+\-geyser\-jito\-plugin' jobs: docker: @@ -29,7 +29,6 @@ jobs: ghcr.io/${{ github.repository }} tags: | type=raw,value=${{ github.ref_name }} - type=raw,value=latest - name: Build and push uses: docker/build-push-action@v5 with: @@ -40,7 +39,7 @@ jobs: uses: ncipollo/release-action@v1 with: name: ${{ github.event.repository.name }} ${{ github.ref_name }} - makeLatest: true + makeLatest: false generateReleaseNotes: true body: | ## Docker images diff --git a/.github/workflows/update-jito.yml.disabled b/.github/workflows/update-jito.yml.disabled deleted file mode 100644 index 00d68cd..0000000 --- a/.github/workflows/update-jito.yml.disabled +++ /dev/null @@ -1,49 +0,0 @@ -name: Update from upstream (jito) -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -jobs: - publish: - name: Publish new tag - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_PAT }} - - - name: Get upstream tags - uses: dysnix/find-latest-tag@v1 - id: upstream - with: - releases-only: true - regex: v1\.17\.[0-9]+\-jito$ - repository: jito-foundation/jito-solana - - - name: Get local tags - uses: dysnix/find-latest-tag@v1 - id: latest - with: - compared-to-tag: ${{ steps.upstream.outputs.tag }} - regex: v1\.17\.[0-9]+\-jito$ - repository: ${{ github.repository }} - - - name: Update Dockerfile base - if: steps.latest.outputs.newer == 'true' || steps.latest.outputs.tag == '' - run: sed -E -i 's/v[0-9]+\.[0-9]+\.[0-9]+\-jito/${{ steps.upstream.outputs.tag }}/g' Dockerfile.jito - - - name: Create tag - if: steps.latest.outputs.newer == 'true' || steps.latest.outputs.tag == '' - run: | - git config --global user.email "tech@dysnix.com" - git config --global user.name "dysnixbot" - git add -A - git commit -m "Upstream update ${{ steps.upstream.outputs.tag }}" - git push origin ${{ github.ref_name }} - git tag ${{ steps.upstream.outputs.tag }} - git push origin ${{ steps.upstream.outputs.tag }} diff --git a/.github/workflows/update-upstream.yml b/.github/workflows/update-upstream.yml deleted file mode 100644 index 7931c4a..0000000 --- a/.github/workflows/update-upstream.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Update from upstream -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -jobs: - publish: - name: Publish new tag - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_PAT }} - - - name: Get local tags - uses: dysnix/find-latest-tag@v1 - id: upstream - with: - releases-only: true - regex: v1\.17\.[0-9]+$ - repository: solana-labs/solana - - - name: Get local tags - uses: dysnix/find-latest-tag@v1 - id: latest - with: - compared-to-tag: ${{ steps.upstream.outputs.tag }} - regex: v1\.17\.[0-9]+$ - repository: ${{ github.repository }} - - - name: Update Dockerfile base - if: steps.latest.outputs.newer == 'true' || steps.latest.outputs.tag == '' - run: sed -E -i 's/v[0-9]+\.[0-9]+\.[0-9]+/${{ steps.upstream.outputs.tag }}/g' Dockerfile - - - name: Create tag - if: steps.latest.outputs.newer == 'true' || steps.latest.outputs.tag == '' - run: | - git config --global user.email "tech@dysnix.com" - git config --global user.name "dysnixbot" - git add -A - git commit -m "Upstream update ${{ steps.upstream.outputs.tag }}" - git push origin ${{ github.ref_name }} - git tag ${{ steps.upstream.outputs.tag }} - git push origin ${{ steps.upstream.outputs.tag }} diff --git a/Dockerfile b/Dockerfile index 4df6788..633f176 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,50 @@ +FROM rust:1.73-bullseye as jitobuild +# keep rust version in sync to avoid re-downloading rust +# use https://github.com/solana-labs/solana/blob/db9fdf5811ecd8a84ea446591854974d386681ef/ci/rust-version.sh#L21 + +RUN set -x \ + && apt-get -qq update \ + && apt-get -qq -y install \ + clang \ + cmake \ + libudev-dev \ + unzip \ + libssl-dev \ + pkg-config \ + zlib1g-dev \ + curl \ + git \ + && rustup component add rustfmt \ + && rustup component add clippy \ + && rustc --version \ + && cargo --version + +ENV PROTOC_VERSION 21.12 +ENV PROTOC_ZIP protoc-$PROTOC_VERSION-linux-x86_64.zip + +RUN curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \ + && unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \ + && unzip -o $PROTOC_ZIP -d /usr/local include/* \ + && rm -f $PROTOC_ZIP +WORKDIR / +RUN git clone --depth=1 --branch v1.17.20 https://github.com/jito-foundation/geyser-grpc-plugin.git +WORKDIR /geyser-grpc-plugin + + +ARG ci_commit +ENV CI_COMMIT=v1.17.20 + +ARG features + +# Uses docker buildkit to cache the image. +# /usr/local/cargo/git needed for crossbeam patch +RUN if [ -z "$features" ] ; then \ + cargo build --release; \ + else \ + cargo build --release --features "$features"; \ + fi + + FROM solanalabs/solana:v1.17.34 ENV DEBIAN_FRONTEND noninteractive @@ -8,3 +55,5 @@ RUN apt-get update -y \ curl \ jq \ && rm -rf /var/lib/apt/lists/* + +COPY --from=jitobuild /geyser-grpc-plugin/target/release/libgeyser_grpc_plugin_server.so /lib/ \ No newline at end of file diff --git a/Dockerfile.jito b/Dockerfile.jito deleted file mode 100644 index 9fd176d..0000000 --- a/Dockerfile.jito +++ /dev/null @@ -1,10 +0,0 @@ -FROM docker-solana:v1.17.34-jito - -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get update -y \ - && apt-get install -y \ - ca-certificates \ - curl \ - jq \ - && rm -rf /var/lib/apt/lists/*