Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/simnode workflow #461

Merged
merged 42 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
640e3b9
Update Makefile
haroldsphinx Nov 24, 2021
25d6886
Update release
haroldsphinx Nov 30, 2021
6c2edbf
Update release
haroldsphinx Nov 30, 2021
00f28ef
Merge branch 'main' of github.com:ComposableFi/composable into main
haroldsphinx Nov 30, 2021
ab24616
Update
haroldsphinx Dec 8, 2021
989f72b
Update
haroldsphinx Dec 8, 2021
663b334
Updating release
haroldsphinx Dec 8, 2021
c9e0725
Added runtime check
haroldsphinx Dec 13, 2021
45ea896
Update bootnode config
haroldsphinx Dec 16, 2021
3f26893
Merge main-sre to picasso
haroldsphinx Dec 16, 2021
a4f49a3
UPdate
haroldsphinx Dec 29, 2021
a7e1b64
Merge branch 'main' of github.com:ComposableFi/composable into main
haroldsphinx Jan 5, 2022
6e22b8d
Merge branch 'main' of github.com:ComposableFi/composable into main
haroldsphinx Jan 6, 2022
31eeed4
Consolidate all branches into main
haroldsphinx Jan 6, 2022
225dec0
Update
haroldsphinx Jan 9, 2022
243955b
Merge branch 'main' of github.com:ComposableFi/composable into main
haroldsphinx Jan 9, 2022
a1a1fff
Initalize cache
haroldsphinx Jan 9, 2022
b1612be
Initalize cache
haroldsphinx Jan 9, 2022
73e0bed
Initalize cache
haroldsphinx Jan 9, 2022
fe54baf
Initalize cache
haroldsphinx Jan 9, 2022
9b23e5d
Initalize cache
haroldsphinx Jan 9, 2022
95b5573
Initalize cache
haroldsphinx Jan 9, 2022
43811ee
Initalize cache
haroldsphinx Jan 9, 2022
779985d
Initalize cache
haroldsphinx Jan 9, 2022
8a5c655
Initalize cache
haroldsphinx Jan 9, 2022
407a5a6
Initalize cache
haroldsphinx Jan 9, 2022
486c812
Initalize cache
haroldsphinx Jan 9, 2022
5567451
Initalize cache
haroldsphinx Jan 9, 2022
9063dd2
Update build parameters
haroldsphinx Jan 9, 2022
9e97326
Update build parameters
haroldsphinx Jan 9, 2022
a95e134
Add simnode workflow
haroldsphinx Jan 9, 2022
fe46ac1
Add simonde to workflow file
haroldsphinx Jan 9, 2022
c46e856
Merge branch 'main' of github.com:ComposableFi/composable into featur…
haroldsphinx Jan 9, 2022
2e21a31
Add simonde to workflow file
haroldsphinx Jan 9, 2022
027525a
Merge branch 'main' of github.com:ComposableFi/composable into featur…
haroldsphinx Jan 10, 2022
f8d7ea8
Update ci
haroldsphinx Jan 10, 2022
797d984
Update ci
haroldsphinx Jan 10, 2022
296968d
Update cargo path
haroldsphinx Jan 10, 2022
54ae5d7
Update cargo path
haroldsphinx Jan 10, 2022
ee863f9
Update cargo path
haroldsphinx Jan 10, 2022
87663ce
Update cargo path
haroldsphinx Jan 10, 2022
8b0514e
Update cargo path
haroldsphinx Jan 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/Picasso-release.yml

This file was deleted.

43 changes: 17 additions & 26 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,18 @@ jobs:
- x64
- sre
steps:
- uses: xanantis/docker-file-ownership-fix@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin:$PATH" >> $GITHUB_PATH
- name: Check
run: |
SKIP_WASM_BUILD=1 cargo check --all --benches
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo check --all --benches
haroldsphinx marked this conversation as resolved.
Show resolved Hide resolved
- name: Benchmark
run: |
SKIP_WASM_BUILD=1 cargo check --features=runtime-benchmarks --workspace --release --exclude integration-tests
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo check --features=runtime-benchmarks --workspace --release --exclude integration-tests
- name: Picasso
run: |
cargo build --release -p picasso-runtime
/home/runner/.cargo/bin/cargo build --release -p picasso-runtime
linters:
name: Linters
runs-on:
Expand All @@ -47,18 +42,13 @@ jobs:
- sre
steps:
- uses: actions/checkout@v2
- name: Setup toolchain
run: |
sudo apt-get install libfreetype6-dev -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin:$PATH" >> $GITHUB_PATH
- run: |
rustup show
rustup override unset
rustup show
/home/runner/.cargo/bin/rustup show
/home/runner/.cargo/bin/rustup override unset
/home/runner/.cargo/bin/rustup show
- name: Cargo fmt
run: |
cargo fmt -- --check
/home/runner/.cargo/bin/cargo fmt -- --check
- name: Hadolint
env:
HADOLINT_VERSION: v2.8.0
Expand All @@ -75,7 +65,7 @@ jobs:
exit $total_exit_code
- name: Cargo clippy
run: |
cargo clippy -- -D warnings
/home/runner/.cargo/bin/cargo clippy -- -D warnings
- name: Cargo udeps
env:
UDEPS_VERSION: v0.1.24
Expand All @@ -96,19 +86,20 @@ jobs:
- sre
steps:
- uses: actions/checkout@v2
- name: Install toolchain for cargo-llvm-cov
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin:$PATH" >> $GITHUB_PATH
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
haroldsphinx marked this conversation as resolved.
Show resolved Hide resolved
seunlanlege marked this conversation as resolved.
Show resolved Hide resolved

- uses: actions/checkout@v2
- run: |
rustup component add llvm-tools-preview
/home/runner/.cargo/bin/rustup component add llvm-tools-preview
- name: Install cargo-llvm-cov
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: Run Test (with coverage)
run: |
SKIP_WASM_BUILD=1 cargo llvm-cov --workspace --lcov --output-path lcov.info
SKIP_WASM_BUILD=1 cargo clean -p picasso-runtime
SKIP_WASM_BUILD=1 cargo clean -p composable
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo llvm-cov --workspace --lcov --output-path lcov.info
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo clean -p picasso-runtime
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo clean -p composable
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/client-release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: "Dali-chachacha Community Release"
name: "Community Release (Dali Chacha)"

on:
push:
tags:
- '*'
branches:
- update-event-triggers
- feature/add-cache-build

env:
DOCKER_USER_OPTION: '$UID:$GID'
SCCACHE_GCS_BUCKET: 'composable-build-artefacts'
RUSTC_WRAPPER: "/home/runner/.cargo/bin/sccache"
SCCACHE_GCS_RW_MODE: "READ_WRITE"

jobs:
build-and-publish:
Expand All @@ -17,6 +20,8 @@ jobs:
- linux
- x64
- sre
strategy:
fail-fast: true
steps:
- uses: xanantis/docker-file-ownership-fix@v1
- uses: actions/checkout@v2
Expand All @@ -27,9 +32,20 @@ jobs:
run: |
echo "RELEASE_VERSION=$(git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1 )" >> $GITHUB_ENV
make version
- name: Build and Push Artifacts to gcloud

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: 🔨 Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --bins
haroldsphinx marked this conversation as resolved.
Show resolved Hide resolved

- name: Archive build targets
run: |
/home/runner/.cargo/bin/cargo build --release --bins
tar -czvf composable-${{ env.RELEASE_VERSION }}.tar.gz target/release/
tar -czvf composable-${{ env.RELEASE_VERSION }}.tar.gz target/release/composable
tar -czvf picasso_runtime.compact.wasm-${RELEASE_VERSION}.tar.gz target/release/wbuild/picasso-runtime/picasso_runtime.compact.wasm
tar -czvf parachain-utils-${RELEASE_VERSION}.tar.gz target/release/parachain-utils
Expand All @@ -43,6 +59,7 @@ jobs:

- name: Build Docker image
run: make containerize-release

- name: Docker push
run: make push-release

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/picashot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Runtime
seunlanlege marked this conversation as resolved.
Show resolved Hide resolved
on:
schedule:
- cron: '0 0 * * *'
jobs:
picashot:
runs-on:
- self-hosted
- linux
- X64
- ansible-runner

steps:
- name: Run ansible playbook
working-directory: "./.maintain/playbooks"
run: |
ansible-playbook -l _mainnet_collator_yes picashot.yml -i picasso-gcp.yaml --user root -e 'ansible_python_interpreter=/usr/bin/python3'

6 changes: 4 additions & 2 deletions .github/workflows/runtime-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ name: Check Runtime
on:
push:
branches:
- release/*
- release-*
- main
pull_request:
branches:
- release/*
- release-*
- main
jobs:
check-runtime:
runs-on: ubuntu-latest
Expand Down
39 changes: 0 additions & 39 deletions .maintain/check_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,13 @@ VERSIONS_FILE="runtime/picasso/src/lib.rs"
boldprint () { printf "|\n| \033[1m%s\033[0m\n|\n" "${@}"; }
boldcat () { printf "|\n"; while read -r l; do printf "| \033[1m%s\033[0m\n" "${l}"; done; printf "|\n" ; }

<<<<<<< HEAD
github_label () {
echo
echo "# run github-api job for labeling it ${1}"
curl -sS -X POST \
-F "token=${CI_JOB_TOKEN}" \
-F "ref=main" \
-F "variables[LABEL]=${1}" \
-F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \
"${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline"
}


boldprint "latest 10 commits of ${CI_COMMIT_REF_NAME}"
git log --graph --oneline --decorate=short -n 10

boldprint "make sure the main branch and dali-chachacha tag are available in shallow clones"
git fetch --depth="${GIT_DEPTH:-100}" origin main
git fetch --depth="${GIT_DEPTH:-100}" origin dali-chachacha
git tag -f dali-chachacha FETCH_HEAD
git log -n1 dali-chachacha


boldprint "check if the wasm sources changed"
if ! has_runtime_changes origin/master "${CI_COMMIT_SHA}"
=======

boldprint "latest 10 commits of ${GITHUB_REF_NAME}"
git log --graph --oneline --decorate=short -n 10


boldprint "check if the wasm sources changed"
if ! has_runtime_changes origin/main "${GITHUB_REF_NAME}"
>>>>>>> bbc78797a884a247a0eb17742f1eda5975252d60
then
boldcat <<-EOT

Expand All @@ -66,15 +39,9 @@ fi
# consensus-critical logic that has changed. the runtime wasm blobs must be
# rebuilt.

<<<<<<< HEAD
add_spec_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \
| sed -n -r "s/^\+[[:space:]]+spec_version: +([0-9]+),$/\1/p")"
sub_spec_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \
=======
add_spec_version="$(git diff tags/release ${GITHUB_SHA} -- "${VERSIONS_FILE}" \
| sed -n -r "s/^\+[[:space:]]+spec_version: +([0-9]+),$/\1/p")"
sub_spec_version="$(git diff tags/release ${GITHUB_SHA} -- "${VERSIONS_FILE}" \
>>>>>>> bbc78797a884a247a0eb17742f1eda5975252d60
| sed -n -r "s/^\-[[:space:]]+spec_version: +([0-9]+),$/\1/p")"


Expand All @@ -95,15 +62,9 @@ else
# check for impl_version updates: if only the impl versions changed, we assume
# there is no consensus-critical logic that has changed.

<<<<<<< HEAD
add_impl_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \
| sed -n -r 's/^\+[[:space:]]+impl_version: +([0-9]+),$/\1/p')"
sub_impl_version="$(git diff tags/release ${CI_COMMIT_SHA} -- "${VERSIONS_FILE}" \
=======
add_impl_version="$(git diff tags/release ${GITHUB_SHA} -- "${VERSIONS_FILE}" \
| sed -n -r 's/^\+[[:space:]]+impl_version: +([0-9]+),$/\1/p')"
sub_impl_version="$(git diff tags/release ${GITHUB_SHA} -- "${VERSIONS_FILE}" \
>>>>>>> bbc78797a884a247a0eb17742f1eda5975252d60
| sed -n -r 's/^\-[[:space:]]+impl_version: +([0-9]+),$/\1/p')"


Expand Down
7 changes: 7 additions & 0 deletions .maintain/files/backup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
DATE=$(date +'%m-%d-%Y')
FILENAME=composable-$DATE.zip
BACKUP_DIR="/var/lib/composable-data/chains"
GS_BUCKET="composable-picasso-data-sync"
zip -r $FILENAME $BACKUP_DIR
gsutil mv $FILENAME gs://$GS_BUCKET/
20 changes: 20 additions & 0 deletions .maintain/playbooks/picashot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Create Backup for Picasso nodes
hosts: all
become: true
tasks:
- name: Run Backup Script
become: true
shell: |
#!/bin/bash
DATE=$(date +'%m-%d-%Y')
HOST=$(echo $HOSTNAME)
FILENAME=$HOST-$DATE.zip
BACKUP_DIR="/var/lib/composable-data/chains"
GS_BUCKET="composable-picasso-data-sync"
zip -r $FILENAME $BACKUP_DIR
gsutil mv $FILENAME gs://$GS_BUCKET/
args:
executable: /bin/bash
register: stdout

4 changes: 1 addition & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM composablefi/rust:latest

ARG VERSION=v1.0.9
ARG VERSION

USER root

Expand All @@ -24,8 +24,6 @@ RUN curl "https://storage.googleapis.com/composable-binaries/community-releases/

RUN chmod +x target/release/composable && mv target/release/composable /usr/local/bin

RUN composable --version

RUN useradd -m -u 1001 -U -s /bin/sh -d /composable composable && \
mkdir -p /composable/.local/share/local_testnet && \
mkdir /data && \
Expand Down