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
4 changes: 0 additions & 4 deletions .codacy.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ dist
build
.github
.gitmodules
.venv
*.egg-info
20 changes: 0 additions & 20 deletions .github/copilot-instructions.md

This file was deleted.

8 changes: 0 additions & 8 deletions .github/dependabot.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Audit
on:
push:
schedule:
- cron: "0 6 * * 1"

permissions:
contents: read

jobs:
audit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.3.3
with:
version: "0.13.6"
- run: uv export --no-dev --no-emit-workspace --no-hashes -o requirements.txt
- run: uvx pip-audit==2.10.1 -r requirements.txt --no-deps --disable-pip -s osv
19 changes: 0 additions & 19 deletions .github/workflows/issue_check.yml

This file was deleted.

51 changes: 13 additions & 38 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,64 +16,39 @@ jobs:
runs-on: ubuntu-24.04
permissions:
contents: write
env:
BRANCH: ${{ github.base_ref }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
submodules: true

- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Calculate version
id: versioning
run: |
bash ./scripts/set_versions_ga.sh

- name: Determine prerelease status
id: release_info
run: |
if [[ "${{ env.BRANCH }}" == "stable" ]]; then
echo "prerelease=false" >> $GITHUB_OUTPUT
else
echo "prerelease=true" >> $GITHUB_OUTPUT
fi
export VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
echo "VERSION=$(bash ./helper-scripts/calculate_version.sh)" >> "$GITHUB_ENV"

- name: Build binaries
id: build
run: |
mkdir -p ${{ github.workspace }}/dist
mkdir -p ./dist
docker build . -t node-cli-builder

docker run --rm -v ${{ github.workspace }}/dist:/app/dist node-cli-builder \
bash scripts/build.sh ${{ env.VERSION }} ${{ env.BRANCH }} skale

docker run --rm -v ${{ github.workspace }}/dist:/app/dist node-cli-builder \
bash scripts/build.sh ${{ env.VERSION }} ${{ env.BRANCH }} fair

echo "dist_path=${{ github.workspace }}/dist" >> $GITHUB_OUTPUT

docker run --rm -v "$PWD/dist":/app/dist node-cli-builder bash scripts/build.sh "$VERSION" "$BRANCH" skale
docker run --rm -v "$PWD/dist":/app/dist node-cli-builder bash scripts/build.sh "$VERSION" "$BRANCH" fair

- name: Generate checksums
working-directory: dist
run: |
cd ${{ steps.build.outputs.dist_path }}
for file in skale-*; do
sha512sum "$file" > "$file.sha512"
done
echo "Checksums generated:"
ls -l *.sha512

- name: Create GitHub release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ env.VERSION }}
target_commitish: ${{ github.sha }}
name: Release ${{ env.VERSION }}
draft: false
prerelease: ${{ steps.release_info.outputs.prerelease }}
prerelease: ${{ github.base_ref != 'stable' }}
generate_release_notes: true
files: |
${{ steps.build.outputs.dist_path }}/skale-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
files: dist/skale-*
60 changes: 14 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,27 @@
name: Test
on: [push]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.14']
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
submodules: true

- name: Checkout submodules
run: git submodule update --init

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Cache uv
uses: actions/cache@v4
uses: astral-sh/setup-uv@v10.3.3
with:
path: ~/.cache/uv
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}

- name: Install ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install iptables nftables python3-nftables
version: "0.13.6"

- name: Install python dependencies
run: |
uv venv
uv pip install -e ".[dev]"
site_packages=$(uv run python -c 'import site; print(site.getsitepackages()[0])')
echo /usr/lib/python3/dist-packages > "$site_packages/ubuntu-system-packages.pth"
run: uv sync --all-extras

- name: Generate info
run: bash ./scripts/generate_info.sh 1.0.0 my-branch skale
run: bash ./scripts/generate_info.sh test test skale

- name: Check with ruff
run: |
Expand All @@ -54,33 +33,22 @@ jobs:
- name: Build binary - skale
run: |
mkdir -p ./dist
docker run -v /home/ubuntu/dist:/app/dist node-cli-builder bash scripts/build.sh test test skale
docker rm -f $(docker ps -aq)
docker run --rm -v "$PWD/dist":/app/dist node-cli-builder bash scripts/build.sh test test skale

- name: Check build - skale
run: sudo /home/ubuntu/dist/skale-test-Linux-x86_64
run: sudo ./dist/skale-test-Linux-x86_64

- name: Build binary - fair
run: |
mkdir -p ./dist
docker run -v /home/ubuntu/dist:/app/dist node-cli-builder bash scripts/build.sh test test fair
docker rm -f $(docker ps -aq)
docker run --rm -v "$PWD/dist":/app/dist node-cli-builder bash scripts/build.sh test test fair

- name: Check build - fair
run: sudo /home/ubuntu/dist/skale-test-Linux-x86_64-fair

- name: Run prepare test build
run: |
uv run bash scripts/build.sh test test skale
run: sudo ./dist/skale-test-Linux-x86_64-fair

- name: Run redis
- name: Run nftables tests
run: |
bash ./helper-scripts/redis/run.sh
bash ./scripts/run_nftables_test.sh

- name: Run tests
run: |
uv run bash ./scripts/run_tests.sh

- name: Run nftables tests
run: |
uv run scripts/run_nftables_test.sh
111 changes: 3 additions & 108 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,128 +1,23 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
#*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

*.log
.idea/
.vscode/

.zed
.DS_Store
uv.lock

# info.py file generated automatically during package build
node_cli/cli/info.py

meta.json

block_device.txt
sgx_server_url.txt
resource_allocation.json
conf.json
test-env

nginx.conf
tests/.skale/node_data/docker.json
tests/.skale/node_data/node_options.json
tests/.skale/config/nginx.conf.j2

.zed
uv.lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
Loading
Loading