Skip to content

Commit

Permalink
Merge branch 'x-chain-semantic-fee-check' into x-chain_meter_fees
Browse files Browse the repository at this point in the history
  • Loading branch information
abi87 committed Jul 18, 2024
2 parents 2135d82 + 3f493ae commit 4343efb
Show file tree
Hide file tree
Showing 550 changed files with 13,301 additions and 9,139 deletions.
5 changes: 5 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
self-hosted-runner:
labels:
- custom-arm64-focal
- custom-arm64-jammy
- net-outage-sim
16 changes: 16 additions & 0 deletions .github/actions/install-focal-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This action installs dependencies missing from the default
# focal image used by arm64 github workers.
#
# TODO(marun): Find an image with the required dependencies already installed.

name: 'Install focal arm64 dependencies'
description: 'Installs the dependencies required to build avalanchego on an arm64 github worker running Ubuntu 20.04 (focal)'

runs:
using: composite
steps:
- name: Install build-essential
run: |
sudo apt update
sudo apt -y install build-essential
shell: bash
72 changes: 72 additions & 0 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 'Run the provided command in an environment configured to monitor tmpnet networks'
description: 'Run the provided command in an environment configured to monitor tmpnet networks'

inputs:
run:
description: "the bash command to run"
required: true
url_encoded_repo:
# TODO(marun) Process github.repository into this url-encoded form
default: 'ava-labs%2Favalanchego'
filter_by_owner:
default: ''
prometheus_id:
required: true
prometheus_password:
required: true
loki_id:
required: true
loki_password:
required: true
# The following inputs need never be provided by the caller. They
# default to context values that the action's steps are unable to
# acccess directly.
repository:
default: ${{ github.repository }}
workflow:
default: ${{ github.workflow }}
run_id:
default: ${{ github.run_id }}
run_number:
default: ${{ github.run_number }}
run_attempt:
default: ${{ github.run_attempt }}
job:
default: ${{ github.job }}

runs:
using: composite
steps:
- name: Start prometheus
# Only run for the original repo; a forked repo won't have access to the monitoring credentials
if: (inputs.prometheus_id != '')
shell: bash
run: bash -x ./scripts/run_prometheus.sh
env:
PROMETHEUS_ID: ${{ inputs.prometheus_id }}
PROMETHEUS_PASSWORD: ${{ inputs.prometheus_password }}
- name: Start promtail
if: (inputs.prometheus_id != '')
shell: bash
run: bash -x ./scripts/run_promtail.sh
env:
LOKI_ID: ${{ inputs.loki_id }}
LOKI_PASSWORD: ${{ inputs.loki_password }}
- name: Notify of metrics availability
if: (inputs.prometheus_id != '')
shell: bash
run: .github/actions/run-monitored-tmpnet-cmd/notify-metrics-availability.sh
env:
GRAFANA_URL: https://grafana-experimental.avax-dev.network/d/kBQpRdWnk/avalanche-main-dashboard?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.url_encoded_repo }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
FILTER_BY_OWNER: ${{ inputs.filter_by_owner }}
- name: Run command
shell: bash
run: ${{ inputs.run }}
env:
GH_REPO: ${{ inputs.repository }}
GH_WORKFLOW: ${{ inputs.workflow }}
GH_RUN_ID: ${{ inputs.run_id }}
GH_RUN_NUMBER: ${{ inputs.run_number }}
GH_RUN_ATTEMPT: ${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
20 changes: 20 additions & 0 deletions .github/actions/upload-tmpnet-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Upload an artifact of tmpnet data'
description: 'Upload an artifact of data in the ~/.tmpnet path'

inputs:
name:
description: "the name of the artifact to upload"
required: true

runs:
using: composite
steps:
- name: Upload tmpnet data
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: |
~/.tmpnet/networks
~/.tmpnet/prometheus/prometheus.log
~/.tmpnet/promtail/promtail.log
if-no-files-found: error
12 changes: 7 additions & 5 deletions .github/workflows/build-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create tgz package structure and upload to S3
Expand All @@ -71,11 +71,13 @@ jobs:
rm -rf /tmp/avalanchego
build-arm64-binaries-tarball:
runs-on: [self-hosted, linux, ARM64, focal]
runs-on: custom-arm64-focal

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/install-focal-deps

- uses: ./.github/actions/setup-go-for-project-v3

- run: go version
Expand All @@ -99,14 +101,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create tgz package structure and upload to S3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create zip file
run: 7z a avalanchego-macos-${TAG}.zip build/avalanchego
run: 7z a "avalanchego-macos-${TAG}.zip" build/avalanchego
env:
TAG: ${{ env.TAG }}

Expand All @@ -63,7 +63,7 @@ jobs:
aws-region: us-east-1

- name: Upload file to S3
run: aws s3 cp avalanchego-macos-${{ env.TAG }}.zip s3://${BUCKET}/macos/
run: aws s3 cp avalanchego-macos-${{ env.TAG }}.zip "s3://${BUCKET}/macos/"
env:
BUCKET: ${{ secrets.BUCKET }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-public-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ jobs:
- name: Install aws cli
run: |
sudo apt update
sudo apt-get -y install python3-boto3=${PYTHON3_BOTO3_VERSION}
sudo apt-get -y install python3-boto3="${PYTHON3_BOTO3_VERSION}"
- name: Get the tag
id: get_tag
run: |
if [[ ${{ github.event_name }} == 'push' ]];
then
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
else
echo "TAG=${{ inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ inputs.tag }}" >> "$GITHUB_ENV"
fi
shell: bash

- name: Set whether to skip ami creation in packer
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "Setting SKIP_CREATE_AMI to False"
echo "SKIP_CREATE_AMI=False" >> $GITHUB_ENV
echo "SKIP_CREATE_AMI=False" >> "$GITHUB_ENV"
fi
- name: Configure AWS credentials
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-ubuntu-amd64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create debian package
Expand Down Expand Up @@ -88,14 +88,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Configure AWS credentials
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/build-ubuntu-arm64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
build-jammy-arm64-package:
runs-on: [self-hosted, linux, ARM64, jammy]
runs-on: custom-arm64-jammy

steps:
- uses: actions/checkout@v4
Expand All @@ -38,14 +38,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create debian package
Expand All @@ -69,10 +69,11 @@ jobs:
rm -rf /tmp/avalanchego
build-focal-arm64-package:
runs-on: [self-hosted, linux, ARM64, focal]
runs-on: custom-arm64-focal

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-focal-deps
- uses: ./.github/actions/setup-go-for-project-v3
- run: go version

Expand All @@ -95,14 +96,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

- name: Create debian package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-win-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ jobs:
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
shell: bash

- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
shell: bash

# Runs a single command using the runners shell
Expand Down
Loading

0 comments on commit 4343efb

Please sign in to comment.