Skip to content

Publish a Minimal Container Image to ECR Public #148

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

Closed
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
Dockerfile
agent.Dockerfile
10 changes: 9 additions & 1 deletion .github/workflows/image-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <your_config.toml>` 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 <your_config.toml>
```

### 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.
Expand Down