chore: Reorganize directory structure and update README [fixes FLU-276] (#96)

* Update

* Typo

* Update

* Fixes

* Fix

* docs: Added CONTRIBUTING and LICENSE-related words to README

* docs: a few typos fixed

---------

Co-authored-by: Mikhail <mikhail.zotov@fluence.one>
This commit is contained in:
Anatolios Laskaris 2023-02-22 09:42:26 +02:00 committed by GitHub
parent a58b8efff1
commit 9b6fe501d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 216 additions and 9478 deletions

13
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,13 @@
## Contribute Code
You are welcome to contribute to Fluence!
Things you need to know:
1. You need to **agree to the [Contributor License Agreement](https://gist.github.com/fluencelabs-org/3f4cbb3cc14c1c0fb9ad99d8f7316ed7) (CLA)**. This is a common practice in all major Open Source projects. At the current moment, we are unable to accept contributions made on behalf of a company. Only individual contributions will be accepted.
2. **Not all proposed contributions can be accepted**. Some features may, e.g., just fit a third-party add-on better. The contribution must fit the overall direction of Fluence and really improve it. The more effort you invest, the better you should clarify in advance whether the contribution fits: the best way would be to just open an issue to discuss the contribution you plan to make.
### Contributor License Agreement
When you contribute, you have to be aware that your contribution is covered by **[Apache License 2.0](./LICENSE)**, but might relicensed under few other software licenses mentioned in the **Contributor License Agreement**. In particular, you need to agree to the Contributor License Agreement. If you agree to its content, you simply have to click on the link posted by the CLA assistant as a comment to the pull request. Click it to check the CLA, then accept it on the following screen if you agree to it. The CLA assistant will save this decision for upcoming contributions and will notify you if there is any change to the CLA in the meantime.

113
README.md
View File

@ -1,89 +1,40 @@
# [rust-peer distro](https://github.com/fluencelabs/node-distro)
# Rust Peer Distro
The distributive and packaging of the
[rust-peer](https://github.com/fluencelabs/rust-peer).
The distributive and packaging of the [Rust peer](https://github.com/fluencelabs/rust-peer).
Currently provides Network Dashboard as a side-car.
## Image tags
| Container flavour | IPFS daemon | services | binaries |
| ----------------- | ----------- | -------------------------------- | ------------------------------------------ |
| minimal | ❌ | aqua-ipfs, trust-graph, registry | curl, ipfs |
| ipfs | ✅ | aqua-ipfs, trust-graph, registry | curl, ipfs |
| rich | ✅ | aqua-ipfs, trust-graph, registry | curl, ipfs, ceramic, bitcoin cli, geth cli |
`latest` points to the latest version of `ipfs` flavour
### minimal
Contains rust-peer itself and some builtin services:
- [aqua-ipfs](https://github.com/fluencelabs/aqua-ipfs)
- [trust-graph](https://github.com/fluencelabs/trust-graph)
- [registry](https://github.com/fluencelabs/registry)
For those who want to run IPFS node separately. Serves as a base image for all
other image flavours.
`FLUENCE_ENV_AQUA_IPFS_*` variables must be defined and point to externally
running IPFS daemon in order for aqua-ipfs to work. If not defined aqua-ipfs
builtin will be removed.
| variable | default | description |
| ---------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR` | `/dns4/ipfs.fluence.dev/tcp/5001` | advertised to clients (eg frontend apps) to use in uploading files (`ipfs.put`), managing pins (`ipfs.pin`) etc |
| `FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR` | `/dns4/ipfs.fluence.dev/tcp/5001` | used by aqua-ipfs builtin to connect to IPFS node |
### ipfs
rust-peer packaged with
[IPFS node](https://docs.ipfs.io/how-to/command-line-quick-start/#take-your-node-online)
running inside container.
| variable | default | description |
| ---------------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `IPFS_PATH` | `/config/ipfs` | IPFS node data directory |
| `IPFS_LOG_PATH` | `/log/ipfs` | directory where IPFS will store its logs |
| `IPFS_MIGRATE_FS` | `false` | automatically run [fs-repo-migrations](https://github.com/ipfs/fs-repo-migrations) on start |
| `IPFS_ADDRESSES_SWARM` | `/ip4/0.0.0.0/tcp/4001,/ip4/0.0.0.0/tcp/4001/ws` | IPFS swarm multiaddr |
| `IPFS_ADDRESSES_API` | `/ip4/0.0.0.0/tcp/5001` | IPFS API multiaddr |
| `IPFS_ADDRESSES_GATEWAY` | `/ip4/0.0.0.0/tcp/8080` | IPFS gateway multiaddr |
| `IPFS_ADDRESSES_ANNOUNCE` | `/ip4/127.0.0.1/tcp/4001,/ip4/127.0.0.1/tcp/4001/ws` | IPFS p2p multiaddr of the IPFS swarm protocol |
| `FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | advertised to clients (eg frontend apps) to use in uploading files (`ipfs.put`), managing pins (`ipfs.pin`) etc |
| `FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | used by aqua-ipfs builtin to connect to IPFS node |
### rich
rust-peer packaged with IPFS node,
[Ceramic](https://developers.ceramic.network/learn/welcome/) CLI and some other
binaries like bitcoin-cli or
[geth](https://geth.ethereum.org/docs/interface/command-line-options).
| variable | default | description |
| ---------------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `CERAMIC_HOST` | | ceramic daemon address |
| `IPFS_PATH` | `/config/ipfs` | IPFS node data directory |
| `IPFS_LOG_PATH` | `/log/ipfs` | directory where IPFS will store its logs |
| `IPFS_MIGRATE_FS` | `false` | automatically run [fs-repo-migrations](https://github.com/ipfs/fs-repo-migrations) on start |
| `IPFS_ADDRESSES_SWARM` | `/ip4/0.0.0.0/tcp/4001,/ip4/0.0.0.0/tcp/4001/ws` | IPFS swarm multiaddr |
| `IPFS_ADDRESSES_API` | `/ip4/0.0.0.0/tcp/5001` | IPFS API multiaddr |
| `IPFS_ADDRESSES_GATEWAY` | `/ip4/0.0.0.0/tcp/8080` | IPFS gateway multiaddr |
| `IPFS_ADDRESSES_ANNOUNCE` | `/ip4/127.0.0.1/tcp/4001,/ip4/127.0.0.1/tcp/4001/ws` | IPFS announce multiaddr |
| `FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | advertised to clients (eg frontend apps) to use in uploading files (`ipfs.put`), managing pins (`ipfs.pin`) etc |
| `FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | used by aqua-ipfs builtin to connect to IPFS node |
## How to run
Copy [`docker-compose.yml`](https://github.com/fluencelabs/node-distro/blob/main/docker-compose.yml) locally and run
## Installation and usage
```bash
docker-compose up -d
docker run -d --name rust-peer -e RUST_LOG="info" -p 7777:7777 -p 9999:9999 fluencelabs/rust-peer:latest --local
```
That will run 2 containers: local rust-peer and Network Dashboard connected to
it.
To get a list of commands that can be passed to rust-peer run:
## How to open dashboard
```bash
docker run --rm --name rust-peer fluencelabs/rust-peer:latest --help
```
See deployment instructions and tips at [deploy](deploy).
## Documentation
- Rust peer distro [image flavours](docs/flavours.md)
- [Builtin services](docs/builtins.md)
Comprehensive documentation on everything related to Fluence can be found [here](https://fluence.dev/). Check also our [YouTube channel](https://www.youtube.com/@fluencelabs).
## Support
Please, file an [issue](https://github.com/fluencelabs/rust-peer-distro/issues) if you find a bug. You can also contact us at [Discord](https://discord.com/invite/5qSnPZKh7u) or [Telegram](https://t.me/fluence_project). We will do our best to resolve the issue ASAP.
## Contributing
Any interested person is welcome to contribute to the project. Please, make sure you read and follow some basic [rules](./CONTRIBUTING.md). The Contributor License Agreement can be found [here](./FluenceCLA).
## License
All software code is copyright (c) Fluence Labs, Inc. under the [Apache-2.0](./LICENSE) license.
Open [http://localhost:8080](http://localhost:8080) in your browser

10
deploy/README.md Normal file
View File

@ -0,0 +1,10 @@
# Running Rust Peer
Currently there is only one way to try out the Rust peer. It is by running it with [docker-compose](docker-compose/). An example configuration for popular orchestration platforms like [HasiCorp Nomad](https://www.nomadproject.io/) and K8S are coming soon! Meanwhile, you can adapt [this docker-compose file](docker-compose/docker-compose.yml) for the platform of your choice.
## Configuring Rust Peer Distro Image
Checkout [this doc](../docs/flavours.md) to learn more about Rust peer image
flavours and environment variables used to configure the images.

View File

@ -0,0 +1,40 @@
# Run rust-peer with docker-compose
This docker-compose file starts a local network of three rust-peers.
## Installing docker and docker-compose
Follow official instruction for
[docker](https://docs.docker.com/engine/install/) and
[docker-compose](https://docs.docker.com/compose/install/linux/#install-using-the-repository).
## Running local rust-peer network
1. Either `git clone` this repository locally and run `cd deploy/docker-compose`
or download [`docker-compose.yml`](docker-compose.yml) directly.
2. Ensure you have the most up-to-date container images:
```bash
docker-compose pull
```
3. Run the network:
```bash
docker-compose up -d
```
## Accessing local rust-peer network
Using fluence-cli follow the
[example workflow](https://github.com/fluencelabs/fluence-cli/blob/main/docs/EXAMPLE.md#currently-supported-workflow-example)
appending `--relay <peer-multiaddr>` to `run` commands.
Local network multiaddresses:
| container | multiaddress |
| --------- | ----------------------------------------------------------------------------------- |
| peer-1 | /ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR |
| peer-2 | /ip4/127.0.0.1/tcp/9992/ws/p2p/12D3KooWQdpukY3p2DhDfUfDgphAqsGu5ZUrmQ4mcHSGrRag6gQK |
| peer-3 | /ip4/127.0.0.1/tcp/9993/ws/p2p/12D3KooWRT8V5awYdEZm6aAV9HWweCEbhWd7df4wehqHZXAB7yMZ |

View File

@ -0,0 +1,39 @@
services:
peer-1:
image: fluencelabs/rust-peer:latest
ports:
- 7771:7771
- 9991:9991
command:
- --aqua-pool-size=2
- -t=7771
- -w=9991
- --local
# 12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR
- -k=hK62afickoeP2uZbmSkAYXxxqP8ozq16VRN7qfTP719EHC5V5tjrtW57BSjUr8GvsEXmJRbtejUWyPZ2rZMyQdq
peer-2:
image: fluencelabs/rust-peer:latest
ports:
- 7772:7772
- 9992:9992
command:
- --aqua-pool-size=2
- -t=7772
- -w=9992
- --bootstraps=/dns/peer-1/tcp/7771
# 12D3KooWQdpukY3p2DhDfUfDgphAqsGu5ZUrmQ4mcHSGrRag6gQK
- -k=2WijTVdhVRzyZamWjqPx4V4iNMrajegNMwNa2PmvPSZV6RRpo5M2fsPWdQr22HVRubuJhhSw8BrWiGt6FPhFAuXy
peer-3:
image: fluencelabs/rust-peer:latest
ports:
- 7773:7773
- 9993:9993
command:
- --aqua-pool-size=2
- -t=7773
- -w=9993
- --bootstraps=/dns/peer-1/tcp/7771
# 12D3KooWRT8V5awYdEZm6aAV9HWweCEbhWd7df4wehqHZXAB7yMZ
- -k=2n2wBVanBeu2GWtvKBdrYK9DJAocgG3PrTUXMharq6TTfxqTL4sLdXL9BF23n6rsnkAY5pR9vBtx2uWYDQAiZdrX

View File

@ -1,63 +0,0 @@
version: "3.8"
# management secret key is NAB5rGwT4qOEB+6nLQawkTfCOV2eiFSjgQK8bfEdZXY=
services:
fluence: # /ip4/127.0.0.1/tcp/9990/ws/p2p/12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK
command: -f ed25519 -k 29Apzfedhw2Jxh94Jj4rNSmavQ1TkNe8ALYRA7bMegobwp423aLrURxLk32WtXgXHDqoSz7GAT9fQfoMhVd1e5Ww -m 12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy -t 7770 -w 9990 --local
container_name: fluence
environment:
RUST_BACKTRACE: full
RUST_LOG: info,network=trace,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info,kademlia::behaviour=info
WASM_LOG: info
image: fluencelabs/rust-peer:ipfs_v0.0.74
ports:
- 4001:4001 # ipfs swarm
- 5001:5001 # ipfs rpc
- 7770:7770 # tcp
- 9990:9990 # ws
- 18080:18080 # /metrics
restart: always
volumes:
- fluence:/.fluence
networks:
- fluence
env.json:
restart: "no"
# depends_on:
# - fluence
image: busybox:stable
volumes:
- env.json:/env
command:
- sh
- -c
- |
cat <<EOF > /env/env.json
{
"nodes": [
{
"multiaddr": "/dns4/localhost/tcp/9990/ws/p2p/12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK",
"peerId": "12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK"
}
]
}
EOF
dashboard:
depends_on:
- env.json
image: fluencelabs/dashboard:latest
volumes:
- env.json:/dist/env
networks:
- fluence
ports:
- 8080:8080
volumes:
fluence: null
env.json: null
networks:
fluence: null

22
docs/builtins.md Normal file
View File

@ -0,0 +1,22 @@
# Builtin services
Rust peer distro comes with preconfigured builtin services.
## [registry](https://github.com/fluencelabs/registry)
Registry implements service discovery.
## [aqua-ipfs](https://github.com/fluencelabs/aqua-ipfs)
This is a native IPFS integration with [Aqua](https://fluence.dev/docs/aqua-book/introduction) language. It is used to orchestrate IPFS file transfer with Aqua scripts.
Image flavours [ipfs](flavours.md#ipfs) and [rich](flavours.md#rich) have an IPFS daemon running as a sidecar and `aqua-ipfs` configured to use this sidecar IPFS daemon. [minimal](flavours.md#minimal) connects to an IPFS daemon hosted by [Fluence Labs](https://fluence.network).
In case you want to use a separately running IPFS daemon, you need to inject two variables:
- `FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR` - advertised to clients (e.g., frontend apps) to use in uploading files (`ipfs.put`), managing pins (`ipfs.pin`) etc.
- `FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR` - used by the `aqua-ipfs` builtin to connect to IPFS node
## [trust-graph](https://github.com/fluencelabs/trust-graph)
It can be used to create a trusted network, to manage service permissions with TLS certificates and other security related things.

60
docs/flavours.md Normal file
View File

@ -0,0 +1,60 @@
# Rust Peer Distro Flavours
Each flavour is represented by a docker image tag. See the [docker hub](https://hub.docker.com/r/fluencelabs/rust-peer) and the [releases](https://github.com/fluencelabs/rust-peer-distro/releases) page.
Each flavour builds upon its previous flavour. In particular, `ipfs` has everything that `minimal` has, and `rich` has everything that `minimal` and `ipfs` have.
| flavour | IPFS daemon | services | binaries |
| ------- | ----------- | -------------------------------- | ------------------------------------------ |
| minimal | ❌ | aqua-ipfs, trust-graph, registry | curl, ipfs |
| ipfs | ✅ | aqua-ipfs, trust-graph, registry | curl, ipfs |
| rich | ✅ | aqua-ipfs, trust-graph, registry | curl, ipfs, ceramic, bitcoin cli, geth cli |
Tag `latest` points to the latest version of `ipfs` flavour.
## minimal
It contains Rust peer itself and some [builtin services](builtins.md). It serves as a base image for all other image flavours and is intended for those who want to run an IPFS node separately.
`FLUENCE_ENV_AQUA_IPFS_*` variables must be defined and point to externally
running IPFS daemon in order for `aqua-ipfs` to work. If not defined, **aqua-ipfs
builtin will be removed**.
| variable | default | description |
| ---------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR` | `/dns4/ipfs.fluence.dev/tcp/5001` | advertised to clients (eg frontend apps) to use in uploading files (`ipfs.put`), managing pins (`ipfs.pin`) etc |
| `FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR` | `/dns4/ipfs.fluence.dev/tcp/5001` | used by aqua-ipfs builtin to connect to IPFS node |
## ipfs
This is a Rust peer packaged with an [IPFS node](https://docs.ipfs.io/how-to/command-line-quick-start/#take-your-node-online) running inside a container.
| variable | default | description |
| ---------------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `IPFS_PATH` | `/config/ipfs` | IPFS node data directory |
| `IPFS_LOG_PATH` | `/log/ipfs` | directory where IPFS will store its logs |
| `IPFS_MIGRATE_FS` | `false` | automatically run [fs-repo-migrations](https://github.com/ipfs/fs-repo-migrations) on start |
| `IPFS_ADDRESSES_SWARM` | `/ip4/0.0.0.0/tcp/4001,/ip4/0.0.0.0/tcp/4001/ws` | IPFS swarm multiaddr |
| `IPFS_ADDRESSES_API` | `/ip4/0.0.0.0/tcp/5001` | IPFS API multiaddr |
| `IPFS_ADDRESSES_GATEWAY` | `/ip4/0.0.0.0/tcp/8080` | IPFS gateway multiaddr |
| `IPFS_ADDRESSES_ANNOUNCE` | `/ip4/127.0.0.1/tcp/4001,/ip4/127.0.0.1/tcp/4001/ws` | IPFS p2p multiaddr of the IPFS swarm protocol |
| `FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | advertised to clients (eg frontend apps) to use in uploading files (`ipfs.put`), managing pins (`ipfs.pin`) etc |
| `FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | used by aqua-ipfs builtin to connect to IPFS node |
## rich
This is a Rust peer packaged with an IPFS node, [Ceramic](https://developers.ceramic.network/learn/welcome/) CLI and some other binaries like bitcoin-cli or
[geth](https://geth.ethereum.org/docs/interface/command-line-options).
| variable | default | description |
| ---------------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `CERAMIC_HOST` | | ceramic daemon address |
| `IPFS_PATH` | `/config/ipfs` | IPFS node data directory |
| `IPFS_LOG_PATH` | `/log/ipfs` | directory where IPFS will store its logs |
| `IPFS_MIGRATE_FS` | `false` | automatically run [fs-repo-migrations](https://github.com/ipfs/fs-repo-migrations) on start |
| `IPFS_ADDRESSES_SWARM` | `/ip4/0.0.0.0/tcp/4001,/ip4/0.0.0.0/tcp/4001/ws` | IPFS swarm multiaddr |
| `IPFS_ADDRESSES_API` | `/ip4/0.0.0.0/tcp/5001` | IPFS API multiaddr |
| `IPFS_ADDRESSES_GATEWAY` | `/ip4/0.0.0.0/tcp/8080` | IPFS gateway multiaddr |
| `IPFS_ADDRESSES_ANNOUNCE` | `/ip4/127.0.0.1/tcp/4001,/ip4/127.0.0.1/tcp/4001/ws` | IPFS announce multiaddr |
| `FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | advertised to clients (eg frontend apps) to use in uploading files (`ipfs.put`), managing pins (`ipfs.pin`) etc |
| `FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR` | `/ip4/127.0.0.1/tcp/5001` | used by aqua-ipfs builtin to connect to IPFS node |

View File

@ -1,85 +0,0 @@
## ed25519, rsa, secp256k1 private keys available for this node. Generation is available only for ed25519 and secp256k1.
## Either value or path should be defined. Value is base58 bytes.
## ed25519 format is set by default
# root_key_pair.format = "ed25519"
# root_key_pair.value = "..."
# root_key_pair.path = "/.fluence/v1/secret_key.ed25519"
root_key_pair.generate_on_absence = true
# builtins_key_pair.format = "ed25519"
# builtins_key_pair.value = "..."
# builtins_key_pair.path = "/.fluence/v1/secret_key.ed25519"
builtins_key_pair.generate_on_absence = true
autodeploy_particle_ttl = "60s"
## Services will store their data here
# default is /.fluence/v1/services
# services_base_dir = "./services"
## AIR Interpreter will store its data here. NOTE: 'stepper' is an old name for interpreter.
# default is /.fluence/v1/stepper
# avm_base_dir = "./stepper"
## directory for TrustGraph certificates
# default is /.fluence/v1/certificates
# certificate_dir = "./certificates"
## directory for builtins
# default is /.fluence/v1/builtins
builtins_base_dir = "/builtins"
# default is /.fluence/spell
# spell_base_dir = "/spell"
## Path to AIR interpreter .wasm is set to specific version by default
## air_interpreter_path = "./aquamarine_${air_interpreter_wasm::VERSION}.wasm"
tcp_port = 7777
listen_ip = "0.0.0.0"
socket_timeout = "20s"
bootstrap_nodes = [
"/dns4/net01.fluence.dev/tcp/7001",
"/dns4/net01.fluence.dev/tcp/7770",
"/dns4/net02.fluence.dev/tcp/7001",
"/dns4/net03.fluence.dev/tcp/7001",
"/dns4/net04.fluence.dev/tcp/7001",
"/dns4/net05.fluence.dev/tcp/7001",
"/dns4/net06.fluence.dev/tcp/7001",
"/dns4/net07.fluence.dev/tcp/7001",
"/dns4/net08.fluence.dev/tcp/7001",
"/dns4/net09.fluence.dev/tcp/7001",
"/dns4/net10.fluence.dev/tcp/7001"
]
websocket_port = 9999
#external_address = "85.85.35.35"
prometheus_port = 18080
aquavm_pool_size = 16
## Maximum heap size in bytes available for an interpreter instance.
# default is not specified and defined by runtime (1600 pages: 65536*1600 ~ 100 Mb, Wasm page size is 64 Kb)
# aquavm_max_heap_size = "500 Mb"
## Maximum heap size in bytes available for a WASM module.
# Checks heap size required by module if specified, default is not specified.
# module_max_heap_size = "10 Mb"
## Default heap size in bytes available for a WASM module unless otherwise specified.
# default is not specified and defined by runtime
# module_default_heap_size = "5 Mb"
## How often send memory metrics to prometheus
#metrics_timer_resolution = "60s"
## environment variables that will be passed to each service
## TODO: separate by service or move to service config
services_envs = { name = "value" }
[bootstrap_config]
reconnect_delay = "5s 500ms"
bootstrap_delay = "30s 45ms"
bootstrap_max_delay = "60s"
[root_weights]
12D3KooWB9P1xmV3c7ZPpBemovbwCiRRTKd3Kq2jsVPQN4ZukDfy = 1
12D3KooWBUJifCTgaxAUrcM9JysqCcS4CS8tiYH5hExbdWCAoNwb = 20
[protocol_config]
upgrade_timeout = "10s"
keep_alive_timeout = "10s"
outbound_substream_timeout = "10s"

View File

@ -1,3 +0,0 @@
*.pyc
prometheus/data

View File

@ -1 +0,0 @@
2.7.18

View File

@ -1,57 +0,0 @@
autodeploy_particle_ttl = "60s"
builtins_base_dir = "/builtins"
aquavm_pool_size = 6
aquavm_max_heap_size = "500 Mb"
packet_split_size = 16384
[kademlia]
max_packet_size = 10040964096 # 100 Mb
query_timeout = "10s"
connection_idle_timeout = "1h"
peer_fail_threshold = 3
ban_cooldown = "60s"
[transport_config]
max_established_per_peer = 2
[root_key_pair]
format = "ed25519"
path = "/node.key"
[builtins_key_pair]
format = "ed25519"
generate_on_absence = true
[root_weights]
12D3KooWDMWjFq1QZG5szbQRbyQ1A8wyrEJSQaFXwMyqkFeLoHTt = 3
12D3KooWLH6rijQ7eTAdA2pcg31ohZCTkWZywYvwTB3sUEjrn5PU = 4
12D3KooWBUJifCTgaxAUrcM9JysqCcS4CS8tiYH5hExbdWCAoNwb = 6
12D3KooWCKCeqLPSgMnDjyFsJuWqREDtKNHx1JEBiwaMXhCLNTRb = 7
12D3KooWLuLi6jvv53LPUtmx9TeV87L7kwiwRiEDBb4BkWGcG7BQ = 4
12D3KooWQT3rhVmP4qrhCX9ki6oaPAF6w1WbSXZVe8MwG9GJcBHZ = 4
12D3KooWBSdm6TkqnEFrgBuSkpVE3dR1kr6952DsWQRNwJZjFZBv = 2
12D3KooWB9P1xmV3c7ZPpBemovbwCiRRTKd3Kq2jsVPQN4ZukDfy = 10
12D3KooWBeLmDMSUfX6wKcPGQKScRedwKhazdoVr6DGsP7zQi88u = 4
12D3KooWJbJFaZ3k5sNd8DjQgg3aERoKtBAnirEvPV8yp76kEXHB = 7
12D3KooWHKcazBBDS64k6vaYWoN4JowG2PsYWf9UkrBaYFAVG19T = 4
12D3KooWKbExFt4VnVtsoDoNkYUqqNTEu74AncC1xkXTRKpgbddj = 4
12D3KooWMhVpgfQxBLkQkJed8VFNvgN4iE6MD7xCybb1ZYWW2Gtz = 1
12D3KooWMxYgPHEmeaU56xjyYY5CxfzxfeRK7ZiqpohSQEy1XkUd = 10
12D3KooWBAvmzZ4dqAFGSHUc5EX1jfMwmzSqhuTHLdafUz96FALs = 3
12D3KooWEXNUbCXooUwHrHBbrmjsrpHXoEphPwbjQXEGyzbqKnE9 = 20
12D3KooWBNuzQgzdM8Uzi2Lbsk8VX42SwdZYQDVfn69BLJWKSCVi = 3
12D3KooWBcV7Tz5jn8zbQKtWp9nrAmojm63GKC7EJ8aJ1f9WdyAD = 4
12D3KooWFnAdKdxExJioeGiS6zZG8n98LAaWLdtHFPfdXqXrNgf6 = 3
12D3KooWMtzMU25aDx4sL2LBvxZNSSZirFm7YPkkEwRYdJg4CJiJ = 4
12D3KooWF7gjXhQ4LaKj6j7ntxsPpGk34psdQicN2KNfBi9bFKXg = 10
12D3KooWHk9BjDQBUqnavciRPhAYFvqKBe4ZiPPvde7vDaqgn5er = 5
12D3KooWG9hh8R1y2VesEnMRjmoxZBikSLgoazYEhpUWZHCDjEia = 40
12D3KooWGR7gsjvAR4XkZfbo5TUxzepr35ocL7U7oo6qZVuBrxud = 40
12D3KooWGzNvhSDsgFoHwpWHAyPf1kcTYCGeRBPfznL8J6qdyu2H = 2
12D3KooWKHRipkS48MNZANFwSLTkTzfgzHcLs8wZ1nUU9DzUPb4G = 3
12D3KooWBaeyjd7FgKXxMcqjt4wLmpGZvxjUjngduRRqfyYSiSxR = 40
12D3KooWRd6dzpnAyUhC42S7JzHAk38egyRSJadTgwPzkxCrY8Mg = 4
12D3KooWDcohxBq6W45MnSrUQsnL63caM3BVEZW7dB9tgP5ky7KL = 40
12D3KooWKnRcsTpYx9axkJ6d69LPfpPXrkVLe96skuPTAo76LLVH = 10
12D3KooWQbFexscJvgiTW3empzEP9o48uYU4EA9Z77bPc9mPQZTe = 4

View File

@ -1,13 +0,0 @@
FROM python:2-alpine as BUILD
RUN apk add gcc musl-dev libffi-dev rust cargo make openssl-dev
COPY ./requirements.txt ./requirements.txt
RUN pip install --user -r requirements.txt
FROM python:2-alpine
RUN apk --no-cache add openssh-client
COPY --from=BUILD /root/.local /root/.local
COPY . /deploy
ENV PATH=/root/.local/bin:$PATH
WORKDIR /deploy
ENTRYPOINT ["/deploy/entrypoint.sh"]
CMD ["--list"] # execute `fab --list` by default

View File

@ -1,33 +0,0 @@
# How to deploy Fluence
1. Edit deployment_config.json to your needs (explanations: TBD)
2. Install docker: `fab install_docker`
3. Edit `fluence.yml` and `fluence_bootstrap.yml` to your needs
4. Deploy fluence: `fab deploy_fluence`
5. If you need https, deploy caddy: `fab deploy_caddy`
6. If you need slack notifications about containers state, deploy watchdog: `fab deploy_watchdog`
# Fluence deployment scripts and configs
`deployment_config.json` contains list of IPs to use for deployment
`fab deploy_fluence` deploys fluence, mediated by `fluence.yml` and `fluence_bootstrap.yml`
`fab install_docker` installs docker and docker-compose (+ haveged)
`fab deploy_watchdog` deploys a watchdog to monitor containers (change `SECRET` to desired webhook URL)
`fab deploy_caddy` deploys Caddy 2.0, configured in code
# Prometheus
`/prometheus` contains basic configuration file, HTML consoles are TBD
# How to deploy Fluence with docker
1. Edit `fluence.yml` and `fluence_bootstrap.yml` to your needs
2. Build image: `docker build -t deploy .`
3. Run `docker run -v $HOME/.ssh:/root/.ssh:ro deploy deploy_fluence` (you can use `deploy_caddy` or `deploy_watchdog` instead of `deploy_fluence` as well)
# macOS without docker
If you're on macOS, and want to avoid using Docker, then this section is for you.
You will need to use `pyenv` to access Python 2.
1. `brew install pyenv openssl@1.1`
2. `pyenv install 2.7.18`
3. `pyenv local 2.7.18`
3. `pyenv exec pip2 install -r requirements.txt --global-option=build_ext --global-option="-L/opt/homebrew/opt/openssl@1.1/lib" --global-option="-I/opt/homebrew/opt/openssl@1.1/include"`
4. `pyenv exec fab deploy_fluence`

View File

@ -1,142 +0,0 @@
# Copyright 2021 Fluence Labs Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import with_statement
from fabric.contrib.files import append
from fabric.api import *
from fabric.utils import *
import json
import time
import yaml
import copy
CONFIG = {
'services': {
'fluence': {
'environment': {
'RUST_BACKTRACE': 'full',
'WASM_LOG': 'info',
'RUST_LOG': 'info,network=trace,execution=trace,tide=warn,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info ,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info',
'IPFS_ADDRESSES_ANNOUNCE': '/ip4/{host}/tcp/{ipfs_swarm_port},/ip4/{host}/tcp/{ipfs_swarm_port}/ws',
'FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR': '/ip4/{host}/tcp/{ipfs_port}',
'CERAMIC_HOST': '{ceramic_host}',
},
'command': '-c /Config.toml -f ed25519 -k {keypair} -x {host} -t {tcp_port} -w {ws_port} -m {management_key}',
'volumes': [
'{container_name}:/.fluence',
'{container_name}_config:/config',
],
'container_name': '{container_name}',
'image': '{container_image}',
'ports': [
'{tcp_port}:{tcp_port}',
'{ws_port}:{ws_port}',
'{ipfs_port}:5001',
'{ipfs_swarm_port}:4001',
'{ipfs_gateway_port}:8080',
'{metrics_port}:18080'
],
'restart': 'always'
}
},
'version': '3.5',
'volumes': {
'{container_name}': None,
'{container_name}_config': None,
}
}
def gen_compose_file(out, container_image, scale, is_bootstrap, bootstraps, host, management_key, keypairs, ceramic_host):
assert len(container_image) > 0, "container image must not be empty, was: '{}'".format(container_image)
if is_bootstrap == True:
container = 'fluence_bootstrap'
tcp_port = 7770
ws_port = 9990
ipfs_port = 5550
ipfs_swarm_port = 4440
ipfs_gateway_port = 8880
metrics_port = 28880
else:
container = 'fluence'
tcp_port = 7001
ws_port = 9001
ipfs_port = 5001
ipfs_swarm_port = 4001
ipfs_gateway_port = 8001
metrics_port = 28081
config = copy.deepcopy(CONFIG)
service = config['services']['fluence']
del config['services']['fluence']
config['volumes'] = {}
for i in range(0, scale):
container_name = container + '-{}'.format(i)
config['services'][container_name] = copy.deepcopy(service)
container_config = config['services'][container_name]
container_config['container_name'] = container_name
container_config['image'] = container_image.encode('utf-8')
container_config['volumes'] = map(
lambda v: v.format(container_name=container_name),
container_config['volumes']
)
container_config['command'] = container_config['command'].format(
keypair=keypairs[i],
management_key=management_key,
host=host,
tcp_port=tcp_port,
ws_port=ws_port
)
if len(bootstraps) > 0:
container_config['command'] += ' --bootstraps {}'.format(' '.join(bootstraps))
container_config['ports'] = map(lambda p: p.format(
tcp_port=tcp_port,
ws_port=ws_port,
ipfs_port=ipfs_port,
ipfs_swarm_port=ipfs_swarm_port,
ipfs_gateway_port=ipfs_gateway_port,
metrics_port=metrics_port
), container_config['ports'])
for key in container_config['environment']:
container_config['environment'][key] = container_config['environment'][key].format(
host=host,
ipfs_port=ipfs_port,
ipfs_swarm_port=ipfs_swarm_port,
ipfs_gateway_port=ipfs_gateway_port,
ceramic_host=ceramic_host,
)
for key in CONFIG['volumes']:
key = key.format(container_name=container_name)
config['volumes'][key] = None
tcp_port += 1
ws_port += 1
ipfs_port += 1
ipfs_swarm_port += 1
ipfs_gateway_port += 1
metrics_port += 1
puts("Writing config to {}".format(out))
with hide('running'):
run('rm {} || true'.format(out))
append(out, yaml.dump(config))

View File

@ -1,186 +0,0 @@
{
"target": "stage",
"environments": [
{
"name": "krasnodar",
"container_image": "fluencelabs/rust-peer:rich_0.0.77",
"containers_per_host": 1,
"external_bootstraps": [
"/ip4/164.90.171.139/tcp/7770"
],
"hosts": [
"164.90.171.139",
"178.128.194.190",
"46.101.159.139",
"161.35.222.178",
"164.90.164.229",
"164.90.168.55",
"161.35.212.85",
"164.90.165.150",
"164.90.172.126",
"164.90.171.156"
],
"user": "root",
"bootstrap": "164.90.171.139",
"management_key": "12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy",
"ceramic_host": "https://ceramic-krasnodar.fluence.dev",
"caddy": [
{ "host": "kras-00.fluence.dev", "ports": [9001, 9990, 5001, 5550, 8880, 8001], "addr": "164.90.171.139" },
{ "host": "kras-01.fluence.dev", "ports": [9001, 5001, 8001], "addr": "178.128.194.190" },
{ "host": "kras-02.fluence.dev", "ports": [9001, 5001, 8001], "addr": "46.101.159.139" },
{ "host": "kras-03.fluence.dev", "ports": [9001, 5001, 8001], "addr": "161.35.222.178" },
{ "host": "kras-04.fluence.dev", "ports": [9001, 5001, 8001], "addr": "164.90.164.229" },
{ "host": "kras-05.fluence.dev", "ports": [9001, 5001, 8001], "addr": "164.90.168.55" },
{ "host": "kras-06.fluence.dev", "ports": [9001, 5001, 8001], "addr": "161.35.212.85" },
{ "host": "kras-07.fluence.dev", "ports": [9001, 5001, 8001], "addr": "164.90.165.150" },
{ "host": "kras-08.fluence.dev", "ports": [9001, 5001, 8001], "addr": "164.90.172.126" },
{ "host": "kras-09.fluence.dev", "ports": [9001, 5001, 8001], "addr": "164.90.171.156" }
],
"keypairs": {
"fluence_bootstrap.yml": [
"4EMUFTvXM3D6M8NHwNCMwjkjdSUSHJrnzdHh7L3XcY9E3iUNncUohQ7EcjJaovVwzzqdTcbki5iAnUUHEb59j4pQ"
],
"fluence.yml": [
"29JvD17kkvFXnTNDRhmVehLTinFzaq8trNNADzDEpFTm8cTVJuLVxzf4AysDg9daerBRa2xhgj9QYGCKXkbbUXbd",
"2zzZEHJFsxnKSihpC2GkcQtgaUYBwW742ne5ZB2bjRGwnbgMEmn1MqoHxm5MbnMwEB4DLP2cxKYN4Ag7MGWus8PQ",
"ir4of5Kcqu4Zjkg4GwWujTKUvggqHzHPKS9vpN9G96dMGi9pKqnDRrXpgjKTogzY7i1AnrTfoD464GgjFcK8QUf",
"58kzJ5Xxvj7Mmrq2NTVTa9JRdmnpWQAsnWEUauuqbgwbqqHKZoYC498Yfa6wLJiEBQiuLGCqrBTqmktngYN32Xnz",
"aD93EK3cEFCM4aHFqR3SNs8xUvoFTdhLcm1pn2wsJ8kwxVGC4mCgRC6znxBAfp9ja83wCBsDqrBW3NysqkbG5Gk",
"47L1SWMPu3VfMQRqE7a5bgE6H7K56v9wU5SoFUrJVdDs3obVCM4afMfajBApj1q8Q4itKoD5zb9ydVefZirHLBNa",
"3pSZ7S4zQGSYvt7GDqrxYVJitUCv1YC9oVcoeziDvfwrS5u3knKkFXEQ164ZBZCaTGaKZk9RR3awvhW34gtYDhMN",
"G1LbuJiYq3PHWPzfBkp8j22Wr6Lb8xvyW6vcuLBWLwupz2sy2Ku2SRTw5x28zk91uS8X3AaLEupuHC8Z31FC72W",
"2Y78rG3QrrGzzvVJhvbEdvnya11Z2a3qR3bjP5Yr5PF46BomTF4MXRJb4qiUQFBZfqUuzYBDs7SP1odfixAr3U7Y",
"2RLVwr5F2yxU6ZLEkdCA7GP2X3DTBCJsZ3PmNtjg8Bbbj9VPcfE928cEci1AoqbstNbT28cNm5ji8d6cLknRxJNb",
"2SBto5Nx8gY1TYJCmnhBQMDzkTghAFbQZFu1eLN9piWUz8vdySBQYeXQXrYXb2Yoh1wzQmST5uReRNYWVTHQEdzf",
"36mqbXaCw4p8cJJCNMUPF9Eoj5stbL5BL8digfkrtudR4AFcAS8p2Ja1FHGVVqtqaGWY9haQQwPmw8RT4Gkfdd5T",
"2JQXbwU8FHbTimtwz75SyYP25MZ8RmKKPYE3aXf2eCrpjUfkoZ85aXQkxJPjZiJe5JbES5N6LZLvevtAPZLznSTa",
"2tFtYR2S8kboncrv4xLkTxHuAVXN8KRxFwC2xPGYiHsXLLvYUHYsFQKHgMwn17tG4ZzMXTwYZcDC5BPTDRKiJP1f",
"3vXDEMu7ya5dRQRzpAvazvL5GbmXF6T8nXeESNUxUMax6qHgdfVDywA3zddrZmgAwfcHaxz7sPYtyjaPU9Z7jCj5",
"4ZUye9KKXhCSNs1Cdu2L2kioBUrhNKfYtFLUbujC7QbnweYS3VEWvNbi2Lq5VaEd6iHKMEfz8tzWPoaKut8JpmoS",
"5VxTSWtAwzfqv9cXMZJTFU7BqEv85d59KN1mkreJXeUAVFMnfmW8fwtDV8njnAJErSUokmYTgpYXEkbmcL3nm5WX",
"3Bvaa3HbwBazLxKsHUQkw6swqxV5msqcKBtANDLzqQysDn5XRkp1HBHViKiy7b71zD93oQKHgmQao4jzYBffrVMT",
"4UDVbiMtz6RjfBM1oM6kX781D8qRaZh6d8H51YdLWvQZVPjeMug6pqYooBMg4sjVXnoFkcZ2AHyTkQLn6ZVuWPGP",
"5Cnpvd3VH3SRk2qLjnL7CjD8hyMVNY9StnqebZ4sNndyxMfa5PKeFo34S1EVXwUdWdUeog9q59bTPaWyx51RweQf",
"2JxUxVCYVhFzw8J1jz83Sb73XpBiHoNXuxwR73JGnJa7xWxSKbkNmSKZXZ4r2whR8Qc44F8oq1F1SdnF75tZEepE"
]
}
},
{
"name": "testnet",
"container_image": "fluencelabs/rust-peer:rich_0.0.77",
"containers_per_host": 1,
"external_bootstraps": [
"/ip4/165.227.164.206/tcp/7770"
],
"hosts": [
"165.227.164.206",
"138.197.189.50",
"157.230.23.49",
"159.65.126.102",
"142.93.169.49",
"139.59.148.53",
"206.81.30.129",
"157.230.98.51",
"159.89.2.70",
"157.230.98.75"
],
"user": "root",
"bootstrap": "165.227.164.206",
"management_key": "12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy",
"ceramic_host": "https://ceramic-testnet.fluence.dev",
"caddy": [
{ "host": "net01.fluence.dev", "ports": [9001, 9990, 5550, 5001, 8880, 8001], "addr":"165.227.164.206" },
{ "host": "net02.fluence.dev", "ports": [9001, 5001, 8001], "addr":"138.197.189.50" },
{ "host": "net03.fluence.dev", "ports": [9001, 5001, 8001], "addr":"157.230.23.49" },
{ "host": "net04.fluence.dev", "ports": [9001, 5001, 8001], "addr":"159.65.126.102" },
{ "host": "net05.fluence.dev", "ports": [9001, 5001, 8001], "addr":"142.93.169.49" },
{ "host": "net06.fluence.dev", "ports": [9001, 5001, 8001], "addr":"139.59.148.53" },
{ "host": "net07.fluence.dev", "ports": [9001, 5001, 8001], "addr":"206.81.30.129" },
{ "host": "net08.fluence.dev", "ports": [9001, 5001, 8001], "addr":"157.230.98.51" },
{ "host": "net09.fluence.dev", "ports": [9001, 5001, 8001], "addr":"159.89.2.70" },
{ "host": "net10.fluence.dev", "ports": [9001, 5001, 8001], "addr":"157.230.98.75" }
],
"keypairs": {
"fluence_bootstrap.yml": [
"wCUPkGaBypwbeuUnmgVyN37j9iavRoqzAkddDUzx3Yir7q1yuTp3H8cdUZERYxeQ8PEiMYcDuiy1DDkfueNh1Y6"
],
"fluence.yml": [
"4pJqYfv3wXUpodE6Bi4wE8bJkpHuFbGcXrdFnT9L29j782ge7jdov7FPrbwnvwjUm4UhK5BvJvAYikCcmvCPVx9s",
"2zgzUew3bMSgWcZ34FFS36LiJVkn3YphW2H8TDvL8JF8T4apTDxnm7GRsLppkCNGS5ytAQioxEktYq8Wr8SWAHLv",
"52WaZJDHFFZbwL177g497ctE7zqbMYMwWpVMewjc1U63tWjFUCNPuzB472UkdZWBykjiNWA8qtLYNAQEqQCcWfoP",
"23BFr8LKiiAtULuYJTmLGxqDVHnjFCzNFTZcKq6g82H9kcTNwGq8Axkdow4fh4u4w763jF6uYVK6FuGESAQBMEPB",
"3wR6FT1ZGnEwPqYBNz5YVpA6qJ4uUTLcK1SpWrwJennH5Bk4JgCjKKjUiRcjDk3Cwjbm2LAdrLWTYXHjxbogttQ9",
"3KoMfcGUox46Brcnojs8yuNZN2YTH7kvmxW8g5PiRrDE2dCiQeZzhDkaJvmDDnUaHFRp6UvdmBsDrYWywYoNDqHD",
"5yqQfXyjMGKZaykByyrEjCYqxjHaCxQKxLQ3vfzU4M8U51auCiCeKT5UvnZGgMFbwwrjePUMYPvThyXiimGvq16x",
"g59HxPYa1gxDZbMEtt2sry9tncQ1XwJMqoYh47JVsXnXeTf7svtzdag2pbXr6uN35L43nmKN2W4XW9MX7g5AUPB",
"6mFRjb32PY4eMimBJq6sS6L2yW69ShHk46KTycP6v4unfBF7JYQc2Z8m8i4RPr6snWeH7Mq4ae7wCQLqV2xuCrv",
"5EwruNmAyo9MjXSkUzKJLeUnNaxjjbHovTcfkUozzAcE9NgcoYnBs5bsoNnQpmZssk6KEYcM4dTa8nioYKtMHrKd",
"4iUyBDs1w51QzMtT7j4ydeCGnXw7HYzGANHFVVYVio5H9TKmefQodzW3Y8ir9tAbq31mwBbEW79XhUzCGvi16xyj",
"3hL8p1YoBJ4aY8gpxSzq7JTbobLd4iY2RXgLn9oXPJBVPgihfZU4RYxEYRCM2ccEYbQrpHSKqJF6SHoR1khXoNTp",
"CaexYkVKpcniuywCvx3xb3TBEaCsoEh7jLwoW8SBn68RapqsV6gNaETmyi7jTTvsy6k2tjkq4zd9LU2UkD9LSGc",
"3UNUeYDfxzUEkNvzV5Y3ysUQzZSb5bvpBVJKRqtkpavsigL9oxnnFsbPQsbAXYorZdT8NWx8TuGj2mVVWPJhCeNg",
"3UgMLGKzxoc33G3uqjFNRcESRnZvxVUBXuMd9cXdAUBjUp2DqEzqTWmA6skg4i8YsfkYy4nHqiDbU7oMUzi1RZ2j",
"4GjM64v9dZRu5weHMJuvi9JTa9xnD2yQyehyVDz2LMmukvNuRW4niPanxxFT3i9L8arZjn967fCAQoAug1qcpeJY",
"3ZtwTXfgUQ4SspkgjGH5F28feyrXB69e1m3o1MJzTv5SSZWpaT3X1FhRjKmfohDKgiXA6ddKZiqSFfHjewTLMnaJ",
"4nzpwEHwfQZXgxJjsSSvz8TiY7A88rYm2JHGz8BF5U8AzgKXNBECF6d8B2ZByrdL1TWXaKuXjNpNp8kAzCXm1JnM",
"4yBQSVmxZ9Ft9up8gv9A4G3BfvAT52rGvHLjteDuL18KvwbZE3vB1u84VxVMjEzAJSB1YuvNoqB8aoRireV7zcLn",
"w1LS56wM6aW1YSCb22buCm2hVnFdWRjLdacahL2a1iM2vu4DNc8tR68yRi31dVtVbR6ZSsmKU2zzYKeEuDNoFNw",
"55ssYzrcKRc68xMgXA8KC3QjuBNffxzAtUtvWvRSo4vdDBuoZTe8KCwHJR7vEUhKErWqWFmjMQtH9GCBKhdokxeJ"
]
}
},
{
"name": "stage",
"container_image": "docker.fluence.dev/rust-peer:rich_debug-refactored-marine_901_1",
"containers_per_host": 5,
"hosts": [
"134.209.186.43"
],
"user": "root",
"bootstrap": "134.209.186.43",
"external_bootstraps": [
"/ip4/134.209.186.43/tcp/7770"
],
"management_key": "12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy",
"ceramic_host": "https://ceramic-stage.fluence.dev",
"caddy": [
{
"host": "stage.fluence.dev",
"ports": [
9990, 9001, 9002, 9003, 9004, 9005,
5550, 5001, 5002, 5003, 5004, 5005,
8880, 8001, 8002, 8003, 8004, 8005
],
"addr": "134.209.186.43"
}
],
"keypairs": {
"fluence_bootstrap.yml": [
"1eye6JeqbLhXM4gF6C1n9UKMvHdp8niwH9XXh2159eJcYG3Zk4nCNSrG5qfwvkrFka3L6xVssJ2fpHTvpPPhz5p"
],
"fluence.yml": [
"3suwMJBLUSYb2LHdAdCzstEUbMzxmKj144GUJKMGp4syRF45pW249F1je2BBxwAF3pZyFSdzn88sfQNpWByHVKDC",
"e8AFF1TqoF9QTcMG12968KRn1MHemLgzTTW18ef9ji7cRYKc8GdkVcecCvDUj1GyMVvNQHU7dozE94tKz8aj6DS",
"4BMesaouUWJo6ps12sSntZMLJ2EpNivehx1o89NbnxyDbMD5JmUpeeiXSmW4ZL2cYjyJWxSKwwQGaKbHK3oqcuJo",
"4NsvdS4S3SHrh1FYNFc4881t2Pxf6WriREhbLp6vuVoXeXSi8AAHb81rPr9ju21ZYvJ8dyhYS9AHn41jgddCUiPG",
"3iX1GxpUHGJsX4srDAx4KrJSYmb3xgYqm4ZuYN6snuS9upYPF9sqEYAdPXd8cSPNTmN9QKmKnZGn7URzKUr9f9Q2",
"wBTuv6muKu1BrBrnAtwEGZykHJxnMcxYT8RxdcMwGnDNpPNktS4FoFG36tKoVfofMXHepXuW67PoB9A6T5p7tXu",
"5j7RxESUMQSGPFfegAH7MuWi1oddp7qMeA52iWMvrYdEmcoDYzKrU5vbj2vesu7AjqvsLoPhUdJssqAFs8uWAkEJ",
"4ttKiUoQ9XuSJPeRdtj6QuPBqRJZZD5XhcRM9XG8tLGRwESkPcWbjNArWnPW92kijcvYFQevhok8hrGx8DsaU7Jw",
"2kvaPrtJYHTvq52hCTNCqBo4GxbdBk62QpREQmK6QVZPUxJTo9jcJNDXDLERzgaFJV6izhTxB6ieczMpAg8uW1kb",
"3uAKK4VtrTRiEWZX6JRbGajtz59FcJpe4mMztFUYSkepegqeLKejBVgrsTPxsPpq1ueuEKsTy3jchyebzXqbPRJW",
"3FprLUcTG8HaYVqGgsoDj7GuxujJCHa3Ucu8WyqubmrspQ9ND327JT4phfmxy1nB1C93Qvw5U6qtWZ5PNxwGvZaj",
"4VeFHU452ba1cTh1WnThRQt19wHmCPnto4r3TufQWr2DJzxAbTnQJE3HpEbhc4LE4Yj7biFyuNahZznM4DnvVHQj",
"WgQqFRTGCgZS7YMhWrffdfa8sBSJbzp6gKXKPTPstUSxQGsSNJogwLGeBbk9wyRaqJMVGw3gd5MTELd5X7R96mZ",
"3fugBhX8C9LJzgRiKkSuy4vbhVjtoEQvJgjQZKFLGEAfwYo4cWGAnKwqN8QeSvLdqkPbJrbgjSAZ6pEVbEnEfuSq",
"4QSt7vayxy3ZFGkZaomvtBW7Q5zpyFXHGJk91rjvwQBH1Dj9wamvAkTSwh1V26uopGwwU7ZBY26GWvm2A3kMk3hy",
"49jZ96qanxWryTDvSXkKNzTcKW5yfKWzPnG2h4JrLzjBo5zKKL9dYUcJDyPE68kz8XjUnfPbq5CTX4uN8TDLWbac",
"2yKn9UpGS8cSWEqYKtrbCbA1Sy1fbcPwHaNsUtY6YKGZ6udDibQbbmgn2BkYXWro2D3TZs1rbuE6VzdW6msMQc7v",
"5ZHShramB9ST4M2u6rmEdoJcX6BQr9Y889sZZpjCWzBSyWaEqvxxr2uUdxNBWn7m7cHnH9rtuvvxaRJPLnB5RLX9",
"gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj"
]
}
}
]
}

View File

@ -1,122 +0,0 @@
# Copyright 2020 Fluence Labs Limited
#
# Licensed under the Apache 'License', Version 2.0 (the "'License'");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in 'writing', 'software'
# distributed under the License is distributed on an "AS IS" ''BASIS'',
# WITHOUT WARRANTIES OR CONDITIONS OF ANY 'KIND', either express or 'implied'.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import with_statement
from fabric.api import *
from utils import *
from docker import *
import json
@task
@runs_once
def install_docker():
load_config()
execute(do_install_docker)
@task
@parallel
def do_install_docker():
puts("TODO: WRITE LOGGING DRIVER SETUP TO daemon.json https://docs.docker.com/config/containers/logging/json-file/")
with hide('running'):
sudo("apt-get remove --yes docker docker-engine docker.io containerd runc || true")
sudo("apt-get update")
puts("preparing to install docker")
sudo("apt-get install --yes haveged apt-transport-https ca-certificates curl gnupg-agent software-properties-common")
sudo("curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -")
sudo("apt-key fingerprint 0EBFCD88")
sudo("""add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" """)
sudo("apt-get update")
puts("installing docker")
sudo("apt-get install --yes docker-ce docker-ce-cli containerd.io")
puts("installing docker-compose")
sudo("""curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose """)
sudo("chmod +x /usr/local/bin/docker-compose")
@task
@runs_once
def deploy_watchdog():
load_config()
execute(do_deploy_watchdog)
@task
@parallel
def do_deploy_watchdog():
# 'running', 'output'
with hide('running', 'output'):
run("docker rm -f docker_watchdog || true")
run(
"docker run --name docker_watchdog --detach --restart=unless-stopped " +
"-e HOST={} ".format(env.host_string) +
"-e SLACK_CHANNEL='#endurance' " +
"-e SLACK_URL=SECRET " +
"-v /var/run/docker.sock:/var/run/docker.sock " +
"leonardofalk/docker-watchdog"
)
@task
@parallel
def deploy_caddy():
load_config()
target = target_environment()
for node in target['caddy']:
env.hosts = [node['addr']]
puts("node: {}".format(node))
execute(do_deploy_caddy, node['ports'], node['host'])
@task
def do_deploy_caddy(ports, host):
ip = env.host_string
fname = 'Caddyfile'
prefix = '1'
container = 'caddy'
run('rm {} || true'.format(fname))
def append(line):
run('echo "{}" >> {}'.format(line, fname))
# Generated config will be as follows:
#
# {
# email alexey@fluence.one
# }
#
# host:prefixport { # add 'prefix', e.g.: 9001 => 19001
# log {
# format console
# }
# reverse_proxy ip:port
# }
append('''
{
email alexey@fluence.one
}
''')
for port in ports:
append('''
wss://{}:{}{} {{
log {{
format console
}}
reverse_proxy wss://{}:{}
}}'''.format(host, prefix, port, ip, port))
# -p prefixport:prefixport
open_ports = " ".join("-p {}{}:{}{}".format(prefix, p, prefix, p) for p in ports)
run('docker rm -f {} || true'.format(container))
run('docker pull caddy:latest')
run('docker run --name {} -d -p 80:80 {} -v $PWD/Caddyfile:/etc/caddy/Caddyfile -v caddy_data:/data caddy:latest'.format(container, open_ports))

View File

@ -1,12 +0,0 @@
#! /usr/bin/env sh
if ! [[ -d /root/.ssh ]]; then
echo "Private key at '/root/.ssh' is missing or not readable"
echo "Did you forget to mount .ssh directory with '-v $HOME/.ssh:/root/.ssh:ro'?"
exit 1
fi
eval $(ssh-agent) > /dev/null
ssh-add
exec fab $@

View File

@ -1,23 +0,0 @@
# Copyright 2018 Fluence Labs Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.files import append
from utils import *
from docker import *
from fluence import *

View File

@ -1,189 +0,0 @@
from __future__ import with_statement
from collections import namedtuple
from fabric.api import *
from fabric.contrib.files import append
from utils import *
from compose import *
from collections import namedtuple
from time import sleep
# DTOs
Node = namedtuple("Node", "peer_id tcp ws")
Service = namedtuple("Service", "port multiaddr")
FLUENCE_NODE_PORT = "7777"
FLUENCE_CLIENT_PORT = "9999"
PEER_ID_MARKER = "server peer id"
@task
@runs_once
def deploy_fluence():
# 'running', 'output'
with hide():
load_config()
target = target_environment()
env.hosts = target["bootstrap"]
puts("Fluence: deploying bootstrap")
results = execute(deploy_bootstrap)
bootstraps = fill_addresses(results.items())
bootstrap = bootstraps[0]
env.bootstraps = map(lambda b: b.tcp.multiaddr, bootstraps)
env.hosts = target["hosts"]
puts("Fluence: deploying rest of the nodes")
results = execute(deploy_nodes)
nodes = fill_addresses(results.items())
puts("Fluence: deployed.\nAddresses:\n%s" % "\n".join(
"{} {} {}".format(n.tcp.multiaddr, n.ws.multiaddr, n.peer_id) for n in nodes))
puts("Bootstrap:\n%s" % "\n".join(
"{} {} {}".format(n.tcp.multiaddr, n.ws.multiaddr, n.peer_id) for n in bootstraps))
@task
@parallel
def deploy_bootstrap():
target = target_environment()
yml = "fluence_bootstrap.yml"
keypair = get_keypairs(yml, get_host_idx(containers=1), count=1)
gen_compose_file(
out=yml,
container_image=target['container_image'],
scale=1,
is_bootstrap=True,
bootstraps=target['external_bootstraps'],
host=env.host_string,
management_key=target['management_key'],
keypairs=keypair,
ceramic_host=target['ceramic_host'],
)
return do_deploy_fluence(yml)
@task
@parallel
def deploy_nodes():
target = target_environment()
yml = "fluence.yml"
scale = target["containers_per_host"]
keypairs = get_keypairs(yml, get_host_idx(scale), count=scale)
gen_compose_file(
out=yml,
container_image=target['container_image'],
scale=scale,
is_bootstrap=False,
bootstraps=env.bootstraps + target['external_bootstraps'],
host=env.host_string,
management_key=target['management_key'],
keypairs=keypairs,
ceramic_host=target['ceramic_host'],
)
return do_deploy_fluence(yml)
@task
@parallel
# returns {ip: Node}
def do_deploy_fluence(yml="fluence.yml"):
with hide():
compose("pull -q", yml)
compose('rm -fs', yml)
compose('up --no-start', yml) # was: 'create'
copy_configs(yml)
compose("restart", yml)
sleep(5)
addrs = get_fluence_addresses(yml)
return addrs
def get_host_idx(containers):
return env.hosts.index(env.host_string) * containers
def copy_configs(yml):
# there's no `cp` in `docker-compose`: https://github.com/docker/compose/issues/5523
put("Config.toml", "./")
containers = compose('ps -q', yml).splitlines()
for id in containers:
run('docker cp ./Config.toml %s:/Config.toml' % id)
# returns [Node]
def get_fluence_addresses(yml="fluence.yml"):
containers = compose('ps -q', yml).splitlines()
nodes = []
for id in containers:
(tcp_port, ws_port) = get_ports(id)
peer_id = get_fluence_peer_ids(id)
node = Node(peer_id=peer_id, tcp=Service(tcp_port, None), ws=Service(ws_port, None))
nodes.append(node)
return nodes
# Assuming Fluence's tcp port starts with 7
# and websocket port starts with 9
def is_fluence_port(host_port):
is_tcp = '0.0.0.0:7' in host_port
is_ws = '0.0.0.0:9' in host_port
return is_tcp or is_ws
# returns (tcp port, ws port)
def get_ports(container):
from itertools import chain
lines = run('docker port %s' % container).splitlines()
ports = chain.from_iterable(l.split('/tcp -> ') for l in lines)
# filter by host port and remove 0.0.0.0 part
ports = list(port.replace('0.0.0.0:', '') for port in ports if is_fluence_port(port))
(a, b) = ports
# tcp port starts with 7
if a.startswith('7'):
return (a, b)
else:
return (b, a)
def get_fluence_peer_ids(container, yml="fluence.yml"):
logs = run('docker logs --tail 10000 %s' % container).splitlines()
return parse_peer_ids(logs)
# returns (node_peer_id, peer_peer_id)
def parse_peer_ids(logs):
def after_eq(line):
return line.split("=")[-1].strip()
peer_id = None
for line in logs:
if PEER_ID_MARKER in line:
peer_id = after_eq(line)
return peer_id
def compose(cmd, yml="fluence.yml"):
return run('docker-compose -f %s %s' % (yml, cmd))
def service(yml):
return yml.replace(".yml", "")
# takes: dict {ip: Node}
# returns: [Node]
def fill_addresses(nodes_dict):
result = []
for ip, nodes in nodes_dict:
for node in nodes:
# node service multiaddr
node = node._replace(tcp=fill_multiaddr(ip, node.tcp))
# peer service multiaddr
node = node._replace(ws=fill_multiaddr(ip, node.ws, suffix="/ws"))
result.append(node)
return result
def fill_multiaddr(ip, service, suffix=""):
return service._replace(multiaddr="/ip4/{}/tcp/{}{}".format(ip, service.port, suffix))

View File

@ -1,3 +0,0 @@
console_libraries/
consoles/

View File

@ -1,8 +0,0 @@
# Prometheus and Grafana setup
```bash
git clone https://github.com/fluencelabs/node-distro
git checkout prometheus # TODO: remove this line after merge
cd fluence/deploy/prometheus
export PROMETHEUS_HOST=134.209.186.43
docker-compose up -d
```

View File

@ -1,36 +0,0 @@
version: '3.2'
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- 9090:9090
command:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus:/prometheus
networks:
- prometheus
grafana:
image: grafana/grafana:latest
container_name: grafana
environment:
- PROMETHEUS_HOST=${PROMETHEUS_HOST:?You must set PROMETHEUS_HOST env variable to the public URL of the Prometheus host}
ports:
- 3000:3000
volumes:
- ./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
- ./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml
- ./grafana/docker_monitoring_dashboard.json:/etc/grafana/provisioning/dashboards/docker_monitoring_dashboard.json
- ./grafana/docker_cadvisor.json:/etc/grafana/provisioning/dashboards/docker_cadvisor.json
- ./grafana/cadvisor_exporter.json:/etc/grafana/provisioning/dashboards/cadvisor_exporter.json
networks:
- prometheus
networks:
prometheus:
volumes:
prometheus:

View File

@ -1,777 +0,0 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "8.3.4"
},
{
"type": "panel",
"id": "graph",
"name": "Graph (old)",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "Simple exporter for cadvisor only",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": 14282,
"graphTooltip": 0,
"id": null,
"iteration": 1656573403436,
"links": [],
"liveNow": false,
"panels": [
{
"collapsed": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 8,
"panels": [],
"title": "CPU",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 1
},
"hiddenSeries": false,
"id": 15,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.3.4",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(container_cpu_usage_seconds_total{instance=~\"$host\",name=~\"$container\",name=~\".+\"}[5m])) by (name) *100",
"hide": false,
"interval": "",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"thresholds": [],
"timeRegions": [],
"title": "CPU Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:606",
"format": "percent",
"logBase": 1,
"show": true
},
{
"$$hashKey": "object:607",
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
},
{
"collapsed": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 8
},
"id": 11,
"panels": [],
"title": "Memory",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 9
},
"hiddenSeries": false,
"id": 9,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.3.4",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"expr": "sum(container_memory_rss{instance=~\"$host\",name=~\"$container\",name=~\".+\"}) by (name)",
"hide": false,
"interval": "",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Memory Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:606",
"format": "bytes",
"logBase": 1,
"show": true
},
{
"$$hashKey": "object:607",
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 9
},
"hiddenSeries": false,
"id": 14,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.3.4",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"expr": "sum(container_memory_cache{instance=~\"$host\",name=~\"$container\",name=~\".+\"}) by (name)",
"hide": false,
"interval": "",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Memory Cached",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:606",
"format": "bytes",
"logBase": 1,
"show": true
},
{
"$$hashKey": "object:607",
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
},
{
"collapsed": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 17
},
"id": 2,
"panels": [],
"title": "Network",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 18
},
"hiddenSeries": false,
"id": 4,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"hideEmpty": false,
"hideZero": false,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.3.4",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(container_network_receive_bytes_total{instance=~\"$host\",name=~\"$container\",name=~\".+\"}[5m])) by (name)",
"hide": false,
"interval": "",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Received Network Traffic",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:674",
"format": "Bps",
"logBase": 1,
"show": true
},
{
"$$hashKey": "object:675",
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 18
},
"hiddenSeries": false,
"id": 6,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": true,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.3.4",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(container_network_transmit_bytes_total{instance=~\"$host\",name=~\"$container\",name=~\".+\"}[5m])) by (name)",
"interval": "",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Sent Network Traffic",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:832",
"format": "Bps",
"logBase": 1,
"show": true
},
{
"$$hashKey": "object:833",
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
},
{
"collapsed": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 26
},
"id": 19,
"panels": [],
"title": "Misc",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"custom": {
"align": "auto",
"displayMode": "auto",
"filterable": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "id"
},
"properties": [
{
"id": "custom.width",
"value": 260
}
]
},
{
"matcher": {
"id": "byName",
"options": "Running"
},
"properties": [
{
"id": "unit",
"value": "d"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.displayMode",
"value": "color-text"
},
{
"id": "color",
"value": {
"fixedColor": "dark-green",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 27
},
"id": 17,
"options": {
"footer": {
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": []
},
"pluginVersion": "8.3.4",
"targets": [
{
"expr": "(time() - container_start_time_seconds{instance=~\"$host\",name=~\"$container\",name=~\".+\"})/86400",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Containers Info",
"transformations": [
{
"id": "filterFieldsByName",
"options": {
"include": {
"names": [
"container_label_com_docker_compose_project",
"container_label_com_docker_compose_project_working_dir",
"image",
"instance",
"name",
"Value",
"container_label_com_docker_compose_service"
]
}
}
},
{
"id": "organize",
"options": {
"excludeByName": {},
"indexByName": {},
"renameByName": {
"Value": "Running",
"container_label_com_docker_compose_project": "Label",
"container_label_com_docker_compose_project_working_dir": "Working dir",
"container_label_com_docker_compose_service": "Service",
"image": "Registry Image",
"instance": "Instance",
"name": "Name"
}
}
}
],
"type": "table"
}
],
"schemaVersion": 34,
"style": "dark",
"tags": [
"cadvisor",
"docker"
],
"templating": {
"list": [
{
"allValue": ".*",
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values({__name__=~\"container.*\"},instance)",
"hide": 0,
"includeAll": true,
"label": "Host",
"multi": false,
"name": "host",
"options": [],
"query": {
"query": "label_values({__name__=~\"container.*\"},instance)",
"refId": "Prometheus-host-Variable-Query"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": ".*",
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values({__name__=~\"container.*\", instance=~\"$host\"},name)",
"hide": 0,
"includeAll": true,
"label": "Container",
"multi": false,
"name": "container",
"options": [],
"query": {
"query": "label_values({__name__=~\"container.*\", instance=~\"$host\"},name)",
"refId": "Prometheus-container-Variable-Query"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Cadvisor exporter",
"uid": "pMEd7m0Mz",
"version": 1,
"weekStart": ""
}

View File

@ -1,11 +0,0 @@
apiVersion: 1
providers:
- name: 'Prometheus'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /etc/grafana/provisioning/dashboards

View File

@ -1,24 +0,0 @@
# config file version
apiVersion: 1
# list of datasources that should be deleted from the database
deleteDatasources:
- name: Graphite
orgId: 1
# list of datasources to insert/update depending
# what's available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Prometheus
# <string, required> datasource type. Required
type: prometheus
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: proxy
# <string> custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically
uid: prometheus_grafana_fluence
# <string> url
url: http://$PROMETHEUS_HOST:9090
version: 1
# <bool> allow users to edit datasources from the UI.
editable: true

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,57 +0,0 @@
scrape_configs:
- job_name: "docker"
static_configs:
- { targets: [ "165.227.164.206:16000" ], labels: { hostname: "net-01", env: "testnet" } }
- { targets: [ "138.197.189.50:16000" ], labels: { hostname: "net-02", env: "testnet" } }
- { targets: [ "157.230.23.49:16000" ], labels: { hostname: "net-03", env: "testnet" } }
- { targets: [ "159.65.126.102:16000" ], labels: { hostname: "net-04", env: "testnet" } }
- { targets: [ "142.93.169.49:16000" ], labels: { hostname: "net-05", env: "testnet" } }
- { targets: [ "139.59.148.53:16000" ], labels: { hostname: "net-06", env: "testnet" } }
- { targets: [ "206.81.30.129:16000" ], labels: { hostname: "net-07", env: "testnet" } }
- { targets: [ "157.230.98.51:16000" ], labels: { hostname: "net-08", env: "testnet" } }
- { targets: [ "159.89.2.70:16000" ], labels: { hostname: "net-09", env: "testnet" } }
- { targets: [ "157.230.98.75:16000" ], labels: { hostname: "net-10", env: "testnet" } }
- { targets: [ "164.90.171.139:16000" ], labels: { hostname: "krasnodar-00", env: "krasnodar" } }
- { targets: [ "178.128.194.190:16000" ], labels: { hostname: "krasnodar-01", env: "krasnodar" } }
- { targets: [ "46.101.159.139:16000" ], labels: { hostname: "krasnodar-02", env: "krasnodar" } }
- { targets: [ "161.35.222.178:16000" ], labels: { hostname: "krasnodar-03", env: "krasnodar" } }
- { targets: [ "164.90.164.229:16000" ], labels: { hostname: "krasnodar-04", env: "krasnodar" } }
- { targets: [ "164.90.168.55:16000" ], labels: { hostname: "krasnodar-05", env: "krasnodar" } }
- { targets: [ "161.35.212.85:16000" ], labels: { hostname: "krasnodar-06", env: "krasnodar" } }
- { targets: [ "164.90.165.150:16000" ], labels: { hostname: "krasnodar-07", env: "krasnodar" } }
- { targets: [ "164.90.172.126:16000" ], labels: { hostname: "krasnodar-08", env: "krasnodar" } }
- { targets: [ "164.90.171.156:16000" ], labels: { hostname: "krasnodar-09", env: "krasnodar" } }
- job_name: "fluence"
static_configs:
- { targets: [ "165.227.164.206:28880" ], labels: { hostname: "net-01-bootstrap", env: "testnet" } }
- { targets: [ "165.227.164.206:28081" ], labels: { hostname: "net-01", env: "testnet" } }
- { targets: [ "138.197.189.50:28081" ], labels: { hostname: "net-02", env: "testnet" } }
- { targets: [ "157.230.23.49:28081" ], labels: { hostname: "net-03", env: "testnet" } }
- { targets: [ "159.65.126.102:28081" ], labels: { hostname: "net-04", env: "testnet" } }
- { targets: [ "142.93.169.49:28081" ], labels: { hostname: "net-05", env: "testnet" } }
- { targets: [ "139.59.148.53:28081" ], labels: { hostname: "net-06", env: "testnet" } }
- { targets: [ "206.81.30.129:28081" ], labels: { hostname: "net-07", env: "testnet" } }
- { targets: [ "157.230.98.51:28081" ], labels: { hostname: "net-08", env: "testnet" } }
- { targets: [ "159.89.2.70:28081" ], labels: { hostname: "net-09", env: "testnet" } }
- { targets: [ "157.230.98.75:28081" ], labels: { hostname: "net-10", env: "testnet" } }
- { targets: [ "134.209.186.43:28880" ], labels: { hostname: "stage-01-bootstrap", env: "stage" } }
- { targets: [ "134.209.186.43:28081" ], labels: { hostname: "stage-01", env: "stage" } }
- { targets: [ "134.209.186.43:28082" ], labels: { hostname: "stage-02", env: "stage" } }
- { targets: [ "134.209.186.43:28083" ], labels: { hostname: "stage-03", env: "stage" } }
- { targets: [ "134.209.186.43:28084" ], labels: { hostname: "stage-04", env: "stage" } }
- { targets: [ "134.209.186.43:28085" ], labels: { hostname: "stage-05", env: "stage" } }
- { targets: [ "164.90.171.139:28880" ], labels: { hostname: "krasnodar-00", env: "krasnodar" } }
- { targets: [ "164.90.171.139:28081" ], labels: { hostname: "krasnodar-00", env: "krasnodar" } }
- { targets: [ "178.128.194.190:28081" ], labels: { hostname: "krasnodar-01", env: "krasnodar" } }
- { targets: [ "46.101.159.139:28081" ], labels: { hostname: "krasnodar-02", env: "krasnodar" } }
- { targets: [ "161.35.222.178:28081" ], labels: { hostname: "krasnodar-03", env: "krasnodar" } }
- { targets: [ "164.90.164.229:28081" ], labels: { hostname: "krasnodar-04", env: "krasnodar" } }
- { targets: [ "164.90.168.55:28081" ], labels: { hostname: "krasnodar-05", env: "krasnodar" } }
- { targets: [ "161.35.212.85:28081" ], labels: { hostname: "krasnodar-06", env: "krasnodar" } }
- { targets: [ "164.90.165.150:28081" ], labels: { hostname: "krasnodar-07", env: "krasnodar" } }
- { targets: [ "164.90.172.126:28081" ], labels: { hostname: "krasnodar-08", env: "krasnodar" } }
- { targets: [ "164.90.171.156:28081" ], labels: { hostname: "krasnodar-09", env: "krasnodar" } }

View File

@ -1,20 +0,0 @@
# On Alpine, you'd need to install the following before doing pip install
# apk add gcc musl-dev libffi-dev rust cargo make openssl-dev
# on macos, you need to specify path to openssl
#
# export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
# export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
# export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"
bcrypt==3.1.7
cffi==1.14.5
cryptography==2.2.2
enum34==1.1.10
Fabric==1.14.1
ipaddress==1.0.23
paramiko==2.4.2
pycparser==2.20
PyNaCl==1.4.0
six==1.15.0
pyyaml==5.4.1

View File

@ -1,108 +0,0 @@
# Copyright 2018 Fluence Labs Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import with_statement
from fabric.api import *
from fabric.utils import *
import json
import time
def ensure_docker_group(user):
from fabric.api import run
run("groupadd docker &>/dev/null || true")
run("usermod -aG docker %s || true" % user)
def chown_docker_sock(user):
from fabric.api import run
run("chmod a+r /var/run/docker.sock")
run("chown %s:docker /var/run/docker.sock" % user)
def get_docker_pgid():
from fabric.api import run
output = run("grep docker /etc/group | cut -d ':' -f 3")
output = output.stdout.splitlines()
assert len(output) == 1
return output[0]
def wait_node_started(api_port):
echo("waiting for node to start ",prefix=True)
while run('curl localhost:%s/' % api_port, quiet=True).failed:
time.sleep(0.5)
echo(".")
echo('\n')
def echo(s,prefix=False):
puts(s, end='', flush=True, show_prefix=prefix)
def get_config(environment):
file = open("deployment_config.json", "r")
info_json = file.read().rstrip()
file.close()
return json.loads(info_json)[environment]
def get_image_tag(env):
if not hasattr(env, 'image_tag'):
return "v0.3.0"
else:
return env.image_tag
# copies all necessary files for deploying
def copy_resources():
puts("Copying deployment files to node")
# cleans up old scripts
run('rm -rf scripts')
run('mkdir scripts -p')
run('mkdir scripts/functions -p')
# copy local directory `script` to remote machine
put('scripts/deploy.sh', 'scripts/')
put('scripts/node.yml', 'scripts/')
put('scripts/functions/asserts.sh', 'scripts/functions/')
put('scripts/functions/docker.sh', 'scripts/functions/')
def home_dir():
with hide('output'):
return run('echo $HOME').stdout
def load_config():
# Set to False to disable `[ip.ad.dre.ss] out:` prefix
env.output_prefix = True
cfg_file = open("deployment_config.json", "r")
env.config = json.loads(cfg_file.read().rstrip())
cfg_file.close()
target = target_environment()
# Set the username
env.user = target["user"]
if not env.hosts:
# use addresses from config as fabric hosts
env.hosts = target['hosts']
else:
puts("will use hosts: %s" % env.hosts)
def target_environment():
target = env.config["target"]
environment = filter(lambda e: e["name"] == target, env.config["environments"])
return environment[0]
def docker_tag():
return target_environment['docker_tag']
def get_keypairs(yml, idx, count):
keypairs = target_environment()['keypairs'][yml]
return keypairs[idx:idx+count]

View File

@ -1,126 +0,0 @@
# management secret key is NAB5rGwT4qOEB+6nLQawkTfCOV2eiFSjgQK8bfEdZXY=
services:
fluence-0: # /ip4/127.0.0.1/tcp/9990/ws/p2p/12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK
command: --aqua-pool-size 2 -f ed25519 -k 29Apzfedhw2Jxh94Jj4rNSmavQ1TkNe8ALYRA7bMegobwp423aLrURxLk32WtXgXHDqoSz7GAT9fQfoMhVd1e5Ww -m 12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy -t 7770 -w 9990 --bootstraps /dns4/fluence-1/tcp/7771 /dns4/fluence-2/tcp/7772 # /dns4/kras-00.fluence.dev/tcp/7770 # uncomment to connect to Krasnodar network
container_name: fluence-0
environment:
RUST_BACKTRACE: full
# RUST_LOG: info,network=trace,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info,kademlia::behaviour=info
RUST_LOG: "warn,network=trace"
WASM_LOG: info
FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/127.0.0.1/tcp/5001"
image: fluencelabs/rust-peer:ipfs_v0.0.74
ports:
- 7770:7770 # tcp
- 9990:9990 # ws
- 5001:5001 # ipfs rpc
- 4001:4001 # ipfs swarm
- 18080:18080 # /metrics
restart: "no"
volumes:
- fluence-0:/.fluence
- data-0:/config
networks:
- fluence
fluence-1: # /ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWRABanQHUn28dxavN9ZS1zZghqoZVAYtFpoN7FdtoGTFv
command: --aqua-pool-size 2 -f ed25519 -k 5fNENMwkUT4dW3hPs9ZwqV4qA5pdTtUChTazAx9Awe2Vpz1yaJu3VCmcEZow6YgdFBGoZoFAZUZBbF3c2Ebd2iL -m 12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy -t 7771 -w 9991 --bootstraps /dns4/fluence-0/tcp/7770 /dns4/fluence-2/tcp/7772 # /dns4/kras-00.fluence.dev/tcp/7770 # uncomment to connect to Krasnodar network
container_name: fluence-1
environment:
RUST_BACKTRACE: full
# RUST_LOG: info,network=trace,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info,kademlia::behaviour=info
RUST_LOG: "warn,network=trace"
WASM_LOG: info
FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/127.0.0.1/tcp/5002"
image: fluencelabs/rust-peer:ipfs_v0.0.74
ports:
- 7771:7771 # tcp
- 9991:9991 # ws
- 5002:5001 # ipfs rpc
- 4002:4001 # ipfs swarm
- 18081:18080 # /metrics
restart: "no"
volumes:
- fluence-1:/.fluence
- data-1:/config
networks:
- fluence
fluence-2: # /ip4/127.0.0.1/tcp/9992/ws/p2p/12D3KooWFpQ7LHxcC9FEBUh3k4nSCC12jBhijJv3gJbi7wsNYzJ5
command: --aqua-pool-size 2 -f ed25519 -k 5DTs9LQS8Ay2dM8xBcikDRwYLMcanhsC6tynSSgpLyBZEv5Ey34LVw1fYcCuUj9A9EfvQJB2bsaGhSRoHQ7D6UE5 -m 12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy -t 7772 -w 9992 --bootstraps /dns4/fluence-0/tcp/7770 /dns4/fluence-1/tcp/7771 # /dns4/kras-00.fluence.dev/tcp/7770 # uncomment to connect to Krasnodar network
container_name: fluence-2
environment:
RUST_BACKTRACE: full
# RUST_LOG: info,network=trace,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info,kademlia::behaviour=info
RUST_LOG: "warn,network=trace"
WASM_LOG: info
FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/127.0.0.1/tcp/5003"
image: fluencelabs/rust-peer:ipfs_v0.0.74
ports:
- 7772:7772 # tcp
- 9992:9992 # ws
- 5003:5001 # ipfs rpc
- 4003:4001 # ipfs swarm
- 18082:18080 # /metrics
restart: "no"
volumes:
- fluence-2:/.fluence
- data-2:/config
networks:
- fluence
env.json:
restart: "no"
# depends_on:
# - fluence
image: busybox:stable
volumes:
- env.json:/env
command:
- sh
- -c
- |
cat <<EOF > /env/env.json
{
"nodes": [
{
"multiaddr": "/ip4/127.0.0.1/tcp/9990/ws/p2p/12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK",
"peerId": "12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK"
},
{
"multiaddr": "/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWRABanQHUn28dxavN9ZS1zZghqoZVAYtFpoN7FdtoGTFv",
"peerId": "12D3KooWRABanQHUn28dxavN9ZS1zZghqoZVAYtFpoN7FdtoGTFv"
},
{
"multiaddr": "/ip4/127.0.0.1/tcp/9992/ws/p2p/12D3KooWFpQ7LHxcC9FEBUh3k4nSCC12jBhijJv3gJbi7wsNYzJ5",
"peerId": "12D3KooWFpQ7LHxcC9FEBUh3k4nSCC12jBhijJv3gJbi7wsNYzJ5"
}
]
}
EOF
dashboard:
depends_on:
- env.json
image: fluencelabs/dashboard:latest
volumes:
- env.json:/dist/env
networks:
- fluence
ports:
- 8080:8080
version: "3.5"
volumes:
fluence: null
env.json: null
fluence-0:
fluence-1:
fluence-2:
data-0:
data-1:
data-2:
networks:
fluence: