From aa62f8535e2451a3022d7137eed9e42e570b1e1f Mon Sep 17 00:00:00 2001 From: 0xfirefist Date: Tue, 7 Mar 2023 11:10:37 +0530 Subject: [PATCH 1/3] add workflow --- .github/workflows/price-pusher-image-push.yml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/price-pusher-image-push.yml diff --git a/.github/workflows/price-pusher-image-push.yml b/.github/workflows/price-pusher-image-push.yml new file mode 100644 index 0000000000..cbf18aea51 --- /dev/null +++ b/.github/workflows/price-pusher-image-push.yml @@ -0,0 +1,47 @@ +name: Build and Push Price Pusher Image +on: + push: + tags: + - pyth-price-pusher-v* + workflow_dispatch: + inputs: + dispatch_description: + description: "Dispatch description" + required: true + type: string +permissions: + contents: read + id-token: write +jobs: + price-pusher-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set image tag to version of the git tag + if: ${{ startsWith(github.ref, 'refs/tags/pyth-price-pusher-v') }} + run: | + PREFIX="refs/tags/pyth-price-pusher-" + VERSION="${GITHUB_REF:${#PREFIX}}" + echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}" + - name: Set image tag to the git commit hash + if: ${{ !startsWith(github.ref, 'refs/tags/pyth-price-pusher-v') }} + run: | + echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}" + - uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1 + with: + role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr + aws-region: eu-west-2 + - uses: docker/login-action@v2 + with: + registry: public.ecr.aws + env: + AWS_REGION: us-east-1 + - uses: aws-actions/amazon-ecr-login@v1 + id: ecr_login + - run: | + cd price_pusher + DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + env: + ECR_REGISTRY: public.ecr.aws + ECR_REPOSITORY: pyth-network/xc-price-pusher From da20f268d7fde2107414534d5a3a0c4008ac85db Mon Sep 17 00:00:00 2001 From: 0xfirefist Date: Tue, 7 Mar 2023 11:19:49 +0530 Subject: [PATCH 2/3] update readme --- price_pusher/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/price_pusher/README.md b/price_pusher/README.md index 0e02cbe9c2..940dd46d1e 100644 --- a/price_pusher/README.md +++ b/price_pusher/README.md @@ -1,6 +1,6 @@ -# Pyth EVM price pusher +# Pyth price pusher -Pyth EVM price pusher is a service that regularly pushes updates to the on-chain Pyth price based on configurable conditions. +Pyth price pusher is a service that regularly pushes updates to the on-chain Pyth price based on configurable conditions. ## Background @@ -8,7 +8,7 @@ Pyth is a cross-chain oracle that streams price updates over the peer-to-peer [W These price updates can be consumed on any chain that has a deployment of the Pyth contract. By default, Pyth does not automatically update the on-chain price every time the off-chain price changes; instead, anyone can permissionlessly update the on-chain price prior to using it. -For more information please refer to [this document](../pyth-evm-js/README.md#how-pyth-works-on-evm-chains). +For more information please refer to [this document](https://docs.pyth.network/design-overview). Protocols integrating with can update the on-chain Pyth prices in two different ways. The first approach is on-demand updates: package a Pyth price update together with each transaction that depends on it. @@ -66,7 +66,7 @@ npm run start -- injective --grpc-endpoint https://grpc-endpoint.com \ [--polling-frequency 5] # Or, run the price pusher docker image instead of building from the source -docker run public.ecr.aws/pyth-network/xc-evm-price-pusher:v -- +docker run public.ecr.aws/pyth-network/xc-price-pusher:v -- ``` ### Command Line Arguments From a261a14b47d23741ede5f57c5580f72d573ff59b Mon Sep 17 00:00:00 2001 From: 0xfirefist Date: Tue, 7 Mar 2023 11:20:14 +0530 Subject: [PATCH 3/3] correct docker build --- .github/workflows/price-pusher-image-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/price-pusher-image-push.yml b/.github/workflows/price-pusher-image-push.yml index cbf18aea51..1ee19d776c 100644 --- a/.github/workflows/price-pusher-image-push.yml +++ b/.github/workflows/price-pusher-image-push.yml @@ -39,8 +39,8 @@ jobs: - uses: aws-actions/amazon-ecr-login@v1 id: ecr_login - run: | - cd price_pusher - DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + DOCKER_BUILDKIT=1 docker build -t lerna -f tilt_devnet/docker_images/Dockerfile.lerna . + DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f price_pusher/Dockerfile . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG env: ECR_REGISTRY: public.ecr.aws