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

Provide config to stellar-core as xdr instead of json #524

Merged
merged 16 commits into from
Dec 7, 2023
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/build-soroban-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
core_ref: v20.0.0-rc.2.2
core_supports_enable_soroban_diagnostic_events: "true"
go_ref: horizon-v2.27.0-rc1
xdr_ref: v20.0.1
soroban_tools_ref: v20.0.0-rc4
test_matrix: |
{
Expand All @@ -57,6 +58,7 @@ jobs:
core_supports_enable_soroban_diagnostic_events: "true"
core_build_runner_type: ubuntu-latest-16-cores
go_ref: horizon-v2.27.0-rc1
xdr_ref: v20.0.1
soroban_tools_ref: v20.0.0-rc4
soroban_rpc_build_runner_type: ubuntu-latest-16-cores
test_matrix: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
core_ref: v20.0.0-rc.2.2
core_supports_enable_soroban_diagnostic_events: "true"
go_ref: horizon-v2.27.0-rc1
xdr_ref: v20.0.1
soroban_tools_ref: v20.0.0-rc4
test_matrix: |
{
Expand All @@ -62,6 +63,7 @@ jobs:
core_supports_enable_soroban_diagnostic_events: "true"
core_build_runner_type: ubuntu-latest-16-cores
go_ref: horizon-v2.27.0-rc1
xdr_ref: v20.0.1
soroban_tools_ref: v20.0.0-rc4
soroban_rpc_build_runner_type: ubuntu-latest-16-cores
test_matrix: |
Expand Down
48 changes: 47 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ on:
description: 'Git ref for the stellar/go repo (stellar-horizon, stellar-friendbot)'
type: 'string'
required: true
xdr_ref:
description: 'Git ref for the stellar/rs-stellar-xdr repo'
type: 'string'
required: false
soroban_tools_ref:
description: 'Git ref for the stellar/soroban-tools repo (soroban-rpc)'
type: 'string'
Expand All @@ -62,6 +66,7 @@ env:
SOROBAN_TOOLS_REPO_BRANCH: ${{ inputs.soroban_tools_ref }}
CORE_REPO: ${{ inputs.core_repo }}
CORE_REPO_REF: ${{ inputs.core_ref }}
XDR_REPO_REF: ${{ inputs.xdr_ref }}

jobs:

Expand Down Expand Up @@ -174,15 +179,53 @@ jobs:
name: image-stellar-soroban-rpc-${{ inputs.arch }}
path: /tmp/image

build-rs-stellar-xdr:
runs-on: ubuntu-latest
steps:
- name: Checkout Quickstart for Horizon docker file
uses: actions/checkout@v3
with:
ref: ${{ env.HEAD_SHA }}
- id: cache
uses: actions/cache@v3
with:
path: /tmp/image
key: image-rs-stellar-xdr-${{ inputs.arch }}-${{ env.XDR_REPO_REF }}
- if: steps.cache.outputs.cache-hit != 'true' && inputs.arch == 'arm64'
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
with:
platforms: arm64
- if: steps.cache.outputs.cache-hit != 'true'
uses: docker/setup-buildx-action@5146db6c4d81fbfd508899f851bbb3883a96ff9f
- if: steps.cache.outputs.cache-hit != 'true'
name: Build Stellar-Rs-Xdr Image
run: >
docker buildx build --platform linux/${{ inputs.arch }}
-f Dockerfile.xdr --target builder
-t stellar-rs-xdr:${{ inputs.arch }}
-o type=docker,dest=/tmp/image
--build-arg REPO=https://github.com/stellar/rs-stellar-xdr.git
--build-arg REF="${{ env.XDR_REPO_REF }}" .
- name: Upload Stellar-Rs-Xdr Image
uses: actions/upload-artifact@v2
with:
name: image-rs-stellar-xdr-${{ inputs.arch }}
path: /tmp/image

build:
needs: [build-stellar-core, build-stellar-horizon, build-stellar-friendbot, build-stellar-soroban-rpc]
needs: [build-stellar-core, build-stellar-horizon, build-rs-stellar-xdr, build-stellar-friendbot, build-stellar-soroban-rpc]
outputs:
image: ${{ steps.image.outputs.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.HEAD_SHA }}
- name: Download Stellar XDR
uses: actions/download-artifact@v2
with:
name: image-rs-stellar-xdr-${{ inputs.arch }}
path: /tmp/stellar-xdr
- name: Download Stellar-Core Image
uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -211,6 +254,8 @@ jobs:
run: docker load -i /tmp/stellar-friendbot/image
- name: Load Stellar-Soroban-Rpc Image
run: docker load -i /tmp/stellar-soroban-rpc/image
- name: Load Stellar-Rs-Xdr Image
run: docker load -i /tmp/stellar-xdr/image
- if: inputs.arch == 'arm64'
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
with:
Expand All @@ -235,6 +280,7 @@ jobs:
--label org.opencontainers.image.revision="${{ env.HEAD_SHA }}"
.
--build-arg REVISION="${{ env.HEAD_SHA }}"
--build-arg STELLAR_XDR_IMAGE_REF=stellar-rs-xdr:${{ inputs.arch }}
--build-arg STELLAR_CORE_IMAGE_REF=stellar-core:${{ inputs.arch }}
--build-arg HORIZON_IMAGE_REF=stellar-horizon:${{ inputs.arch }}
--build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:${{ inputs.arch }}
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
ARG STELLAR_XDR_IMAGE_REF
ARG STELLAR_CORE_IMAGE_REF
ARG HORIZON_IMAGE_REF
ARG FRIENDBOT_IMAGE_REF
ARG SOROBAN_RPC_IMAGE_REF

FROM $STELLAR_XDR_IMAGE_REF AS stellar-xdr
FROM $STELLAR_CORE_IMAGE_REF AS stellar-core
FROM $HORIZON_IMAGE_REF AS horizon
FROM $FRIENDBOT_IMAGE_REF AS friendbot
Expand All @@ -23,6 +25,8 @@ EXPOSE 11626
ADD dependencies /
RUN /dependencies

COPY --from=stellar-xdr /usr/local/cargo/bin/stellar-xdr /usr/local/bin/stellar-xdr

COPY --from=stellar-core /usr/local/bin/stellar-core /usr/bin/stellar-core

COPY --from=horizon /go/bin/horizon /usr/bin/stellar-horizon
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile.xdr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM rust AS builder

ARG REPO
ARG REF
WORKDIR /wd
RUN git clone ${REPO} /wd
RUN git fetch origin ${REF}
RUN git checkout ${REF}
RUN cargo install stellar-xdr --features cli --path .
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ __PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-de

REVISION=$(shell git -c core.abbrev=no describe --always --exclude='*' --long --dirty)
TAG?=dev
XDR_REPO?=https://github.com/stellar/rs-stellar-xdr.git
XDR_REF?=main
CORE_REPO?=https://github.com/stellar/stellar-core.git
CORE_REF?=master
CORE_CONFIGURE_FLAGS?=--disable-tests
Expand All @@ -25,31 +27,39 @@ build-latest:
HORIZON_REF=horizon-v2.26.1 \
SOROBAN_RPC_REF=v0.4.0

# The hashes below for CORE_REF and SOROBAN_RPC_REF are the refs for the v20.0.0 release
build-testing:
$(MAKE) build TAG=testing \
CORE_REF=v20.0.0-rc.2.2 \
XDR_REF=v20.0.1 \
CORE_REF=6177299100b114aa108584053414371f38aebf53 \
CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \
HORIZON_REF=horizon-v2.27.0-rc1 \
SOROBAN_RPC_REF=v20.0.0-rc4
HORIZON_REF=horizon-v2.27.0 \
SOROBAN_RPC_REF=91a441ff9593377c11d7e8b26c4942e941d548bb

# The hashes below for CORE_REF and SOROBAN_RPC_REF are the refs for the v20.0.0 release
build-soroban-dev:
$(MAKE) build TAG=soroban-dev \
CORE_REF=v20.0.0-rc.2.2 \
XDR_REF=v20.0.1 \
CORE_REF=6177299100b114aa108584053414371f38aebf53 \
CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \
HORIZON_REF=horizon-v2.27.0-rc1 \
SOROBAN_RPC_REF=v20.0.0-rc4
HORIZON_REF=horizon-v2.27.0 \
SOROBAN_RPC_REF=91a441ff9593377c11d7e8b26c4942e941d548bb

build:
$(MAKE) -j 4 build-deps
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . \
--build-arg REVISION=$(REVISION) \
--build-arg STELLAR_XDR_IMAGE_REF=stellar-xdr:$(XDR_REF) \
sreuland marked this conversation as resolved.
Show resolved Hide resolved
--build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) \
--build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) \
--build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) \
--build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF) \
--build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=$(CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS)

build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc
build-deps: build-deps-xdr build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

build-deps-xdr:
docker build -t stellar-xdr:$(XDR_REF) -f Dockerfile.xdr --target builder . --build-arg REPO="$(XDR_REPO)" --build-arg REF="$(XDR_REF)"

build-deps-core:
docker build -t stellar-core:$(CORE_REF) -f docker/Dockerfile.testing $(CORE_REPO)#$(CORE_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)"
Expand Down
Loading
Loading