Search…
Manage a workerpool
A workerpool manager is an essential actor in the iExec network. It will be in charge of proposing available computing resources (workers) to task requesters.
The iexec-core software will take care of handling tasks comming from blockchain events and will distribute it to alive workers.

Prerequisites

Workers are deployed with docker containers. Follow instructions on the docker website for installation.

Docker compose file

Since all the services used by iExec run in docker, we will use docker-compose to start the scheduler and its related service. You can follow the instructions on the the docker compose website to install it.
In the docker compose file, you will find the following components:

Database service

A database is required for running the scheduler.
1
image: mongo:4-xenial
2
container_name: mongo
3
networks:
4
- iexec-net
5
restart: unless-stopped
6
7
mongo_ui:
8
image: mongo-express:0.49
9
container_name: mongo_ui
10
environment:
11
- ME_CONFIG_BASICAUTH_USERNAME=mongoUiAdmin
12
- ME_CONFIG_BASICAUTH_PASSWORD=mongoUiPassw0rd
13
ports:
14
- 8081:8081
15
networks:
16
- iexec-net
17
depends_on:
18
- mongo
19
restart: unless-stopped
Copied!

IPFS service

An IPFS node is required for running the scheduler.
1
ipfs:
2
image: jbenet/go-ipfs:latest
3
container_name: ipfs-node
4
ports:
5
- 4001:4001
6
volumes:
7
- ipfs-docker-staging:/export
8
- ipfs-docker-data:/data/ipfs
9
networks:
10
- iexec-net
11
restart: unless-stopped
Copied!

Scheduler service

The main component is the scheduler service. In the docker compose file, it is defined as follow:
1
core:
2
image: iexechub/iexec-core:3.0.0
3
container_name: core
4
environment:
5
- IEXEC_CORE_WALLET_PATH=/iexec-wallet/wallet.json
6
- IEXEC_CORE_WALLET_PASSWORD=myWalletPassw0rd
7
- IEXEC_PRIVATE_CHAIN_ADDRESS=https://my-jsonrpc-enabled-ethereum-node.com
8
- IEXEC_PUBLIC_CHAIN_ADDRESS=https://my-default-public-ethereum-node-for-workers.com
9
- IEXEC_HUB_ADDRESS=0xiexechubaddress
10
- POOL_ADDRESS=0xmyworkerpool
11
- IEXEC_START_BLOCK_NUMBER=0
12
- REVEAL_TIMEOUT_PERIOD=120000
13
- IEXEC_ASK_REPLICATE_PERIOD=30000
14
- IEXEC_RESULT_REPOSITORY_HOST=my-workerpool.com
15
- IEXEC_RESULT_REPOSITORY_PORT=18090
16
- IEXEC_CHAIN_ID=42
17
- MONGO_HOST=mongo
18
- IEXEC_IPFS_HOST=ipfs
19
- IEXEC_IPFS_PORT=5001
20
- IEXEC_CORE_PORT=18090
21
- IEXEC_SMS_HOST=http://my-sms.com
22
volumes:
23
- ./wallet.json:/iexec-wallet/wallet.json
24
ports:
25
- 18090:18090
26
networks:
27
- iexec-net
28
depends_on:
29
- mongo
30
- ipfs
31
restart: unless-stopped
Copied!
Like the database, the different variables used here are defined in the file .env and should be modified.

Start a scheduler

To start a scheduler, it is pretty straightforward since the scheduler can be started like any docker compose service, so it can be started using:
1
docker-compose up -d
Copied!
Please note that you need to make sure the scheduler has finished its start before starting any worker that will connect to the pool.

Stop a scheduler

In a similar fashion, the scheduler can be stopped with the following command:
1
docker-compose down
Copied!
Please note that once the scheduler is turned off, the workers will not work anymore.
Last modified 30d ago