Skip to content

Commit

Permalink
fix: run yamlfix
Browse files Browse the repository at this point in the history
This reverts commit 779f737.
  • Loading branch information
Psycojoker committed Oct 4, 2024
1 parent 15839f7 commit c91b07b
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
version: 2


updates:
- package-ecosystem: "pip"
directory: "/"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
name: Build


on:
push:
branches:
Expand All @@ -8,21 +10,27 @@ on:
pull_request:
branches:
- "*"


jobs:
build:
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }}
--password-stdin

- name: Download Docker cache image (if available)
run: docker pull ghcr.io/$GITHUB_REPOSITORY/build-cache || true

- name: Build the Docker image
run: |
git fetch --prune --unshallow --tags
docker build . -t pyaleph-node:${GITHUB_REF##*/} -f deployment/docker-build/pyaleph.dockerfile --cache-from=ghcr.io/$GITHUB_REPOSITORY/build-cache
- name: Push the image to the cache
# It's not possible to push packages from fork PRs.
if: github.ref == 'refs/heads/main' || github.event.pull_request.head.repo.full_name
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
---
name: Test code quality


on:
push:
branches:
- "*"


jobs:
code-quality:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install pip and hatch
run: |
sudo apt-get install -y python3-pip
pip3 install hatch hatch-vcs
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-code-quality-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-code-quality-${{ hashFiles('pyproject.toml') }}
- name: Run Hatch lint
run: hatch run linting:all
7 changes: 7 additions & 0 deletions .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
---
name: Test nix-shell


on:
push:
branches:
- 'doesnt_exist'


jobs:
nix-shell:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- name: Set up Nix
uses: cachix/install-nix-action@v27
with:
# Use channel nixos-23.11 for Linux and nixpkgs-23.11-darwin for macOS
nix_path: nixpkgs=channel:${{ matrix.os == 'macos-latest' && 'nixpkgs-24.05-darwin' || 'nixos-24.05' }}

- name: Run tests
run: nix-shell --run "hatch run testing:test -- ./src/ ./test/"
12 changes: 12 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
name: Test/Coverage with Python


on:
push:
branches:
Expand All @@ -8,6 +10,8 @@ on:
pull_request:
branches:
- "*"


jobs:
tests:
runs-on: ubuntu-22.04
Expand All @@ -24,24 +28,29 @@ jobs:
image: redis:7.0.10
ports:
- 127.0.0.1:6379:6379

steps:
- uses: actions/checkout@v4
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- name: Set up Python 3.12
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Install latest Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Set rust to nightly
run: |
rustup default nightly # Required to build some dependencies
- name: Cache dependencies
uses: actions/cache@v4
with:
Expand All @@ -55,14 +64,17 @@ jobs:
sudo apt-get install -y libpq-dev libsodium-dev libgmp-dev
- run: |
pip install hatch coverage
- run: |
sudo cp .github/openssl-ci.cnf /etc/ssl/openssl.cnf
export OPENSSL_CONF=/etc/ssl/openssl.cnf
touch config.yml # Fake config file for alembic
# TODO: determine why ResourceWarning warnings occur in some tests.
hatch run testing:test
- run: |
hatch run testing:cov
- uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-keygen.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
---
name: Test keys generation instruction from the README by booting the docker image


on:
push:
branches:
- main
pull_request:
branches:
- "*"


jobs:
generate-keys:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }}
--password-stdin

- name: Download Docker cache image (if available)
run: docker pull ghcr.io/$GITHUB_REPOSITORY/build-cache || true

- name: Build the Docker image
run: |
git fetch --prune --unshallow --tags
docker build . -t alephim/pyaleph-node:${GITHUB_REF##*/} -f deployment/docker-build/pyaleph.dockerfile --cache-from=ghcr.io/$GITHUB_REPOSITORY/build-cache
- name: Tag the image
run: |
docker tag alephim/pyaleph-node:${GITHUB_REF##*/} ghcr.io/$GITHUB_REPOSITORY/build-cache
- name: Generate keys
run: |
mkdir keys
docker run --rm --user root --entrypoint "" -v $(pwd)/keys:/opt/pyaleph/keys alephim/pyaleph-node:${GITHUB_REF##*/} chown aleph:aleph /opt/pyaleph/keys
docker run --rm --entrypoint "" -v $(pwd)/keys:/opt/pyaleph/keys alephim/pyaleph-node:${GITHUB_REF##*/} pyaleph --gen-keys --key-dir /opt/pyaleph/keys
- name: Ensure keys exists
run: |-
ls keys/node-pub.key
Expand Down
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
# mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all


build:
os: ubuntu-22.04
tools:
python: "3.12"

# Optionally set the version of Python and requirements required to build your docs
python:
install:
Expand Down
17 changes: 17 additions & 0 deletions deployment/docker-build/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,53 @@ nuls2:
api_url: https://apiserver.nuls.io/
explorer_url: https://nuls.world/
token_contract: NULSd6Hh1FjbnAktH1FFvFnTzfgFnZtgAhYut


ethereum:
enabled: false

# api_url: {{ ALEPH_ETHEREUM_URL }}
chain_id: 1
packing_node: false
sync_contract: "0x166fd4299364B21c7567e163d85D78d2fb2f8Ad5"
start_height: 11474360
token_contract: "0x27702a26126e0B3702af63Ee09aC4d1A084EF628"
token_start_height: 10939074


binancechain:
enabled: false
packing_node: false


mongodb:
uri: "mongodb://127.0.0.1:27017"
database: aleph


storage:
store_files: true
engine: mongodb


ipfs:
enabled: true
host: 127.0.0.1
port: 5001
gateway_port: 8080


aleph:
queue_topic: ALEPH-TEST


p2p:
host: 0.0.0.0
http_port: 4024
port: 4025
control_port: 4030
reconnect_delay: 60


sentry:
dsn:
12 changes: 12 additions & 0 deletions deployment/docker-build/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
---
# Starts all the services used by pyaleph, minus pyaleph itself. This is used for local development.
# Use the docker-compose/docker-compose.yml file for deployment.

version: '2.2'


volumes:
pyaleph-ipfs:
pyaleph-postgres:


services:

rabbitmq:
restart: always
image: rabbitmq:3.11.15-management
Expand All @@ -17,6 +23,7 @@ services:
ports:
- "127.0.0.1:5672:5672"
- "127.0.0.1:15672:15672"

p2p-service:
restart: always
image: alephim/p2p-service:0.1.3
Expand All @@ -37,6 +44,7 @@ services:
- "/etc/p2p-service/config.yml"
- "--private-key-file"
- "/etc/p2p-service/node-secret.pkcs8.der"

ipfs:
restart: always
image: ipfs/kubo:v0.15.0
Expand All @@ -52,6 +60,7 @@ services:
networks:
- pyaleph
command: ["daemon", "--enable-pubsub-experiment", "--migrate"]

postgres:
restart: always
image: postgres:15.1
Expand All @@ -66,12 +75,15 @@ services:
networks:
- pyaleph
shm_size: "2gb"

redis:
restart: always
image: redis:7.0.10
ports:
- "127.0.0.1:6380:6379"
networks:
- pyaleph


networks:
pyaleph:
Loading

0 comments on commit c91b07b

Please sign in to comment.