Module: node
can_overwrite_file(file, dir, force)
Whether setup is allowed to (over)write the file
If the file exists, the user is prompted to overwrite it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file |
str
|
The file to check |
required |
dir |
str
|
The directory where the file is located |
required |
force |
bool
|
Whether to force overwrite existing file |
required |
Source code in src/infernet_cli/node.py
get_compatible_node_versions()
Get all recipe-compatible node versions for the CLI.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of compatible node versions, sorted in descending order. |
Source code in src/infernet_cli/node.py
get_configs(chain, dir, gpu, version, inputs, force=False, skip=False)
Pull node configurations for a specific chain.
- Touches target directory
- Fetches available node tags to validate version
- Fetches configuration files
- Keeps the correct docker-compose file based on GPU support
- Fills in the recipe with input values
- Writes the configuration files
Parameters:
Name | Type | Description | Default |
---|---|---|---|
chain |
str
|
The chain for which to pull the configurations. |
required |
dir |
str
|
The directory to write the configurations to. |
required |
gpu |
bool
|
Whether to enable GPU support. |
required |
version |
Optional[str]
|
The version of the node to configure. |
required |
inputs |
Optional[dict[str, Any]]
|
The input values to fill in the recipe. |
required |
force |
bool
|
Whether to force overwrite existing files. |
False
|
skip |
bool
|
Whether to skip optional inputs. |
False
|
Source code in src/infernet_cli/node.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|
get_docker_image_tags(owner, repo)
Get all tags for a Docker image repository.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
owner |
str
|
The owner of the repository. |
required |
repo |
str
|
The repository name. |
required |
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of tags. |