https://github.com/golemfactory/ansible-role-ya-provider
https://github.com/golemfactory/ansible-role-ya-provider
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/golemfactory/ansible-role-ya-provider
- Owner: golemfactory
- Created: 2021-08-25T07:04:28.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-22T07:52:42.000Z (almost 2 years ago)
- Last Synced: 2025-04-05T06:31:43.338Z (about 1 year ago)
- Language: Jinja
- Size: 67.4 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ya-provider
It installs [yagna](https://github.com/golemfactory/yagna/) provider with [wasi](https://github.com/golemfactory/ya-runtime-wasi/) and [vm](https://github.com/golemfactory/ya-runtime-vm/) runtimes.
Services are installed withouth using root as systemd user services, running as `ansible_user`.
Tasks that require root are in separate file `tasks/system_setup.yml`.
## Requirements
### Systemd
Target system must use systemd >= 230.
It's possible to use older systemd version, but user lingering must be manually enabled with `sudo loginctl enable-linger username`.
### KVM
VM runtime requires access to `/dev/kvm` and working acceleration. Required steps to configure access are in `tasks/system_setup.yml`.
Note: It's possible to disable vm runtime, by removing it from `ya_provider_presets_active`.
## Role Variables
### defaults
Releases:
- `ya_provider_yagna_package_prefix`: What name of yagna release package file starts with.
- `ya_provider_yagna_version`: Tag of yagna release.
- `ya_provider_yagna_url`: Url to yagna release tarball. For testing purposes can be changed to `file://` path.
- `ya_provider_wasi_version`: Tag of wasi runtime release.
- `ya_provider_wasi_url`: Url to wasi runtime release tarball.
- `ya_provider_vm_version`: Tag of vm runtime release.
- `ya_provider_vm_url`: Url to wasi runtime tarball.
- `ya_provider_installer_resources_version`: Tag of ya-installer-resources release.
- `ya_provider_installer_resources_url`: Url to ya-installer-resources tarball.
- `ya_provider_add_installer_resources`: Enables installing ya-installer-resources.
Promtail:
- `ya_provider_use_promtail`: Enables usage of promtail [boolean].
- `ya_provider_promtail_version`: Tag of loki/promtail release.
- `ya_provider_promtail_url`: Url to promtail release zip.
- `ya_provider_loki_url`: Url where promtail should send logs. If promtail is enabled, it must be set to something.
Common:
- `ya_provider_dir`: Directory, where all config and runtime files are kept.
Yagna config:
- `ya_provider_gsb_url`: Address, where yagna should listen for GSB connections.
- `ya_provider_yagna_api_url`: Address, where yagna should listen for API connections.
- `ya_provider_net_bind_ip`: IP Address, where yagna should listen for P2P connections.
- `ya_provider_net_bind_port`: Port number, where yagna should listen for P2P connections.
- `ya_provider_rust_log`: Log level.
Ya-provider config:
- `ya_provider_name`: Your fancy name for others in the network to see.
- `ya_provider_subnet`: Subnet. See [provider tutorial](https://handbook.golem.network/provider-tutorials/provider-tutorial).
- `ya_provider_payment_network_group`: Payment network group: `testnet` or `mainnet`.
- `ya_provider_hardware`: How much resources should yagna use. If not specified, yagna uses internal logic to pick some sane defaults. Format: `{cpu_threads: int, mem_gib: int, storage_gib: int}`.
- `ya_provider_presets_active`: List of runtimes to install.
- `ya_provider_presets_usage_coeffs`: Pricing. See [provider docs # Offer formulation](https://github.com/golemfactory/yagna/tree/master/agent/provider#offer-formulation). Format: `{cpu: float [GLM/sec], duration: float [GLM/sec], initial: float [GLM]}`.
- `ya_provider_account`: Address to collect income to. Format: `"0x..."` (quotes around "0x..." are important, because otherwise ansible converts it into decimal number). Optional, although encouraged, when running on mainnet payment network.
Stopping (`tasks/stop.yml`):
- `ya_provider_stop_purge`: Purge yagna datadir [boolean].
### vars
- `ya_provider_releases_dir`: Directory for unpacking release binaries.
- `ya_provider_unit_name`: Systemd unit name for yagna service.
- `ya_provider_yagna_dir`: Path to unpacked yagna binaries.
- `ya_provider_resources_dir`: Directory for unpacking installer resources.
- `ya_provider_net_bind_url`: Address, where yagna should listen for P2P connections.
- `ya_provider_promtail_dir`: Directory with unpacked promtail binary.
- `ya_provider_promtail_bin`: Path to promtail binary.
## Dependencies
None
## Example Playbook
- hosts: all
tasks:
# only this uses "become" for privilege escalation
- import_role:
name: golemfactory.ya_provider
tasks_from: system_setup
- hosts: all
vars:
ya_provider_name: Your fancy name
ya_provider_subnet: public-beta
ya_provider_payment_network_group: mainnet
ya_provider_hardware:
cpu_threads: 4
mem_gib: 2
storage_gib: 10
ya_provider_presets_usage_coeffs:
cpu: 0.0001
duration: 0.00005
initial: 0.0
ya_provider_account: "0xYourEthereumAddress"
roles:
- golemfactory.ya_provider
## License
GPL-3.0-or-later
## Author Information
[Golem Network](https://golem.network/)