/iexec-core

iExec Core Scheduler

Primary LanguageJavaApache License 2.0Apache-2.0

iExec Core Scheduler

Overview

An iExec workerpool is orchestrated by an iExec Core Scheduler. The iExec Core Scheduler watches on-chain deals and schedules off-chain computation among available workers.

Configuration

The iExec Core Scheduler is available as an OCI image on Docker Hub.

To run properly, the iExec Core Scheduler requires:

  • A blockchain node. iExec smart contracts must be deployed on the blockchain network.
  • An Ethereum wallet to interact with smart contracts on the blockchain network. To perform on-chain transactions, the wallet must be loaded with at least 0.1 ETH and some RLC.
  • A MongoDB instance to persist its data.
  • An iExec Blockchain Adapter for several blockchain network interactions.
  • An iExec Result Proxy to check if tasks results have been published.
  • An iExec Platform Registry to retrieve locations of iExec SMS services.
  • An iExec Config Server to retrieve configuration about blockchain.
  • One or many iExec Secret Management Service instances (referenced by the iExec Platform Registry) to handle secrets and enclave sessions of TEE tasks.

You can configure the iExec Core Scheduler with the following properties:

Environment variable Description Type Default value
IEXEC_CORE_PORT Server port of the iExec Core Scheduler. Positive integer 13000
MONGO_HOST MongoDB server host. Cannot be set with URI. String localhost
MONGO_PORT MongoDB server port. Cannot be set with URI. Positive integer 13002
IEXEC_PLATFORM_REGISTRY iExec Platform Registry server URL. URL http://localhost:8888
IEXEC_PLATFORM_REGISTRY_STACK [optional] Use a specific stack configuration exposed by the iExec Platform Registry. String
IEXEC_PLATFORM_REGISTRY_LABEL [optional] Use a labeled version of configuration files exposed by the iExec Platform Registry. It might be a Git label such as main, v10 or 07998be. String
REVEAL_TIMEOUT_PERIOD Detector period to track reveal timeouts for tasks. Positive integer 120000
IEXEC_ASK_REPLICATE_PERIOD Worker configuration, interval in milliseconds between 2 replicate requests. Positive integer 5000
IEXEC_CORE_REQUIRED_WORKER_VERSION Empty value will allow any worker version. String
IEXEC_WORKERS_WHITELIST List of worker addresses allowed to connect to the iExec Core Scheduler. String
IEXEC_CORE_WALLET_PATH Path to the wallet of the server. String ./src/main/resources/wallet/encrypted-wallet_scheduler.json
IEXEC_CORE_WALLET_PASSWORD Password to unlock the wallet of the server. String whatever
IEXEC_PRIVATE_CHAIN_ADDRESS Private URL to connect to the blockchain node. URL http://localhost:8545
POOL_ADDRESS On-chain address of the workerpool managed by the current iExec Core Scheduler. String 0x365E7BABAa85eC61Dffe5b520763062e6C29dA27
IEXEC_START_BLOCK_NUMBER Subscribe to new deal events from a specific block number. Positive integer 0
IEXEC_GAS_PRICE_MULTIPLIER Transactions will be sent with networkGasPrice * gasPriceMultiplier. Float 1.0
IEXEC_GAS_PRICE_CAP In Wei, will be used for transactions if networkGasPrice * gasPriceMultiplier > gasPriceCap Integer 22000000000
IEXEC_CORE_CHAIN_ADAPTER_PROTOCOL iExec Blockchain Adapter communication protocol. String http
IEXEC_CORE_CHAIN_ADAPTER_HOST iExec Blockchain Adapter server host. String localhost
IEXEC_CORE_CHAIN_ADAPTER_PORT iExec Blockchain Adapter server port. Positive integer 13010
IEXEC_CORE_CHAIN_ADAPTER_USERNAME Username to connect to the iExec Blockchain Adapter server. String admin
IEXEC_CORE_CHAIN_ADAPTER_PASSWORD Password to connect to the iExec Blockchain Adapter server. String whatever
IEXEC_CONFIG_SERVER_PROTOCOL iExec Config Server communication protocol. String http
IEXEC_CONFIG_SERVER_HOST iExec Config Server host. String localhost
IEXEC_CONFIG_SERVER_PORT iExec Config Server port. Positive integer 8888
IEXEC_CHAIN_HEALTH_POLLING_INTERVAL_IN_BLOCKS Polling interval (in blocks) on the blockchain to check this Scheduler can communicate with it. Positive integer 3
IEXEC_CHAIN_HEALTH_OUT_OF_SERVICE_THRESHOLD Max number of consecutive failures of blockchain connection attempts before this Scheduler is declared as OUT-OF-SERVICE. Positive integer 4
IEXEC_RESULT_REPOSITORY_PROTOCOL iExec Result Proxy server communication protocol. String http
IEXEC_RESULT_REPOSITORY_HOST iExec Result Proxy server host. String localhost
IEXEC_RESULT_REPOSITORY_PORT iExec Result Proxy server port. Positive integer 13200
IEXEC_CORE_MANAGEMENT_ACTUATORS Endpoint IDs that should be included or * for all. String health, info
IEXEC_LOGS_PURGE_RATE_IN_DAYS Interval in days between 2 executions of the purge mechanism. Positive integer 1
IEXEC_LOGS_AVAILABILITY_PERIOD_IN_DAYS Number of days to keep logs of past tasks. Positive integer 3

If it is not the first startup of the iExec Core Scheduler and if it received deals previously, the MongoDB instance will contain a configuration Collection in the iexec Database. The value stored in this document takes the precedence over the IEXEC_START_BLOCK_NUMBER configuration parameter. To enforce deal observation starting from the IEXEC_START_BLOCK_NUMBER value, the aforementioned document has to be deleted in the MongoDB. All deals prior to the IEXEC_START_BLOCK_NUMBER will then be ignored.

A more exhaustive documentation is available on the official documentation of iExec.

Health checks

A health endpoint (/actuator/health) is enabled by default and can be accessed on the IEXEC_CORE_PORT. This endpoint allows to define health checks in an orchestrator or a compose file. No default strategy has been implemented in the Dockerfile at the moment.

Build from sources

./gradlew build

License

This repository code is released under the Apache License 2.0.