Skip to content

Commit

Permalink
#hubble-469: bring the fake gcs make target back in, review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jul 3, 2024
1 parent 9167c22 commit c75d993
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exp/services/ledgerexporter/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ The Dockerfile contains all the necessary dependencies (e.g., Stellar-core) requ

- Run: For instructions on running the Docker container, refer to the [Installation Guide](./README.md).

- Run ledgerexporter with a local, fake GCS backend: Requires `make docker-build` first, then run `make docker-test-fake-gcs`. This will run the ledger exporter against `testnet` and export to the 'fake' GCS instance started in the container.

## Running Integration Tests:
from top directory of stellar/go repo, run go test to launch ledger exporter integration
tests.
Expand Down
26 changes: 26 additions & 0 deletions exp/services/ledgerexporter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ $(if $(STELLAR_CORE_VERSION), --build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VE
-t $(DOCKER_IMAGE):$(VERSION) \
-t $(DOCKER_IMAGE):latest .

docker-clean:
$(SUDO) docker stop fake-gcs-server || true
$(SUDO) docker rm fake-gcs-server || true
$(SUDO) rm -rf ${PWD}/storage || true
$(SUDO) docker network rm test-network || true

docker-test-fake-gcs: docker-clean
# Create temp storage dir
$(SUDO) mkdir -p ${PWD}/storage/exporter-test

# Create test network for docker
$(SUDO) docker network create test-network

# Run the fake GCS server
$(SUDO) docker run -d --name fake-gcs-server -p 4443:4443 \
-v ${PWD}/storage:/data --network test-network fsouza/fake-gcs-server -scheme http

# Run the ledger-exporter
$(SUDO) docker run --platform linux/amd64 -t --network test-network\
-v ${PWD}/exp/services/ledgerexporter/docker/config.test.toml:/config.toml \
-e STORAGE_EMULATOR_HOST=http://fake-gcs-server:4443 \
$(DOCKER_IMAGE):$(VERSION) \
scan-and-fill --start 1000 --end 2000

$(MAKE) docker-clean

docker-push:
$(SUDO) docker push $(DOCKER_IMAGE):$(VERSION)
$(SUDO) docker push $(DOCKER_IMAGE):latest
13 changes: 13 additions & 0 deletions exp/services/ledgerexporter/docker/config.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[datastore_config]
type = "GCS"

[datastore_config.params]
destination_bucket_path = "exporter-test/ledgers/testnet"

[datastore_config.schema]
ledgers_per_file = 1
files_per_partition = 64000

[stellar_core_config]
network = "testnet"

0 comments on commit c75d993

Please sign in to comment.