From 14921d35c4772c5b95c9518f67fb82308fea9e61 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Sat, 12 Aug 2023 10:57:05 -0400 Subject: [PATCH 1/9] make sure to serve the axon first --- openvalidators/neuron.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openvalidators/neuron.py b/openvalidators/neuron.py index a52da3c..9d08c7c 100644 --- a/openvalidators/neuron.py +++ b/openvalidators/neuron.py @@ -131,6 +131,12 @@ def __init__(self): axon = bt.axon( wallet=self.wallet, metagraph=self.metagraph, config=self.config ) + self.subtensor.serve_axon( + netuid=self.config.netuid, + axon=axon, + use_upnpc=False, + wait_for_finalization=True, + ) del axon From 79b40694b155e0a87af0c262202da4a0ef06f587 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Sat, 12 Aug 2023 10:58:44 -0400 Subject: [PATCH 2/9] bump version --- openvalidators/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvalidators/__init__.py b/openvalidators/__init__.py index 10d715d..87cf974 100644 --- a/openvalidators/__init__.py +++ b/openvalidators/__init__.py @@ -28,6 +28,6 @@ from . import weights from . import event -__version__ = "1.1.7" +__version__ = "1.1.8" version_split = __version__.split(".") __spec_version__ = (1000 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2])) From 102170415846c6c924f3638537f32d3f3e5765b2 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Sat, 12 Aug 2023 11:06:04 -0400 Subject: [PATCH 3/9] add changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d58a7ee..86792ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.1.8 / 2023-08-12 + +## What's Changed +- Make sure to serve axon first by @camfairchild in 14921d35c + + +**Full Changelog**: https://github.com/opentensor/validators/compare/v1.1.7...v1.1.8 + + ## 1.1.7 / 2023-08-11 ### What’s Changed - Hotfix cutoff limit by @Eugene-hu in #126 From eb393815e205da6a907391650ce7fe4c381db610 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Sat, 12 Aug 2023 12:52:32 -0400 Subject: [PATCH 4/9] Add axon off --- openvalidators/config.py | 8 ++++++++ openvalidators/neuron.py | 27 +++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/openvalidators/config.py b/openvalidators/config.py index d773032..19b9f88 100644 --- a/openvalidators/config.py +++ b/openvalidators/config.py @@ -166,6 +166,14 @@ def add_args(cls, parser): default=4096, ) + parser.add_argument( + "--neuron.axon_off", + "--axon_off", + action="store_true", + help="Don't attempt to serve an Axon.", + default=False, + ) + parser.add_argument("--wandb.off", action="store_true", help="Turn off wandb.", default=False) parser.add_argument( "--wandb.project_name", diff --git a/openvalidators/neuron.py b/openvalidators/neuron.py index 9d08c7c..0a49601 100644 --- a/openvalidators/neuron.py +++ b/openvalidators/neuron.py @@ -127,18 +127,21 @@ def __init__(self): self.gating_model = GatingModel(metagraph=self.metagraph, config=self.config).to(self.device) bt.logging.debug(str(self.gating_model)) - bt.logging.debug('serving ip to chain...') - axon = bt.axon( - wallet=self.wallet, metagraph=self.metagraph, config=self.config - ) - self.subtensor.serve_axon( - netuid=self.config.netuid, - axon=axon, - use_upnpc=False, - wait_for_finalization=True, - ) - - del axon + if not self.config.neuron.axon_off: + bt.logging.debug('serving ip to chain...') + axon = bt.axon( + wallet=self.wallet, metagraph=self.metagraph, config=self.config + ) + self.subtensor.serve_axon( + netuid=self.config.netuid, + axon=axon, + use_upnpc=False, + wait_for_finalization=True, + ) + + del axon + else: + bt.logging.debug('axon off, not serving ip to chain.') # Dendrite pool for querying the network during training. bt.logging.debug("loading", "dendrite_pool") From 99f64b84aee2ccd2c4dc09bf7e735b7c48dc3438 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Sat, 12 Aug 2023 12:52:45 -0400 Subject: [PATCH 5/9] catch errors for axon serve, skip if error --- openvalidators/neuron.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/openvalidators/neuron.py b/openvalidators/neuron.py index 0a49601..fadfb17 100644 --- a/openvalidators/neuron.py +++ b/openvalidators/neuron.py @@ -129,17 +129,27 @@ def __init__(self): if not self.config.neuron.axon_off: bt.logging.debug('serving ip to chain...') - axon = bt.axon( - wallet=self.wallet, metagraph=self.metagraph, config=self.config - ) - self.subtensor.serve_axon( - netuid=self.config.netuid, - axon=axon, - use_upnpc=False, - wait_for_finalization=True, - ) + try: + axon = bt.axon( + wallet=self.wallet, metagraph=self.metagraph, config=self.config + ) + + try: + self.subtensor.serve_axon( + netuid=self.config.netuid, + axon=axon, + use_upnpc=False, + wait_for_finalization=True, + ) + + del axon + except Exception as e: + bt.logging.error(f'Failed to serve Axon with exception: {e}') + pass + except Exception as e: + bt.logging.error(f'Failed to create Axon initialize with exception: {e}') + pass - del axon else: bt.logging.debug('axon off, not serving ip to chain.') From 04a3261fdfd8ee08ff5cf1b712e82fb5811d13ef Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Sat, 12 Aug 2023 13:36:46 -0400 Subject: [PATCH 6/9] fix ordering --- openvalidators/neuron.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvalidators/neuron.py b/openvalidators/neuron.py index fadfb17..bbbfd7e 100644 --- a/openvalidators/neuron.py +++ b/openvalidators/neuron.py @@ -141,11 +141,11 @@ def __init__(self): use_upnpc=False, wait_for_finalization=True, ) - - del axon except Exception as e: bt.logging.error(f'Failed to serve Axon with exception: {e}') pass + + del axon except Exception as e: bt.logging.error(f'Failed to create Axon initialize with exception: {e}') pass From c447229b4b31fd8b3088c67314787b904b8cf391 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Sat, 12 Aug 2023 13:38:49 -0400 Subject: [PATCH 7/9] add comment per @opentaco --- openvalidators/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openvalidators/config.py b/openvalidators/config.py index 19b9f88..4c00c21 100644 --- a/openvalidators/config.py +++ b/openvalidators/config.py @@ -170,7 +170,9 @@ def add_args(cls, parser): "--neuron.axon_off", "--axon_off", action="store_true", - help="Don't attempt to serve an Axon.", + # Note: the validator needs to serve an Axon with their IP or they may + # be blacklisted by the firewall of serving peers on the network. + help="Set this flag to not attempt to serve an Axon.", default=False, ) From b26a3f43c1f4a96b066cb20e87703be0d0c154e6 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Mon, 14 Aug 2023 12:42:14 -0400 Subject: [PATCH 8/9] Add scripts for releases to github (#128) * add scripts for releases to github * typo * fix versioning script * add release scripts readme --- scripts/release/README.md | 59 +++++++++ scripts/release/add_notes_changelog.sh | 106 ++++++++++++++++ scripts/release/github_release.sh | 105 +++++++++++++++ scripts/release/github_utils.sh | 169 +++++++++++++++++++++++++ scripts/release/release.sh | 122 ++++++++++++++++++ scripts/release/utils.sh | 26 ++++ scripts/release/versioning.sh | 93 ++++++++++++++ 7 files changed, 680 insertions(+) create mode 100644 scripts/release/README.md create mode 100755 scripts/release/add_notes_changelog.sh create mode 100755 scripts/release/github_release.sh create mode 100644 scripts/release/github_utils.sh create mode 100755 scripts/release/release.sh create mode 100755 scripts/release/utils.sh create mode 100755 scripts/release/versioning.sh diff --git a/scripts/release/README.md b/scripts/release/README.md new file mode 100644 index 0000000..162e22c --- /dev/null +++ b/scripts/release/README.md @@ -0,0 +1,59 @@ +# Release Script(s) Usage + +## Versioning + +This script needs: +- An existing `openvalidators/__init__.py` file +- An existing `__version__` variable in that file +- An existing version for that variable + +This process will generate: +- A modified version in `__version__` for the update type specified + +### Example Usage +`./scripts/release/versioning.sh -U patch -A` + +Where: +* `-U` (major|minor|patch) the type of update +* `-A` is to apply the script changes + + +## Add Notes Changelog + +This script needs: +- An existing `CHANGELOG.md` file with at least three lines +- An existing git tag for the previous version + +This process will generate: +- A new entry in `CHANGELOG.md` + +##### *Note: This will only list merge commits into the release branch since the last tag* + +### Example Usage +`./scripts/release/add_notes_changelog.sh -P 1.1.7 -V 1.1.8 -B hotfix/serve-val-axon -T $GIT -A` + +Where: +* `-P` is the old version +* `-V` is the new version +* `-B` is the release branch name (default: `release/vX.X.X`) +* `-T` is the GIT API token +* `-A` is to apply the script changes + +## Release + +This script needs: +- An existing `__version__` variable in the `openvalidators/__init__.py` file +- Version in the `__version__` variable is not a git tag already + +This process will generate: +- Tag in Github repo: https://github.com/opentensor/validators/tags +- Release in Github: https://github.com/opentensor/validators/releases + + +### Example Usage +`./scripts/release/release.sh -T $GIT -A` + +Where: +* `-T` is the GIT API token +* `-A` is to apply the script changes + diff --git a/scripts/release/add_notes_changelog.sh b/scripts/release/add_notes_changelog.sh new file mode 100755 index 0000000..d0f7594 --- /dev/null +++ b/scripts/release/add_notes_changelog.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +#### +# Utils +#### +source ${BASH_SOURCE%/*}/utils.sh +source ${BASH_SOURCE%/*}/github_utils.sh +### + +# 1. Get options + +## Defaults +APPLY="false" + +while [[ $# -gt 0 ]]; do + case $1 in + -A|--apply) + APPLY="true" + shift # past argument + ;; + -P|--previous-version-tag) + PREV_TAG_VERSION="$2" + shift # past argument + shift # past value + ;; + -V|--version) + VERSION="$2" + shift # past argument + shift # past value + ;; + -T|--github-token) + GITHUB_TOKEN="$2" + shift # past argument + shift # past value + ;; + -B|--release-branch) + RELEASE_BRANCH="$2" + shift # past argument + shift # past value + ;; + -*|--*) + echo "Unknown option $1" + exit 1 + ;; + *) + POSITIONAL_ARGS+=("$1") # save positional arg + shift # past argument + ;; + esac +done + +if [[ -z $GITHUB_TOKEN && $APPLY == "true" ]]; then + echo_error "Github token required (-T, --github-token)" + exit 1 +fi + +if [[ -z $PREV_TAG_VERSION ]]; then + echo_error "Previous version tag required (-P, --previous-version-tag)" + exit 1 +fi + +if [[ -z $VERSION ]]; then + echo_error "Version to release required (-V, --version)" + exit 1 +fi + +if [[ -z $RELEASE_BRANCH ]]; then + echo_warning "Release branch not specified with (-B, --release-branch) assuming: release/$VERSION" + RELEASE_BRANCH=release/$VERSION +fi + +DATE=$(date +"%Y-%m-%d") +RELEASE_NAME="$VERSION / $DATE" +TAG_NAME=v$VERSION +PREV_TAG_NAME=v$PREV_TAG_VERSION + +# 2.2. Generate release notes +if [[ $APPLY == "true" ]]; then + echo_info "Generating Github release notes" + RESPONSE=$(generate_github_release_notes_for_changelog $GITHUB_TOKEN) + DESCRIPTION=$(echo $RESPONSE | jq '.body' | tail -1 | sed "s/\"//g") + + if [ $(echo $RESPONSE | jq '.body' | wc -l) -eq 1 ]; then + if [ $(echo $RESPONSE | jq '.' | grep 'documentation_url' | wc -l) -gt 0 ]; then + echo_error "Something went wrong generating Github release notes" + echo $RESPONSE | jq --slurp '.[0]' + exit 1 + fi + + if [ $(echo $RESPONSE | jq '.type' | grep 'error' | wc -l) -gt 0 ]; then + echo_error "Something went wrong generating Github release notes" + echo $RESPONSE | jq --slurp '.[1]' + exit 1 + fi + fi +else + echo_warning "Dry run execution. Not generating Github release notes" +fi + +if [[ $APPLY == "true" ]]; then + echo_info "Adding release notes to CHANGELOG.md" + sed -i "2 i\\\n## $RELEASE_NAME" CHANGELOG.md + sed -i "4 i\\\n$DESCRIPTION\n" CHANGELOG.md +else + echo_warning "Dry run execution. Not adding release notes to CHANGELOG.md" +fi \ No newline at end of file diff --git a/scripts/release/github_release.sh b/scripts/release/github_release.sh new file mode 100755 index 0000000..08a551e --- /dev/null +++ b/scripts/release/github_release.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +#### +# Utils +#### +source ${BASH_SOURCE%/*}/utils.sh +source ${BASH_SOURCE%/*}/github_utils.sh +### + +# 1. Get options + +## Defaults +APPLY="false" + +while [[ $# -gt 0 ]]; do + case $1 in + -A|--apply) + APPLY="true" + shift # past argument + ;; + -P|--previous-version-tag) + PREV_TAG_VERSION="$2" + shift # past argument + shift # past value + ;; + -V|--version) + VERSION="$2" + shift # past argument + shift # past value + ;; + -T|--github-token) + GITHUB_TOKEN="$2" + shift # past argument + shift # past value + ;; + -*|--*) + echo "Unknown option $1" + exit 1 + ;; + *) + POSITIONAL_ARGS+=("$1") # save positional arg + shift # past argument + ;; + esac +done + +if [[ -z $GITHUB_TOKEN && apply == "true" ]]; then + echo_error "Github token required (-T, --github-token)" + exit 1 +fi + +if [[ -z $PREV_TAG_VERSION ]]; then + echo_error "Previous version tag required (-P, --previous-version-tag)" + exit 1 +fi + +if [[ -z $VERSION ]]; then + echo_error "Version to release required (-V, --version)" + exit 1 +fi + +# 2. Github +DATE=$(date +"%Y-%m-%d") +RELEASE_NAME="$VERSION / $DATE" +PREV_TAG_NAME=$PREV_TAG_VERSION +TAG_NAME=v$VERSION + +# 2.1 Create Git tag for the repository +if [[ $APPLY == "true" ]]; then + echo_info "Tagging repository" + tag_repository $TAG_NAME +else + echo_warning "Dry run execution. Not tagging Github repo" +fi + +# 2.2. Generate release notes +if [[ $APPLY == "true" ]]; then + echo_info "Generating Github release notes" + RESPONSE=$(generate_github_release_notes $GITHUB_TOKEN) + DESCRIPTION=$(echo $RESPONSE | jq '.body' | tail -1 | sed "s/\"//g") + + if [ $(echo $RESPONSE | jq '.body' | wc -l) -eq 1 ]; then + if [ $(echo $RESPONSE | jq '.' | grep 'documentation_url' | wc -l) -gt 0 ]; then + echo_error "Something went wrong generating Github release notes" + echo $RESPONSE | jq --slurp '.[0]' + exit 1 + fi + + if [ $(echo $RESPONSE | jq '.type' | grep 'error' | wc -l) -gt 0 ]; then + echo_error "Something went wrong generating Github release notes" + echo $RESPONSE | jq --slurp '.[1]' + exit 1 + fi + fi +else + echo_warning "Dry run execution. Not generating Github release notes" +fi + +# 2.3 Create Github release +if [[ $APPLY == "true" ]]; then + echo_info "Generating Github release" + create_github_release $GITHUB_TOKEN +else + echo_warning "Dry run execution. Not creating Github release" +fi \ No newline at end of file diff --git a/scripts/release/github_utils.sh b/scripts/release/github_utils.sh new file mode 100644 index 0000000..243449d --- /dev/null +++ b/scripts/release/github_utils.sh @@ -0,0 +1,169 @@ +#!/bin/bash + +#### +# Utils +#### +source ${BASH_SOURCE%/*}/utils.sh + +# +# Params: +# - First positional argument: version of the tag +# +function tag_repository() +{ + VERSION=$1 + + if [[ -z $VERSION ]]; then + echo_error "tag_repository needs VERSION" + exit 1 + fi + + git tag -a $VERSION -m "Release $VERSION" + git push origin --tags +} + +# +# Params: +# - First positional argument: version of the tag +# +function remove_tag() +{ + VERSION=$1 + + if [[ -z $VERSION ]]; then + echo_error "remove_tag needs VERSION" + exit 1 + fi + + git tag -d $VERSION + git push --delete origin $VERSION +} + +# +# Needs: +# - TAG_NAME +# - PREV_TAG_NAME +# - RELEASE_NAME +# +function generate_github_release_notes_post_data() +{ + cat < /dev/null +} \ No newline at end of file diff --git a/scripts/release/release.sh b/scripts/release/release.sh new file mode 100755 index 0000000..f631fd6 --- /dev/null +++ b/scripts/release/release.sh @@ -0,0 +1,122 @@ +#!/bin/bash + +# +# In this script you are going to find the process of releasing Openvalidators. +# +# This script needs: +# - An existing __version__ var in the __init__.py file +# - Version in __version__ var is not a git tag already +# +# This process will generate: +# - Tag in Github repo: https://github.com/opentensor/validators/tags +# - Release in Github: https://github.com/opentensor/validators/releases +# - New entry in CHANGELOG.md file +# + +### +# Utils +### + +source ${BASH_SOURCE%/*}/utils.sh + +function help(){ + echo Usage: + echo \ \ $0 + echo + echo This script release a openvalidators version. + echo + echo This script needs: + echo \ \ - An existing __version__ var in the __init__.py file + echo \ \ - Version in __version__ var is not a git tag already + echo +} +### + +### +# Start of release process +### + +# 0. Check requirements +# Expected state for the execution environment +# - __version__ exists inside file 'openvalidators/__init__.py' +# - Version has the expected format + +CODE_WITH_VERSION='openvalidators/__init__.py' + +CODE_VERSION=`grep '__version__\ \=\ ' $CODE_WITH_VERSION | awk '{print $3}' | sed 's/"//g'` +VERSION=$CODE_VERSION + +if ! [[ "$CODE_VERSION" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]];then + echo_error "Requirement failure: Version in code '$CODE_VERSION' with wrong format" + exit 1 +fi + +# 1. Get options + +## Defaults +APPLY="false" +APPLY_ACTION="" + +while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + help + exit 0 + ;; + -A|--apply) + APPLY="true" + APPLY_ACTION="--apply" + shift # past argument + ;; + -T|--github-token) + GITHUB_TOKEN="$2" + shift # past argument + shift # past value + ;; + -*|--*) + echo "Unknown option $1" + exit 1 + ;; + *) + POSITIONAL_ARGS+=("$1") # save positional arg + shift # past argument + ;; + esac +done + +if [[ $APPLY == "true" ]]; then + echo_warning "Not a Dry run exection" +else + echo_warning "Dry run execution" +fi + +if [[ -z $GITHUB_TOKEN && $APPLY == "true" ]]; then + echo_error "Github token required (-T, --github-token)" + exit 1 +fi + +# 2. Checking version + +CURRENT_VERSION_EXISTS=$(git tag | grep $VERSION) +if [[ ! -z $CURRENT_VERSION_EXISTS ]]; then + echo_error "Current version '$VERSION' already exists" + help + exit 1 +fi + +PREV_VERSION_TAG=`get_git_tag_higher_version` + +TAG_NAME=v$VERSION + +## 2.1. Current VERSION is not already a tag + +echo_info "Detected new version tag: $VERSION" +echo_info "Previous version tag: $PREV_VERSION_TAG" +echo_info "Tag generated: $TAG_NAME" + +# 3. Create Github resources +if [[ $APPLY == "true" ]]; then + ${BASH_SOURCE%/*}/github_release.sh $APPLY_ACTION --github-token $GITHUB_TOKEN -P $PREV_VERSION_TAG -V $VERSION +else + ${BASH_SOURCE%/*}/github_release.sh $APPLY_ACTION $GITHUB_TOKEN -P $PREV_VERSION_TAG -V $VERSION +fi diff --git a/scripts/release/utils.sh b/scripts/release/utils.sh new file mode 100755 index 0000000..91ba2f4 --- /dev/null +++ b/scripts/release/utils.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function echo_error { + echo -e "${RED}[ERROR]${NC} $1" +} + +function echo_warning { + echo -e "${YELLOW}[WARNING]${NC} $1" +} + +function echo_info { + echo -e "${GREEN}[INFO]${NC} $1" +} + +function echo_json { + echo "{\"type\":\"$1\",\"message\":\"$2\"}" +} + +function get_git_tag_higher_version { + echo `git tag -l --sort -version:refname | head -n 1` +} \ No newline at end of file diff --git a/scripts/release/versioning.sh b/scripts/release/versioning.sh new file mode 100755 index 0000000..e9affb4 --- /dev/null +++ b/scripts/release/versioning.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +#### +# Utils +#### +source ${BASH_SOURCE%/*}/utils.sh +### + +# 1. Get options + +## Defaults +APPLY="false" + +while [[ $# -gt 0 ]]; do + case $1 in + -A|--apply) + APPLY="true" + shift # past argument + ;; + -U|--update) + VERSION_TYPE="$2" + shift # past argument + shift # past value + ;; + -*|--*) + echo "Unknown option $1" + exit 1 + ;; + *) + POSITIONAL_ARGS+=("$1") # save positional arg + shift # past argument + ;; + esac +done + +if [[ $VERSION_TYPE != "major" && $VERSION_TYPE != "minor" && $VERSION_TYPE != "patch" && $VERSION_TYPE != "rc" ]]; then + echo_error "Incorrect version type (-U|--update). Version types accepted: {major, minor, patch}" + exit 1 +fi + +VERSION=$(cat VERSION) +CODE_WITH_VERSION='openvalidators/__init__.py' + +MAJOR=$(awk -F. '{print $1}' <<< $VERSION) +MINOR=$(awk -F. '{print $2}' <<< $VERSION) +PATCH=$(awk -F. '{print $3}' <<< $VERSION) + +# RC version +RC=$(awk -F- '{print $NF}' <<< $version) +if [ -z $RC ]; then + CURRENT_VERSION="$MAJOR.$MINOR.$PATCH" +else + CURRENT_VERSION="$MAJOR.$MINOR.$PATCH-$RC" +fi + +case $VERSION_TYPE in + "major") + echo_info "Applying a $VERSION_TYPE update" + NEW_VERSION="$((MAJOR + 1)).0.0" + ;; + "minor") + echo_info "Applying a $VERSION_TYPE update" + NEW_VERSION="$MAJOR.$((MINOR + 1)).0" + ;; + "patch") + echo_info "Applying a $VERSION_TYPE update" + NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" + ;; + "rc") + SUFFIX=$2 + if [ -z $SUFFIX ]; then + echo_error "Suffix is needed when updating version to a RC" + exit 1 + fi + NEW_VERSION="$MAJOR.$MINOR.$PATCH-$SUFFIX" + ;; + *) + echo_error "This operation is not allowed. Try one of the following: {major, minor, patch, rc}" + exit 1 + ;; +esac + + +echo_info "Current version: $CURRENT_VERSION" +echo_info "New version: $NEW_VERSION" + +if [[ $APPLY == "true" ]]; then + echo_info "Updating version in code: sed -i "18,30s/$VERSION/$NEW_VERSION/g" $CODE_WITH_VERSION" + sed -i "18,30s/$VERSION/$NEW_VERSION/g" $CODE_WITH_VERSION +else + echo_warning "Dry run execution. Version update not applied" + echo_info "Use -A or --apply to apply changes" +fi \ No newline at end of file From 27221b19eb03dca40f3183d06382fd295047c3e2 Mon Sep 17 00:00:00 2001 From: isabella618033 Date: Wed, 16 Aug 2023 15:06:27 +0000 Subject: [PATCH 9/9] log only neuron and reward for config --- openvalidators/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvalidators/utils.py b/openvalidators/utils.py index d008f55..e9e6c92 100644 --- a/openvalidators/utils.py +++ b/openvalidators/utils.py @@ -54,7 +54,7 @@ def init_wandb(self, reinit=False): reinit=reinit, project=self.config.wandb.project_name, entity=self.config.wandb.entity, - config=self.config, + config={key: self.config.get(key, None) for key in ('neuron', 'reward')}, mode="offline" if self.config.wandb.offline else "online", dir=self.config.neuron.full_path, tags=tags,