From 88327946571b7b77a31cb138abca57f025a16e3f Mon Sep 17 00:00:00 2001 From: Daniel Milnes Date: Thu, 2 Jan 2025 22:13:52 +0000 Subject: [PATCH] Publish minimal container image to ECR Public This is in addition to the existing full-size image --- .dockerignore | 1 + .github/workflows/image-push.yaml | 10 +++++++++- README.md | 14 +++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index a099dcaf..c4abe543 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ target Dockerfile +agent.Dockerfile diff --git a/.github/workflows/image-push.yaml b/.github/workflows/image-push.yaml index 1359c6b5..a2175a23 100644 --- a/.github/workflows/image-push.yaml +++ b/.github/workflows/image-push.yaml @@ -15,6 +15,13 @@ jobs: permissions: id-token: write contents: read + strategy: + matrix: + dockerfile: + - file: "Dockerfile" + suffix: "" + - file: "agent.Dockerfile" + suffix: "-minimal" steps: - uses: actions/checkout@v2 - uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1 @@ -40,4 +47,5 @@ jobs: - uses: docker/build-push-action@v2 with: push: true - tags: public.ecr.aws/pyth-network/agent:${{ steps.image_tag.outputs.value }} + tags: public.ecr.aws/pyth-network/agent:${{ steps.image_tag.outputs.value }}${{ matrix.dockerfile.suffix }} + file: ${{ matrix.dockerfile.file }} diff --git a/README.md b/README.md index 9eaf2e0f..92abae27 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,19 @@ through the `RUST_LOG` environment variable using the standard Pyth agent will print logs in plaintext in terminal and JSON format in non-terminal environments (e.g. when writing to a file). ## Run -`cargo run --release -- --config ` will build and run the agent in a single step. +### From Source +The preferred way to run Pyth Agent is by compiling from source. You can run the below command to build and run the agent in a single step. + +```bash +cargo run --release -- --config +``` + +### Container +For convenience, a minimal container image is also published to [ECR Public](https://gallery.ecr.aws/pyth-network/agent). An example command for running this container can be found below. Make sure to update the image version to the latest release of Pyth Agent. + +```bash +docker run -v /path/to/configdir:/config:z,ro public.ecr.aws/pyth-network/agent:v2.12.0-minimal +``` ## Publishing API A running agent will expose a WebSocket serving the JRPC publishing API documented [here](https://docs.pyth.network/documentation/publish-data/pyth-client-websocket-api). See `config/config.toml` for related settings.