Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit f44873d

Browse files
gnunicornbkchr
authored andcommitted
Reorganising the repository - external renames and moves (#4074)
* Adding first rough ouline of the repository structure * Remove old CI stuff * add title * formatting fixes * move node-exits job's script to scripts dir * Move docs into subdir * move to bin * move maintainence scripts, configs and helpers into its own dir * add .local to ignore * move core->client * start up 'test' area * move test client * move test runtime * make test move compile * Add dependencies rule enforcement. * Fix indexing. * Update docs to reflect latest changes * Moving /srml->/paint * update docs * move client/sr-* -> primitives/ * clean old readme * remove old broken code in rhd * update lock * Step 1. * starting to untangle client * Fix after merge. * start splitting out client interfaces * move children and blockchain interfaces * Move trie and state-machine to primitives. * Fix WASM builds. * fixing broken imports * more interface moves * move backend and light to interfaces * move CallExecutor * move cli off client * moving around more interfaces * re-add consensus crates into the mix * fix subkey path * relieve client from executor * starting to pull out client from grandpa * move is_decendent_of out of client * grandpa still depends on client directly * lemme tests pass * rename srml->paint * Make it compile. * rename interfaces->client-api * Move keyring to primitives. * fixup libp2p dep * fix broken use * allow dependency enforcement to fail * move fork-tree * Moving wasm-builder * make env * move build-script-utils * fixup broken crate depdencies and names * fix imports for authority discovery * fix typo * update cargo.lock * fixing imports * Fix paths and add missing crates * re-add missing crates
1 parent 6ae3b6c commit f44873d

File tree

809 files changed

+8332
-6995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

809 files changed

+8332
-6995
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ doc
33
.idea/
44
Dockerfile
55
.dockerignore
6+
.local

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ rls*.log
2121
*.orig
2222
*.rej
2323
**/wip/*.stderr
24+
.local

.gitlab-ci.yml

+28-19
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ check-runtime:
7878
GITLAB_API: "https://gitlab.parity.io/api/v4"
7979
GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api"
8080
script:
81-
- ./scripts/gitlab/check_runtime.sh
81+
- ./.maintain/gitlab/check_runtime.sh
8282
allow_failure: true
8383

8484

@@ -89,7 +89,7 @@ check-line-width:
8989
only:
9090
- /^[0-9]+$/
9191
script:
92-
- ./scripts/gitlab/check_line_width.sh
92+
- ./.maintain/gitlab/check_line_width.sh
9393
allow_failure: true
9494

9595

@@ -117,7 +117,7 @@ cargo-check-subkey:
117117
except:
118118
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
119119
script:
120-
- cd ./subkey
120+
- cd ./bin/subkey
121121
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --release
122122
- sccache -s
123123

@@ -145,8 +145,17 @@ test-linux-stable: &test-linux
145145
paths:
146146
- ${CI_COMMIT_SHORT_SHA}_warnings.log
147147

148+
test-dependency-rules: &test-linux
149+
stage: test
150+
<<: *docker-env
151+
allow_failure: true
152+
except:
153+
variables:
154+
- $DEPLOY_TAG
155+
script:
156+
- .maintain/ensure-deps.sh
148157

149-
test-srml-staking: &test-srml-staking
158+
test-paint-staking: &test-paint-staking
150159
stage: test
151160
<<: *docker-env
152161
variables:
@@ -158,7 +167,7 @@ test-srml-staking: &test-srml-staking
158167
variables:
159168
- $DEPLOY_TAG
160169
script:
161-
- cd srml/staking/
170+
- cd paint/staking/
162171
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features std
163172
- sccache -s
164173

@@ -174,7 +183,7 @@ test-wasmtime: &test-wasmtime
174183
variables:
175184
- $DEPLOY_TAG
176185
script:
177-
- cd core/executor
186+
- cd client/executor
178187
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features wasmtime
179188
- sccache -s
180189

@@ -219,7 +228,7 @@ check-web-wasm:
219228
- time cargo web build -p substrate-consensus-common
220229
- time cargo web build -p substrate-telemetry
221230
# Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way.
222-
- time cargo build --manifest-path=node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown
231+
- time cargo build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown
223232
- sccache -s
224233

225234
node-exits:
@@ -228,7 +237,7 @@ node-exits:
228237
except:
229238
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
230239
script:
231-
- ./ci/check_for_exit.sh
240+
- ./.maintain/check_for_exit.sh
232241

233242

234243
test-full-crypto-feature: &test-full-crypto-feature
@@ -243,7 +252,7 @@ test-full-crypto-feature: &test-full-crypto-feature
243252
variables:
244253
- $DEPLOY_TAG
245254
script:
246-
- cd core/primitives/
255+
- cd primitives/core/
247256
- time cargo +nightly build --verbose --no-default-features --features full_crypto
248257
- cd ../application-crypto
249258
- time cargo +nightly build --verbose --no-default-features --features full_crypto
@@ -274,8 +283,8 @@ build-linux-substrate:
274283
fi
275284
- sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256
276285
- printf '\n# building node-template\n\n'
277-
- ./scripts/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz
278-
- cp -r scripts/docker/substrate.Dockerfile ./artifacts/substrate/
286+
- ./.maintain/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz
287+
- cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/
279288
- sccache -s
280289

281290
build-linux-subkey:
@@ -298,7 +307,7 @@ build-linux-subkey:
298307
sed -n -r 's/^subkey ([0-9.]+.*)/\1/p' |
299308
tee ./artifacts/subkey/VERSION;
300309
- sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256
301-
- cp -r scripts/docker/subkey.Dockerfile ./artifacts/subkey/
310+
- cp -r .maintain/docker/subkey.Dockerfile ./artifacts/subkey/
302311
- sccache -s
303312

304313
build-rust-doc-release:
@@ -314,7 +323,7 @@ build-rust-doc-release:
314323
<<: *build-only
315324
script:
316325
- rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds
317-
- BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/rustdoc-header.html" time cargo +nightly doc --release --all --verbose
326+
- BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd).maintain/rustdoc-header.html" time cargo +nightly doc --release --all --verbose
318327
- cp -R ./target/doc ./crate-docs
319328
- echo "<meta http-equiv=refresh content=0;url=substrate_service/index.html>" > ./crate-docs/index.html
320329
- sccache -s
@@ -533,10 +542,10 @@ publish-gh-doc:
533542
- echo "Substrate version = ${DEPLOY_TAG}"
534543
# or use helm to render the template
535544
- helm template
536-
--values ./scripts/kubernetes/values.yaml
545+
--values ./.maintain/kubernetes/values.yaml
537546
--set image.tag=${DEPLOY_TAG}
538547
--set validator.keys=${VALIDATOR_KEYS}
539-
./scripts/kubernetes | kubectl apply -f - --dry-run=false
548+
./.maintain/kubernetes | kubectl apply -f - --dry-run=false
540549
- echo "# substrate namespace ${KUBE_NAMESPACE}"
541550
- kubectl -n ${KUBE_NAMESPACE} get all
542551
- echo "# substrate's nodes' external ip addresses:"
@@ -598,16 +607,16 @@ deploy-ue1-tag:
598607
validator 1 4:
599608
<<: *validator-deploy
600609
script:
601-
- ./scripts/flamingfir-deploy.sh flamingfir-validator1
610+
- ./.maintain/flamingfir-deploy.sh flamingfir-validator1
602611
validator 2 4:
603612
<<: *validator-deploy
604613
script:
605-
- ./scripts/flamingfir-deploy.sh flamingfir-validator2
614+
- ./.maintain/flamingfir-deploy.sh flamingfir-validator2
606615
validator 3 4:
607616
<<: *validator-deploy
608617
script:
609-
- ./scripts/flamingfir-deploy.sh flamingfir-validator3
618+
- ./.maintain/flamingfir-deploy.sh flamingfir-validator3
610619
validator 4 4:
611620
<<: *validator-deploy
612621
script:
613-
- ./scripts/flamingfir-deploy.sh flamingfir-validator4
622+
- ./.maintain/flamingfir-deploy.sh flamingfir-validator4

Dockerfile .maintain/Dockerfile

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/docker/subkey.Dockerfile .maintain/docker/subkey.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LABEL io.parity.image.authors="devops-team@parity.io" \
88
io.parity.image.vendor="Parity Technologies" \
99
io.parity.image.title="parity/subkey" \
1010
io.parity.image.description="Subkey: key generating utility for Substrate." \
11-
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/scripts/docker/subkey.Dockerfile" \
11+
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/.maintain/docker/subkey.Dockerfile" \
1212
io.parity.image.revision="${VCS_REF}" \
1313
io.parity.image.created="${BUILD_DATE}" \
1414
io.parity.image.documentation="https://github.com/paritytech/substrate/tree/${VCS_REF}/subkey"

scripts/docker/substrate.Dockerfile .maintain/docker/substrate.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LABEL io.parity.image.authors="devops-team@parity.io" \
88
io.parity.image.vendor="Parity Technologies" \
99
io.parity.image.title="parity/substrate" \
1010
io.parity.image.description="Substrate: The platform for blockchain innovators." \
11-
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/scripts/docker/Dockerfile" \
11+
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/.maintain/docker/Dockerfile" \
1212
io.parity.image.revision="${VCS_REF}" \
1313
io.parity.image.created="${BUILD_DATE}" \
1414
io.parity.image.documentation="https://wiki.parity.io/Parity-Substrate"

.maintain/ensure-deps.sh

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
# The script is meant to check if the rules regarding packages
4+
# dependencies are satisfied.
5+
# The general format is:
6+
# [top-lvl-dir]<[crate-name-prefix]
7+
8+
# For instance no crate within `./client` directory
9+
# is allowed to import any crate with a directory path containing `paint`.
10+
# Such rule is just: `client<paint`.
11+
12+
# The script should be run from the main repo directory!
13+
14+
set -u
15+
16+
PLEASE_DONT=(
17+
"client<paint"
18+
"client<node"
19+
"paint<node"
20+
"paint<client"
21+
"primitives<paint"
22+
"primitives<client"
23+
)
24+
25+
VIOLATIONS=()
26+
PACKAGES=()
27+
28+
for rule in "${PLEASE_DONT[@]}"
29+
do
30+
from=$(echo $rule | cut -f1 -d\<)
31+
to=$(echo $rule | cut -f2 -d\<)
32+
33+
cd $from
34+
echo "Checking rule $rule"
35+
packages=$(find -name Cargo.toml | xargs grep -wn "path.*$to")
36+
has_references=$(echo -n $packages | wc -c)
37+
if [ "$has_references" != "0" ]; then
38+
VIOLATIONS+=("$rule")
39+
# Find packages that violate:
40+
PACKAGES+=("$packages")
41+
fi
42+
cd - > /dev/null
43+
done
44+
45+
# Display violations and fail
46+
I=0
47+
for v in "${VIOLATIONS[@]}"
48+
do
49+
cat << EOF
50+
51+
===========================================
52+
======= Violation of rule: $v
53+
===========================================
54+
${PACKAGES[$I]}
55+
56+
57+
EOF
58+
I=$I+1
59+
done
60+
61+
exit ${#VIOLATIONS[@]}
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/gitlab/check_runtime.sh .maintain/gitlab/check_runtime.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
#
33
#
4-
# check for any changes in the node/src/runtime, srml/ and core/sr_* trees. if
4+
# check for any changes in the node/src/runtime, paint/ and core/sr_* trees. if
55
# there are any changes found, it should mark the PR breaksconsensus and
66
# "auto-fail" the PR if there isn't a change in the runtime/src/lib.rs file
77
# that alters the version.
@@ -32,7 +32,7 @@ github_label () {
3232

3333
# check if the wasm sources changed
3434
if ! git diff --name-only origin/master...${CI_COMMIT_SHA} \
35-
| grep -q -e '^node/src/runtime' -e '^srml/' -e '^core/sr-' | grep -v -e '^core/sr-arithmetic/fuzzer'
35+
| grep -q -e '^node/src/runtime' -e '^paint/' -e '^core/sr-' | grep -v -e '^core/sr-arithmetic/fuzzer'
3636
then
3737
cat <<-EOT
3838
@@ -102,7 +102,7 @@ else
102102
103103
source file directories:
104104
- node/src/runtime
105-
- srml
105+
- paint
106106
- core/sr-*
107107
108108
versions file: ${VERSIONS_FILE}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/node-template-release.sh .maintain/node-template-release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ if [ "$#" -ne 1 ]; then
1111
fi
1212

1313
PATH_TO_ARCHIVE=$(pwd)/$1
14-
cd $PROJECT_ROOT/scripts/node-template-release
14+
cd $PROJECT_ROOT/.maintain/node-template-release
1515

1616
cargo run $PROJECT_ROOT/node-template $PATH_TO_ARCHIVE

scripts/runtime-dep.py .maintain/runtime-dep.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# pip install toml
55
# sudo apt-get install graphviz
66
# the first parameter is the runtime folder
7-
# python ./scripts/runtime-dep.py ./substrate/runtime | dot -Tpng -o output.png
7+
# python ./.maintain/runtime-dep.py ./substrate/runtime | dot -Tpng -o output.png
88
import sys
99
import os
1010
import toml
File renamed without changes.

scripts/sentry-node/docker-compose.yml .maintain/sentry-node/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
# 1. Build `target/release/substrate` binary: `cargo build --release`
1414
#
15-
# 2. Start networks and containers: `sudo docker-compose -f scripts/sentry-node/docker-compose.yml up`
15+
# 2. Start networks and containers: `sudo docker-compose -f .maintain/sentry-node/docker-compose.yml up`
1616
#
1717
# 3. Reach:
1818
# - polkadot/apps on localhost:3000
File renamed without changes.
File renamed without changes.
File renamed without changes.

.travis.yml

-28
This file was deleted.

0 commit comments

Comments
 (0)