Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/common_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version:
# - "3.9"
- "3.11"
poetry-version: ["1.3.2"]
poetry-version: ["1.8.3"]
os: [ubuntu-20.04,]
runs-on: ${{ matrix.os }}
env:
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Publish package on main branch if it's tagged with 'v*'

name: release & publish workflow

# Controls when the action will run.
on:
# Triggers the workflow on push events but only for the master branch
push:
tags:
- 'v*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "release"
release:
name: Create Release
runs-on: ubuntu-20.04

strategy:
matrix:
python-versions: [3.10]

permissions:
contents: write
steps:
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash

- uses: actions/checkout@v2
with:
submodules: 'recursive'

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-versions }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: ${{ matrix.poetry-version }}
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/my-custom-path
installer-parallel: true

- name: Update Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
id: changelog
with:
token: ${{ secrets.GH_TOKEN }}
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
unreleased: true
addSections: '{"documentation":{"prefix":"**Documentation:**","labels":["documentation"]}}'

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Changelog for PR
file_pattern: CHANGELOG.md
branch: main
push_options: '--force'

- name: Install Project
run: |
make install

- name: Push packages To Registry
run: |
make hashes

- name: create github release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
body: ${{ steps.changelog.outputs.changelog }}
files: packages/packages.json
draft: false
prerelease: false

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@ packages/eightballer/protocols/websockets
packages/eightballer/connections/http_client
packages/eightballer/connections/http_server
packages/eightballer/connections/websocket_server

packages/eightballer/protocols/default
packages/eightballer/protocols/prometheus
packages/eightballer/connections/prometheus
packages/eightballer/skills/metrics
packages/eightballer/skills/prometheus
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Makefile

HOOKS_DIR = .git/hooks

.PHONY: clean
clean: clean-build clean-pyc clean-test clean-docs

Expand Down Expand Up @@ -44,7 +46,7 @@ clean-test:
.PHONY: hashes
hashes: clean
poetry run autonomy packages lock
poetry run adev -v -n 0 lint
poetry run autonomy push-all

lint:
poetry run adev -v -n 0 lint
Expand All @@ -56,8 +58,20 @@ test:
poetry run adev -v test

install:
@echo "Setting up Git hooks..."

# Create symlinks for pre-commit and pre-push hooks
cp scripts/pre_commit_hook.sh $(HOOKS_DIR)/pre-commit
cp scripts/pre_push_hook.sh $(HOOKS_DIR)/pre-push
chmod +x $(HOOKS_DIR)/pre-commit
chmod +x $(HOOKS_DIR)/pre-push
@echo "Git hooks have been installed."
@echo "Installing dependencies..."
bash install.sh
@echo "Dependencies installed."
@echo "Syncing packages..."
poetry run autonomy packages sync
@echo "Packages synced."

sync:
git pull
Expand Down
19 changes: 10 additions & 9 deletions adev_config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
autonomy_dependencies:
- name: open-autonomy
version: 0.15.2
version: 0.19.4
location: remote
url: https://api.github.com/repos/valory-xyz/open-autonomy
plugins: &id001
- open-aea-test-autonomy
extras: null
- name: open-aea
version: 1.55.0
version: 1.64.0
location: remote
url: https://api.github.com/repos/valory-xyz/open-aea
plugins: &id002
Expand All @@ -16,21 +16,22 @@ autonomy_dependencies:
- open-aea-ledger-cosmos
- open-aea-cli-ipfs
extras: null
- name: stations_stations
version: 0.1.0
poetry_dependencies:
- name: autonomy-dev
version: 0.2.135
location: remote
url: https://api.github.com/repos/StationsStation/stations_station
url: https://api.github.com/repos/8ball030/auto_dev
plugins: null
extras: null
poetry_dependencies:
extras:
- all
- name: open-autonomy
version: 0.15.2
version: 0.19.4
location: remote
url: https://api.github.com/repos/valory-xyz/open-autonomy
plugins: *id001
extras: null
- name: open-aea
version: 1.55.0
version: 1.64.0
location: remote
url: https://api.github.com/repos/valory-xyz/open-aea
plugins: *id002
Expand Down
26 changes: 19 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -euo pipefail
PROTOC_VERSION="27.2"
PROTOLINT_VERSION="0.50.0"


# Function to get the appropriate download URL based on OS and architecture
get_download_url() {
local tool=$1
Expand Down Expand Up @@ -60,6 +61,7 @@ get_download_url() {
install_tool() {
local tool=$1
local url
local venv_dir=$(echo $(poetry run which python) | sed 's|\(.*\)/python|\1|')
url=$(get_download_url "$tool") || return 1

echo "Installing $tool"
Expand Down Expand Up @@ -93,14 +95,14 @@ install_tool() {
esac

if [ "$tool" = "protoc" ]; then
if ! command -v protoc &> /dev/null; then
sudo mv bin/protoc /usr/local/bin/protoc
if ! which protoc &> /dev/null; then
mv bin/protoc $venv_dir/protoc
else
echo "protoc is already installed, skipping..."
fi
elif [ "$tool" = "protolint" ]; then
if ! command -v protolint &> /dev/null; then
sudo mv protolint /usr/local/bin/protolint
if ! which protolint &> /dev/null; then
mv protolint $venv_dir/protolint
else
echo "protolint is already installed, skipping..."
fi
Expand Down Expand Up @@ -135,10 +137,12 @@ function install_poetry_deps() {

echo "Installing package dependencies via poetry..."
echo "Using poetry executable: $poetry_executable"
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
poetry install > /dev/null || exit 1
echo "Checking if aea is installed"
poetry run aea --version
echo "Done installing dependencies"

}
# Main execution

Expand All @@ -153,15 +157,24 @@ function set_env_file () {
function setup_autonomy() {
echo "Setting up autonomy"
echo 'Initializing the author and remote for aea and syncing packages...'
author=$(cat ~/.aea/cli_config.yaml | yq -r '.author') || author="ci"

# Extract author from config file with fallback to ci
author=$(grep "^author:" ~/.aea/cli_config.yaml 2>/dev/null | sed 's/author:[[:space:]]*//') || author="ci"

poetry run aea init --remote --author $author > /dev/null || exit 1
echo 'Done initializing the author and remote for aea using the author: ' $author
echo 'To change the author, run the command;
`poetry run aea init --remote --author <author>`'
poetry run autonomy packages sync > /dev/null || echo 'Warning: failed to sync packages as part of autonomy setup'

if [ -f "packages/packages.json" ]; then
echo 'Syncing packages...'
poetry run autonomy packages sync > /dev/null || echo 'Warning: failed to sync packages as part of autonomy setup'
fi
}

main() {
install_poetry_deps

install_tool "protoc" || exit 1
install_tool "protolint" || exit 1

Expand All @@ -170,7 +183,6 @@ main() {
verify "protolint"
verify "docker"

install_poetry_deps

echo "Installation completed successfully!"
setup_autonomy
Expand Down
1 change: 0 additions & 1 deletion packages/asiyaasha/customs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2024 eightballer
Expand Down
5 changes: 2 additions & 3 deletions packages/asiyaasha/customs/simple_svelte/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2024 eightballer
Expand All @@ -19,8 +18,8 @@

"""This module contains a custom package."""

from . import behaviours as custom_behaviours
from . import handlers as custom_handlers
from . import handlers as custom_handlers, behaviours as custom_behaviours


behaviours = custom_behaviours
handlers = custom_handlers
30 changes: 9 additions & 21 deletions packages/asiyaasha/customs/simple_svelte/behaviours.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""
Behaviours for the simple react skill.
"""
"""Behaviours for the simple react skill."""

import os
from typing import cast
from pathlib import Path
from typing import Optional, cast

from aea.skills.base import Behaviour

Expand All @@ -22,39 +20,30 @@ class LogReadingBehaviour(Behaviour):
log_file: str = ""

@property
def strategy(self) -> Optional[str]:
def strategy(self) -> str | None:
"""Get the strategy."""
return cast(
UserInterfaceClientStrategy, self.context.user_interface_client_strategy
)
return cast(UserInterfaceClientStrategy, self.context.user_interface_client_strategy)

def setup(self):
"""
Implement the setup.
"""
"""Implement the setup."""
super().setup()
self.lines = 0
self.client_to_lines = {}
self.log_file = os.environ.get("LOG_FILE", "log.txt")

def send_message(self, data, dialogue):
"""
Send a message to the client.
"""
"""Send a message to the client."""
msg = dialogue.reply(
performative=WebsocketsMessage.Performative.SEND,
data=data,
)
self.context.outbox.put_message(message=msg)

def teardown(self):
"""
Implement the handler teardown.
"""
"""Implement the handler teardown."""

def act(self):
"""
We read in the log file and send the new lines to the client.
"""We read in the log file and send the new lines to the client.
We do so in an efficent manner, only reading the new lines.
we make sure to send a message to all clients.
"""
Expand All @@ -64,10 +53,9 @@ def read_log(self):
"""Read in each log line."""
with open(
Path(self.log_file),
"r",
encoding="utf-8",
) as f:
for line in f.readlines()[self.lines :]:
self.lines += 1
for _, dialogue in self.strategy.clients.items():
for dialogue in self.strategy.clients.values():
self.send_message(line, dialogue)
10 changes: 5 additions & 5 deletions packages/asiyaasha/customs/simple_svelte/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ description: A simple svelte frontend to act as a template for the frontend ABCI
license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeie3a4f2zzoofzbe6yy6rivj7qtj4kye6qrl74kgfvs3gm3zrczwx4
behaviours.py: bafybeigf3axasho2oxlc3bpnfadmsndoqgmsh4kjx3xdbaumyx2ic5idze
__init__.py: bafybeidwwtpfuhelmwdkgh2ayk6hls62xpxns33f27qsryzd4vh2kw6hxq
behaviours.py: bafybeiadbbujl23thcggr55up7t7jo5nxjk5qty7uqf75xgw57nzrq3dwy
build/bundle.css: bafybeigcfqff5em6lncxdxjljlsljziorenci4ichs4mta2lkr47eywlkq
build/bundle.js: bafybeic74qdrccddktf5l4riule6q2zulyniidqqycnykgtesjzs4pt5w4
build/bundle.js.map: bafybeihvlujfytrgsomtp5lsa7rbb6yxtxr4ba236cd34aftltqvsnmmzq
build/index.html: bafybeicsji44ylcjyxrtswr53feqsecdixykfkgbnewgv4f2jnmztxjnou
handlers.py: bafybeib3i6iizz7qe5dstrrcp4475lp5e5u5ni3gauemnmpduqsnnsna4i
handlers.py: bafybeiadt4dx2psweh5czv6yuk2qyqxkt7a64pkswya6iizcw4m7rwoi2y
openapi3_spec.yaml: bafybeiagdbghwj4t4o7uctojvtkjp7i6zxpwu6dltjsawcaeuteyipftty
readme.md: bafybeiabx7q7jiwr7vfucj5rdekzhhqac2tcezamtg7nwoup3bicfgrsoa
tests/__init__.py: bafybeih4oyyzgld4vqtbub6zrcrrfofbhmhbr37rvoxuhzchn3bhhjs7za
tests/test_simple_html.py: bafybeidafbtgi6v6gnvlkaxiyocgebdkrgcfzoj4j27zsfjbjjviaio6li
tests/__init__.py: bafybeiayjxaqrjpu7poz56eozqbi4ln7uene4r27bnq5qeely3ambcmggm
tests/test_simple_html.py: bafybeiaqu3mw6kq5yq7blk5vjrd5mtw5ej55vs32ftxdf225k3semjyn4u
fingerprint_ignore_patterns: []
dependencies: {}
api_spec: open_api3_spec.yaml
Expand Down
Loading
Loading