Skip to content

Commit

Permalink
commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman committed Aug 13, 2024
1 parent 892be8e commit 87db598
Show file tree
Hide file tree
Showing 1,192 changed files with 70,652 additions and 47,745 deletions.
27 changes: 8 additions & 19 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax

# Code owners are the final gate for PR approval to their named section of code.
# If a single PR involves multiple code owners, every code owner should approve
# a PR prior to merging.

* @StephenButtolph
/app/ @danlaine
/codec/ @danlaine
/database/corruptabledb/ @ceyonur
/ids/ @danlaine @joshua-kim
/indexer/ @danlaine
/message/ @gyuho
/network/ @danlaine @joshua-kim @StephenButtolph
/network/throttling/ @danlaine @dboehm-avalabs @StephenButtolph
/proto/ @gyuho
/snow/ @danlaine @StephenButtolph
/snow/consensus/ @gyuho @StephenButtolph
/snow/engine/snowman/syncer/ @abi87
/snow/uptime/ @ceyonur
/utils/logging/ @ceyonur
/vms/platformvm/ @abi87 @danlaine @dhrubabasu @StephenButtolph
/vms/proposervm/ @abi87 @StephenButtolph
/vms/registry/ @joshua-kim
/tests/ @abi87 @gyuho @marun
/x/ @danlaine @darioush @dboehm-avalabs
/.github/ @marun
/network/p2p/ @joshua-kim
/scripts/ @marun
/tests/ @marun
4 changes: 4 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
self-hosted-runner:
labels:
- custom-arm64-focal
- custom-arm64-jammy
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
71 changes: 71 additions & 0 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
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
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_owner:
default: ${{ github.repository_owner }}
repository_name:
default: ${{ github.event.repository.name }}
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.action_path }}/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.repository_owner }}%2F${{ inputs.repository_name }}&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_owner }}/${{ inputs.repository_name }}
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 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -euo pipefail

# Timestamps are in seconds
from_timestamp="$(date '+%s')"
monitoring_period=900 # 15 minutes
to_timestamp="$((from_timestamp + monitoring_period))"

# Grafana expects microseconds, so pad timestamps with 3 zeros
metrics_url="${GRAFANA_URL}&var-filter=gh_job_id%7C%3D%7C${GH_JOB_ID}&from=${from_timestamp}000&to=${to_timestamp}000"

# Optionally ensure that the link displays metrics only for the shared
# network rather than mixing it with the results for private networks.
if [[ -n "${FILTER_BY_OWNER:-}" ]]; then
metrics_url="${metrics_url}&var-filter=network_owner%7C%3D%7C${FILTER_BY_OWNER}"
fi

echo "::notice links::metrics ${metrics_url}"
16 changes: 16 additions & 0 deletions .github/actions/set-go-version-in-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This action sets GO_VERSION from the project's go.mod.
#
# Must be run after actions/checkout to ensure go.mod is available to
# source the project's go version from.

name: 'Set GO_VERSION env var from go.mod'
description: 'Read the go version from go.mod and add it as env var GO_VERSION in the github env'

runs:
using: composite
steps:
- name: Set the project Go version in the environment
# A script works across different platforms but attempting to replicate the script directly in
# the run statement runs into platform-specific path handling issues.
run: .github/actions/set-go-version-in-env/go_version_env.sh >> $GITHUB_ENV
shell: bash
14 changes: 14 additions & 0 deletions .github/actions/set-go-version-in-env/go_version_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

# Prints the go version defined in the repo's go.mod. This is useful
# for configuring the correct version of go to install in CI.
#
# `go list -m -f '{{.GoVersion}}'` should be preferred outside of CI
# when go is already installed.

# 3 directories above this script
AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../../.. && pwd )

echo GO_VERSION="~$(sed -n -e 's/^go //p' "${AVALANCHE_PATH}"/go.mod)"
24 changes: 24 additions & 0 deletions .github/actions/setup-go-for-project-v3/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This action targets setup-go@v3 to support workers with old NodeJS
# incompabible with newer versions of setup-go.
#
# Since github actions do not support dynamically configuring the
# versions in a uses statement (e.g. `actions/setup-go@${{ var }}`) it
# is necessary to define an action per version rather than one action
# that can be parameterized.
#
# Must be run after actions/checkout to ensure go.mod is available to
# source the project's go version from.

name: 'Install Go toolchain with project defaults'
description: 'Install a go toolchain with project defaults'

runs:
using: composite
steps:
- name: Set the project Go version in the environment
uses: ./.github/actions/set-go-version-in-env
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
25 changes: 25 additions & 0 deletions .github/actions/setup-go-for-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This action targets the project default version of setup-go. For
# workers with old NodeJS incompabible with newer versions of
# setup-go, try setup-go-for-project-v3.
#
# Since github actions do not support dynamically configuring the
# versions in a uses statement (e.g. `actions/setup-go@${{ var }}`) it
# is necessary to define an action per version rather than one action
# that can be parameterized.
#
# Must be run after actions/checkout to ensure go.mod is available to
# source the project's go version from.

name: 'Install Go toolchain with project defaults'
description: 'Install a go toolchain with project defaults'

runs:
using: composite
steps:
- name: Set the project Go version in the environment
uses: ./.github/actions/set-go-version-in-env
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
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
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
target-branch: "dev"
open-pull-requests-limit: 0 # Disable non-security version updates
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
60 changes: 0 additions & 60 deletions .github/packer/ubuntu-jammy-x86_64-public-ami.json

This file was deleted.

Loading

0 comments on commit 87db598

Please sign in to comment.