Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Solana from CI #1233

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions .github/workflows/reusable-publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,47 +132,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

#
# Build the Solana node image and push it as digests
#
# We build the node images after we're done with the base so that we can use the docker layer cache
# instead of rebuilding the whole thing from scratch
#
build-node-solana:
name: Build Solana node image
runs-on: ubuntu-latest-16xlarge
needs:
- build-base

permissions:
contents: read
packages: write

strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build image & push the digest
uses: ./.github/workflows/actions/docker-build-image
with:
# The name of the image
image: devtools-dev-node-solana-test-validator
# The target stage of the Dockerfile
target: node-solana-test-validator
# Since the digests will be shared across jobs as artifacts,
# we need a unique name (per workflow) for these artifacts
digest-name: node-solana-test-validator
platform: ${{ matrix.platform }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

#
# Build the TON node image and push it as digests
#
Expand Down Expand Up @@ -292,32 +251,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

#
# Collect the Solana node image digests and push them to GHCR
#
push-node-solana:
name: Push Solana node image
runs-on: ubuntu-latest-4xlarge
needs:
- build-node-solana

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Push image
uses: ./.github/workflows/actions/docker-push-image
with:
# The name of the image
image: devtools-dev-node-solana-test-validator
# Since the digests will be shared across jobs as artifacts,
# we need a unique name (per workflow) for these artifacts
#
# This needs to match the digest name of the build stage
digest-name: node-solana-test-validator
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

#
# Collect the TON node image digests and push them to GHCR
#
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/reusable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ jobs:
DEVTOOLS_EVM_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-evm-hardhat:main
# And the prebuilt TON node image
DEVTOOLS_TON_NODE_IMAGE: ghcr.io/layerzero-labs/devtools-dev-node-ton-my-local-ton:main
# Provided we have good quality Solana RPCs, we can enable Solana tests
#
# FIXME The Solana tests need to be ported to either use a stable deployment
# or a local node. Until then, we disable the tests
# LZ_DEVTOOLS_ENABLE_SOLANA_TESTS: 1
RPC_URL_SOLANA_MAINNET: ${{ secrets.RPC_URL_SOLANA_MAINNET || 'https://rpc.ankr.com/solana' }}
RPC_URL_SOLANA_TESTNET: ${{ secrets.RPC_URL_SOLANA_TESTNET || 'https://api.devnet.solana.com' }}

# We'll collect the docker compose logs from all containers on failure
- name: Collect docker logs on failure
Expand Down
129 changes: 2 additions & 127 deletions Dockerfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im afraid that changing the Dockerfile would affect devcontainer (.devcontainer/devcontainer.local.json) since it depends on Dockerfile.
This may result in us not having solana in future devtools named volume

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# This issue does not affect users, it's only related to the test runner
# so the code will still work on node 18.16.0
ARG NODE_VERSION=20.10.0
ARG NODE_VERSION=20.11.0

# We will allow consumers to override build stages with prebuilt images
#
Expand Down Expand Up @@ -38,12 +38,6 @@ ARG APTOS_NODE_IMAGE=node-aptos-local-testnet
# while not breaking the flow for local development
ARG EVM_NODE_IMAGE=node-evm-hardhat

# We will provide a way for consumers to override the default Solana node image
#
# This will allow CI environments to supply the prebuilt Solana node image
# while not breaking the flow for local development
ARG SOLANA_NODE_IMAGE=node-solana-test-validator

# We will provide a way for consumers to override the default TON node image
#
# This will allow CI environments to supply the prebuilt TON node image
Expand Down Expand Up @@ -134,79 +128,6 @@ RUN rm -rf /app/aptos/aptos-core
ENV PATH="/root/.aptos/bin:$PATH"
RUN aptos --version

# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
#
# Image that builds AVM & Anchor
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
FROM machine AS avm

WORKDIR /app/avm

# Configure cargo. We want to provide a way of limiting cargo resources
# on the github runner since it is not large enough to support multiple cargo builds
ARG CARGO_BUILD_JOBS=default
ENV CARGO_BUILD_JOBS=$CARGO_BUILD_JOBS

# Install AVM - Anchor version manager for Solana
RUN cargo install --git https://github.com/coral-xyz/anchor avm

# Install anchor
ARG ANCHOR_VERSION=0.29.0
RUN avm install ${ANCHOR_VERSION}
RUN avm use ${ANCHOR_VERSION}

ENV PATH="/root/.avm/bin:$PATH"
RUN anchor --version
RUN avm --version

# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
#
# Image that builds Solana CLI
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
FROM machine AS solana

WORKDIR /app/solana

# Configure cargo. We want to provide a way of limiting cargo resources
# on the github runner since it is not large enough to support multiple cargo builds
ARG CARGO_BUILD_JOBS=default
ENV CARGO_BUILD_JOBS=$CARGO_BUILD_JOBS

# Install Solana using a binary with a fallback to installing from source
ARG SOLANA_VERSION=1.18.26
RUN \
# First we try to download prebuilt binaries for Solana
(\
curl --proto '=https' --tlsv1.2 -sSf https://release.anza.xyz/v${SOLANA_VERSION}/install | sh -s && \
mkdir -p /root/.solana && \
# Copy the active release directory into /root/.solana (using cp -L to dereference any symlinks)
cp -LR /root/.local/share/solana/install/active_release/bin /root/.solana/bin \
) || \
# If that doesn't work, we'll need to build Solana from source
(\
# We download the source code and extract the archive
curl -s -L https://github.com/anza-xyz/agave/archive/refs/tags/v${SOLANA_VERSION}.tar.gz | tar -xz && \
# Then run the installer
#
# We set the rust version to our default toolchain (must be >= 1.76.0 to avoid problems compiling ptr_from_ref code)
# See here https://github.com/inflation/jpegxl-rs/issues/60
./agave-${SOLANA_VERSION}/scripts/cargo-install-all.sh /root/.solana \
)

# Make sure we can execute the binaries
ENV PATH="/root/.solana/bin:$PATH"
RUN solana --version

# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
Expand Down Expand Up @@ -286,17 +207,11 @@ WORKDIR /app
ENV NPM_TOKEN=
ENV NPM_CONFIG_STORE_DIR=/pnpm
ENV TON_PATH="/root/.ton/bin"
ENV PATH="/root/.aptos/bin:/root/.avm/bin:/root/.foundry/bin:/root/.solana/bin:$TON_PATH:$PATH"
ENV PATH="/root/.aptos/bin:/root/.foundry/bin:$TON_PATH:$PATH"

# Get aptos CLI
COPY --from=aptos /root/.aptos/bin /root/.aptos/bin

# Get solana tooling
COPY --from=avm /root/.cargo/bin/anchor /root/.cargo/bin/anchor
COPY --from=avm /root/.cargo/bin/avm /root/.cargo/bin/avm
COPY --from=avm /root/.avm /root/.avm
COPY --from=solana /root/.solana/bin /root/.solana/bin

# Get TON tooling
COPY --from=ton /app/ton/bin /root/.ton/bin

Expand All @@ -315,15 +230,12 @@ RUN corepack enable
RUN node -v
RUN pnpm --version
RUN git --version
RUN anchor --version
RUN avm --version
RUN aptos --version
RUN forge --version
RUN anvil --version
RUN chisel --version
RUN cast --version
RUN solc --version
RUN solana --version
RUN func -V
RUN docker compose version

Expand Down Expand Up @@ -512,32 +424,6 @@ HEALTHCHECK --start-period=30s --interval=5s --retries=30 CMD curl -sSf http://1
# Run the shit
ENTRYPOINT ["java", "-jar", "MyLocalTon.jar", "nogui", "ton-http-api"]

# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
#
# Image that runs a local Solana node
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
FROM machine AS node-solana-test-validator

ENV PATH="/root/.solana/bin:$PATH"

COPY --from=solana /root/.solana/bin/solana-test-validator /root/.solana/bin/solana-test-validator

# Make sure the binary is there
RUN solana-test-validator --version

# By default the test validator will expose the following ports:
#
# Gossip: 1024
# TPU: 1027
# JSON RPC: 8899
# WebSocket: 8900
ENTRYPOINT ["solana-test-validator"]

# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
Expand All @@ -549,17 +435,6 @@ ENTRYPOINT ["solana-test-validator"]
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
FROM $APTOS_NODE_IMAGE AS node-aptos

# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
#
# Image that runs a Solana node
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
FROM $SOLANA_NODE_IMAGE AS node-solana

# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
Expand Down
5 changes: 0 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ services:
- NETWORK_URL_TANGO=http://network-tango:8545
- NETWORK_URL_TON=http://network-ton:8081/jsonRPC
- DOCKER_COMPOSE_RUN_TESTS_TURBO_ARGS=$DOCKER_COMPOSE_RUN_TESTS_TURBO_ARGS
# Passing environment variables that control the solana tests
- RPC_URL_SOLANA_MAINNET=${RPC_URL_SOLANA_MAINNET}
- RPC_URL_SOLANA_TESTNET=${RPC_URL_SOLANA_TESTNET}
- LZ_DEVTOOLS_ENABLE_SOLANA_TESTS=${LZ_DEVTOOLS_ENABLE_SOLANA_TESTS}
volumes:
- ./node_modules/.cache/turbo:/app/node_modules/.cache/turbo
# Hardhat has an issue with caching compilers inside a docker container,
# failing with EACCES -13 error, pointing to a permissions issue with the cache folder.
Expand Down
Loading