forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
313 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build | ||
on: | ||
workflow_call: | ||
secrets: | ||
ACCESS_TOKEN: | ||
required: true | ||
DOCKERHUB_ORG: | ||
required: true | ||
DEPLOYER_SSH_KEY: | ||
required: true | ||
inputs: | ||
TAG: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
ssh-key: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
# https://github.com/moby/buildkit/issues/1368#issuecomment-731466205 | ||
# Seeing conflicting build caching between this and other repos in CI | ||
- name: Docker prune | ||
if: always() | ||
run: docker builder prune -f | ||
- name: Docker image prune | ||
if: always() | ||
run: docker image prune -f | ||
- name: Build containers | ||
run: docker compose --env-file ./env/.env.dev build --progress=plain | ||
env: | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
DOCKER_BUILDKIT: 1 | ||
ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
TAG: ${{ inputs.TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Clean Code Check | ||
on: | ||
workflow_call: | ||
secrets: | ||
GHUB_TOKEN: | ||
required: true | ||
ACCESS_TOKEN: | ||
required: true | ||
DEPLOYER_SSH_KEY: | ||
required: true | ||
jobs: | ||
clippy_and_udeps_check: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
ssh-key: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
components: clippy | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GHUB_TOKEN }} | ||
args: --all-features | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
args: cargo-udeps --locked | ||
- name: cargo udeps | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: udeps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Master | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
clean_code_check: | ||
uses: ./.github/workflows/clean_code.yaml | ||
secrets: | ||
GHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
DEPLOYER_SSH_KEY: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
|
||
build_images: | ||
needs: clean_code_check | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
TAG: "latest" | ||
secrets: | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
DEPLOYER_SSH_KEY: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
|
||
run_tests: | ||
needs: build_images | ||
uses: ./.github/workflows/test.yaml | ||
secrets: | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
with: | ||
TAG: "latest" | ||
|
||
push_images: | ||
needs: run_tests | ||
uses: ./.github/workflows/push_images.yaml | ||
secrets: | ||
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} | ||
DOCKERHUB_PWD: ${{ secrets.DOCKERHUB_PWD }} | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
with: | ||
TAG: "latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Pull Request | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
clean_code_check: | ||
uses: ./.github/workflows/clean_code.yaml | ||
secrets: | ||
GHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
DEPLOYER_SSH_KEY: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
|
||
build_images: | ||
needs: clean_code_check | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
TAG: ${{ github.sha }} | ||
secrets: | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
DEPLOYER_SSH_KEY: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
|
||
run_tests: | ||
needs: build_images | ||
uses: ./.github/workflows/test.yaml | ||
secrets: | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
with: | ||
TAG: ${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Push Images | ||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKERHUB_USER: | ||
required: true | ||
DOCKERHUB_PWD: | ||
required: true | ||
DOCKERHUB_ORG: | ||
required: true | ||
inputs: | ||
TAG: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
push: | ||
name: Docker Push | ||
runs-on: self-hosted | ||
steps: | ||
# login to registry | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PWD }} | ||
- name: Push relayer image | ||
run: docker push ${{ secrets.DOCKERHUB_ORG }}/jito-transaction-relayer:${{ inputs.TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
env: | ||
TAG: "$(git rev-parse --short HEAD)" | ||
|
||
jobs: | ||
clean_code_check: | ||
uses: ./.github/workflows/clean_code.yaml | ||
secrets: | ||
GHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
DEPLOYER_SSH_KEY: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
|
||
build_images: | ||
needs: clean_code_check | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
TAG: ${{ github.ref_name }}-${{ github.sha }} | ||
secrets: | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
DEPLOYER_SSH_KEY: ${{ secrets.DEPLOYER_SSH_KEY }} | ||
|
||
run_tests: | ||
needs: build_images | ||
uses: ./.github/workflows/test.yaml | ||
secrets: | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
with: | ||
TAG: ${{ github.ref_name }}-${{ github.sha }} | ||
|
||
push_images: | ||
needs: run_tests | ||
uses: ./.github/workflows/push_images.yaml | ||
secrets: | ||
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} | ||
DOCKERHUB_PWD: ${{ secrets.DOCKERHUB_PWD }} | ||
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} | ||
with: | ||
TAG: ${{ github.ref_name }}-${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Test | ||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKERHUB_ORG: | ||
required: true | ||
inputs: | ||
TAG: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Run tests | ||
run: RUST_LOG=info cargo test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# syntax=docker/dockerfile:1.4.0 | ||
FROM rust:1.59.0-slim-buster as builder | ||
|
||
RUN apt-get update && apt-get install -y libudev-dev clang pkg-config libssl-dev build-essential cmake | ||
RUN rustup component add rustfmt | ||
RUN update-ca-certificates | ||
|
||
ENV HOME=/home/root | ||
WORKDIR $HOME/app | ||
COPY . . | ||
|
||
RUN --mount=type=cache,mode=0777,target=/home/root/app/target \ | ||
--mount=type=cache,mode=0777,target=/usr/local/cargo/registry \ | ||
cargo build --release && cp target/release/jito-* ./ | ||
|
||
FROM debian:buster-slim as jito-transaction-relayer | ||
|
||
# needed for HTTPS | ||
RUN \ | ||
apt-get update && \ | ||
apt-get -y install ca-certificates && \ | ||
apt-get clean | ||
|
||
WORKDIR /app | ||
COPY --from=builder /home/root/app/jito-transaction-relayer ./ | ||
ENTRYPOINT ./jito-transaction-relayer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env sh | ||
# Build the relayer container | ||
set -e | ||
|
||
TAG=$(git describe --match=NeVeRmAtCh --always --abbrev=8 --dirty) | ||
ORG="jitolabs" | ||
|
||
COMPOSE_DOCKER_CLI_BUILD=1 \ | ||
DOCKER_BUILDKIT=1 \ | ||
TAG="${TAG}" \ | ||
ORG="${ORG}" \ | ||
docker-compose --env-file ./env/.env.dev build --progress=plain | ||
|
||
COMPOSE_DOCKER_CLI_BUILD=1 \ | ||
DOCKER_BUILDKIT=1 \ | ||
TAG="${TAG}" \ | ||
ORG="${ORG}" \ | ||
docker-compose --env-file ./env/.env.dev up --remove-orphans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# See ./b for running instructions | ||
version: "3.8" | ||
services: | ||
transaction_relayer: | ||
image: $ORG/jito-transaction-relayer:$TAG | ||
container_name: jito-transaction-relayer | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: jito-transaction-relayer | ||
environment: | ||
- RUST_LOG=info | ||
- TPU_BIND_IP=0.0.0.0 | ||
- TPU_PORT=$TPU_PORT | ||
- TPU_FWD_PORT=$TPU_FWD_PORT | ||
- TPU_QUIC_PORT=$TPU_QUIC_PORT | ||
- TPU_QUIC_FWD_PORT=$TPU_QUIC_FWD_PORT | ||
- GRPC_BIND_IP=0.0.0.0 | ||
- GRPC_BIND_PORT=$GRPC_BIND_PORT | ||
- NUM_TPU_BINDS=32 | ||
- NUM_TPU_FWD_BINDS=16 | ||
- RPC_SERVERS=$RPC_SERVERS | ||
- WEBSOCKET_SERVERS=$WEBSOCKET_SERVERS | ||
restart: on-failure | ||
ports: | ||
- "$TPU_PORT:$TPU_PORT/udp" | ||
- "$TPU_FWD_PORT:$TPU_FWD_PORT/udp" | ||
- "$TPU_QUIC_PORT:$TPU_QUIC_PORT/udp" | ||
- "$TPU_QUIC_FWD_PORT:$TPU_QUIC_FWD_PORT/udp" | ||
- "$GRPC_BIND_PORT:$GRPC_BIND_PORT/tcp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
TPU_PORT=8005 | ||
TPU_FWD_PORT=8006 | ||
TPU_QUIC_PORT=8007 | ||
TPU_QUIC_FWD_PORT=8008 | ||
GRPC_BIND_PORT=42069 | ||
RPC_SERVERS="https://api.mainnet-beta.solana.com" | ||
WEBSOCKET_SERVERS="wss://api.mainnet-beta.solana.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters