numerai-cli 1.1.2__tar.gz → 1.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. numerai_cli-1.1.4/LICENSE +21 -0
  2. numerai_cli-1.1.4/PKG-INFO +520 -0
  3. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/README.md +7 -7
  4. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/destroy_all.py +1 -1
  5. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/node/destroy.py +1 -1
  6. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/uninstall.py +1 -1
  7. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/upgrade.py +1 -1
  8. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/util/debug.py +12 -0
  9. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/util/docker.py +0 -1
  10. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/util/terraform.py +4 -4
  11. {numerai-cli-1.1.2/numerai/examples/tournament-python3 → numerai_cli-1.1.4/numerai/examples/crypto-python3}/Dockerfile +1 -1
  12. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/crypto-python3/predict.py +30 -48
  13. numerai_cli-1.1.4/numerai/examples/crypto-python3/requirements.txt +6 -0
  14. {numerai-cli-1.1.2/numerai/examples/crypto-python3 → numerai_cli-1.1.4/numerai/examples/signals-python3}/Dockerfile +1 -1
  15. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/signals-python3/predict.py +3 -5
  16. numerai_cli-1.1.4/numerai/examples/signals-python3/requirements.txt +6 -0
  17. {numerai-cli-1.1.2/numerai/examples/signals-python3 → numerai_cli-1.1.4/numerai/examples/tournament-python3}/Dockerfile +1 -1
  18. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/tournament-python3/predict.py +6 -12
  19. numerai_cli-1.1.4/numerai/examples/tournament-python3/requirements.txt +6 -0
  20. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/-inputs.tf +1 -1
  21. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/-main.tf +7 -0
  22. numerai_cli-1.1.4/numerai/terraform/aws/aws/-locals.tf +4 -0
  23. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/aws/cluster.tf +14 -13
  24. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/input.tf +1 -1
  25. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/-inputs.tf +1 -1
  26. numerai_cli-1.1.4/numerai_cli.egg-info/PKG-INFO +520 -0
  27. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai_cli.egg-info/SOURCES.txt +1 -0
  28. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai_cli.egg-info/entry_points.txt +0 -1
  29. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/setup.py +1 -1
  30. numerai-cli-1.1.2/PKG-INFO +0 -494
  31. numerai-cli-1.1.2/numerai/examples/crypto-python3/requirements.txt +0 -5
  32. numerai-cli-1.1.2/numerai/examples/signals-python3/requirements.txt +0 -5
  33. numerai-cli-1.1.2/numerai/examples/tournament-python3/requirements.txt +0 -5
  34. numerai-cli-1.1.2/numerai/terraform/aws/aws/-locals.tf +0 -4
  35. numerai-cli-1.1.2/numerai_cli.egg-info/PKG-INFO +0 -494
  36. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/MANIFEST.in +0 -0
  37. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/__init__.py +0 -0
  38. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/__init__.py +0 -0
  39. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/constants.py +0 -0
  40. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/doctor.py +0 -0
  41. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/misc.py +0 -0
  42. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/node/__init__.py +0 -0
  43. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/node/config.py +0 -0
  44. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/node/deploy.py +0 -0
  45. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/node/test.py +0 -0
  46. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/setup.py +0 -0
  47. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/util/__init__.py +0 -0
  48. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/util/files.py +0 -0
  49. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/cli/util/keys.py +0 -0
  50. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/signals-python3/train.py +0 -0
  51. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/tournament-python3/train.py +0 -0
  52. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/tournament-rlang/Dockerfile +0 -0
  53. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/tournament-rlang/install_packages.R +0 -0
  54. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/examples/tournament-rlang/main.R +0 -0
  55. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/-outputs.tf +0 -0
  56. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/aws/-inputs.tf +0 -0
  57. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/aws/-outputs.tf +0 -0
  58. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/aws/main.zip +0 -0
  59. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/aws/network.tf +0 -0
  60. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/aws/aws/webhook.tf +0 -0
  61. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/azure/cluster.tf +0 -0
  62. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/azure/input.tf +0 -0
  63. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/azure/locals.tf +0 -0
  64. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/azure/outputs.tf +0 -0
  65. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/azure/webhook.tf +0 -0
  66. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/azure_cron_trigger.zip +0 -0
  67. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/azure_trigger.zip +0 -0
  68. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/main.tf +0 -0
  69. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/outputs.tf +0 -0
  70. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/azure/registry.tf +0 -0
  71. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/-main.tf +0 -0
  72. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/-outputs.tf +0 -0
  73. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/cloud-function.zip +0 -0
  74. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/gcp/-inputs.tf +0 -0
  75. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/gcp/-locals.tf +0 -0
  76. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/gcp/-outputs.tf +0 -0
  77. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/gcp/cluster.tf +0 -0
  78. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/gcp/webhook.tf +0 -0
  79. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/gcp/workflow-source.yaml +0 -0
  80. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/registry.tf +0 -0
  81. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai/terraform/gcp/services.tf +0 -0
  82. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai_cli.egg-info/dependency_links.txt +0 -0
  83. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai_cli.egg-info/requires.txt +0 -0
  84. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/numerai_cli.egg-info/top_level.txt +0 -0
  85. {numerai-cli-1.1.2 → numerai_cli-1.1.4}/setup.cfg +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Numerai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,520 @@
1
+ Metadata-Version: 2.4
2
+ Name: numerai-cli
3
+ Version: 1.1.4
4
+ Summary: A library for deploying Numer.ai Prediction Nodes.
5
+ Home-page: https://github.com/numerai/numerai-cli
6
+ Author: Numer.ai
7
+ Author-email: contact@numer.ai
8
+ License: MIT
9
+ Requires-Python: >=3.6.0
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: click>=7
13
+ Requires-Dist: boto3
14
+ Requires-Dist: botocore
15
+ Requires-Dist: numerapi>=2.4.5
16
+ Requires-Dist: colorama
17
+ Requires-Dist: requests
18
+ Requires-Dist: azure-identity
19
+ Requires-Dist: azure-mgmt-subscription
20
+ Requires-Dist: azure-mgmt-containerregistry
21
+ Requires-Dist: azure-containerregistry
22
+ Requires-Dist: azure-data-tables
23
+ Requires-Dist: azure-mgmt-storage
24
+ Requires-Dist: google-cloud-storage
25
+ Requires-Dist: google-cloud-run
26
+ Requires-Dist: google-cloud-artifact-registry
27
+ Requires-Dist: google-cloud-logging
28
+ Dynamic: author
29
+ Dynamic: author-email
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ # numerai-cli
40
+
41
+ [![PyPI](https://img.shields.io/pypi/v/numerai-cli.svg?color=brightgreen)](https://pypi.org/project/numerai-cli/)
42
+
43
+ Welcome to the Numerai CLI for the [Numerai Tournament](https://docs.numer.ai/tournament/learn).
44
+ Numerai CLI (aka Compute Heavy) is a tool to help you set up cloud automation for your Numerai predictions.
45
+ This README is designed to have EVERYTHING you need to setup and maintain a Numerai Compute Heavy node.
46
+
47
+ This CLI runs on your local computer to configure a Numerai Prediction Node in the cloud.
48
+ This solution is architected to cost less than $5/mo on average, but actual costs may vary.
49
+ It has been tested on MacOS/OSX, Windows 8/10, and Ubuntu 18/20,
50
+ but should theoretically work anywhere that Docker and Python 3 are available.
51
+
52
+ ## Contents
53
+
54
+ - [Getting Started](#getting-started)
55
+ - [List of Commands](#list-of-commands)
56
+ - [Upgrading](#upgrading)
57
+ - [Upgrading from 0.1/0.2 to 0.3.0](#upgrading-from-0102-to-030)
58
+ - [Beyond](#beyond)
59
+ - [Uninstalling](#uninstalling)
60
+ - [Troubleshooting and Feedback](#troubleshooting-and-feedback)
61
+ - [Python](#python)
62
+ - [Docker](#docker)
63
+ - [MacOS and Windows 10](#macos-and-windows-10)
64
+ - [Linux](#linux)
65
+ - [Older PCs: Docker Toolbox](#older-pcs-docker-toolbox)
66
+ - [Azure](#azure)
67
+ - [Common Errors](#common-errors)
68
+ - [Billing Alerts](#billing-alerts)
69
+ - [Prediction Node Architecture](#prediction-node-architecture)
70
+ - [Python Example](#python-example)
71
+ - [RLang Example](#rlang-example)
72
+ - [The Dockerfile](#the-dockerfile)
73
+ - [Cloud Components](#cloud-components)
74
+ - [Special Thanks](#special-thanks)
75
+
76
+ ## Getting Started
77
+
78
+ To use this tool you need:
79
+
80
+ - Numerai API keys
81
+ - Paid cloud provider account
82
+ - Python
83
+ - Docker
84
+
85
+ 1. Sign up a Numerai Account, get your Numerai API Keys, and your first Model:
86
+
87
+ 1. Sign up at <https://numer.ai/signup> and log in to your new account
88
+ 2. Go to <https://numer.ai/account> > "Your API keys" section > click "Add"
89
+ 3. Name your key and check all boxes under "Scope this key will have"
90
+ 4. Enter your password and click "Confirm"
91
+ 5. Copy your secret public key and secret key somewhere safe
92
+
93
+ 2. Choose your cloud provider and follow the corresponding guide:
94
+
95
+ - [AWS Setup Guide](./docs/aws_setup_guide.md)
96
+ - [Azure Setup Guide](./docs/azure_setup_guide.md)
97
+ - [GCP Setup Guide](./docs/gcp_setup_guide.md)
98
+
99
+ 3. Install Docker and Python for your Operating System (if you encounter errors or your
100
+ OS is not supported, please see [Troubleshooting and Feedback](#troubleshooting-and-feedback)):
101
+
102
+ - Mac Terminal (cmd + space, type `terminal`, select `terminal.app`):
103
+
104
+ ```shell
105
+ curl https://raw.githubusercontent.com/numerai/numerai-cli/master/scripts/setup-mac.sh | bash
106
+ ```
107
+
108
+ - Ubuntu 18/20 Terminal (ctrl + alt + t):
109
+
110
+ ```shell
111
+ sudo apt update && sudo apt install -y libcurl4 curl && sudo curl https://raw.githubusercontent.com/numerai/numerai-cli/master/scripts/setup-ubu.sh | sudo bash
112
+ ```
113
+
114
+ - Windows 10 Command Prompt (windows key, type `cmd`, select Command Prompt):
115
+
116
+ ```powershell
117
+ powershell -command "$Script = Invoke-WebRequest 'https://raw.githubusercontent.com/numerai/numerai-cli/master/scripts/setup-win10.ps1'; $ScriptBlock = [ScriptBlock]::Create($Script.Content); Invoke-Command criptBlock $ScriptBlock"
118
+ ```
119
+
120
+ 4. After the setup script confirms Python and Docker, install `numerai-cli` via:
121
+
122
+ ```shell
123
+ pip3 install --upgrade numerai-cli --user
124
+ ```
125
+
126
+ NOTES:
127
+
128
+ - This command will also work to update to new versions of the package in the future.
129
+ - If you are using python venv then drop the --user option.
130
+ If you don't know what that is, disregard this note.
131
+
132
+ 5. Run these commands on your personal computer (not a temporary instance)
133
+ to get an example node running in minutes:
134
+
135
+ For AWS run:
136
+
137
+ ```shell
138
+ numerai setup --provider aws
139
+ ```
140
+
141
+ and enter your user's keys when prompted.
142
+
143
+ For Azure users run:
144
+
145
+ ```shell
146
+ numerai setup --provider azure
147
+ ```
148
+
149
+ and enter your application's keys when prompted.
150
+
151
+ For GCP users run:
152
+
153
+ ```shell
154
+ numerai setup --provider gcp
155
+ ```
156
+
157
+ and enter the complete path to your downloaded key when prompted.
158
+
159
+ ```shell
160
+ numerai node config --example tournament-python3
161
+ numerai node deploy
162
+ numerai node test
163
+ ```
164
+
165
+ If you want to use larger instances to generate your predictions first run `numerai list-constants`
166
+ to list the vCPU/mem presets available, then you can configure a node to use one of the presets via:
167
+
168
+ ```shell
169
+ numerai node config mem-lg
170
+ ```
171
+
172
+ Your compute node is now setup and ready to run! When you make changes to your code or re-train your model,
173
+ simply deploy and test your node again:
174
+
175
+ ```shell
176
+ numerai node deploy
177
+ numerai node test
178
+ ```
179
+
180
+ NOTES:
181
+
182
+ - These commands have stored configuration files in `$USER_HOME/.numerai/`. DO NOT LOSE THIS FILE!
183
+ or else you will have to manually delete every cloud resource by hand.
184
+ - The example node trains a model in the cloud, which is bad. You should train locally, pickle the
185
+ trained model, deploy your node, then unpickle your model to do the live predictions
186
+ - The default example does _not_ make stake changes; please refer to the [numerapi docs](https://numerapi.readthedocs.io/en/latest/api/numerapi.html#module-numerapi.numerapi)
187
+ for the methods you must call to do this.
188
+ - You can view resources and logs in the AWS Console (region us-east-1) for your
189
+ [ECS Cluster](https://console.aws.amazon.com/ecs/home?region=us-east-1#/clusters/numeraiubmission-ecs-cluster/tasks)
190
+ and [other resources](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups)
191
+
192
+ ### List of Commands
193
+
194
+ Use the `--help` option on any command or sub-command to get a full description of it:
195
+
196
+ ```shell
197
+ numerai
198
+ numerai --help
199
+ numerai [command] --help
200
+ numerai [command] [sub-command] --help
201
+ ```
202
+
203
+ Each command or sub-command takes its own options, for example if you want to copy the
204
+ numerai signals example and configure a node for a signals model with large memory
205
+ requirements you'd use something like this (replacing [MODEL NAME] with the relevant
206
+ signals model name):
207
+
208
+ ```shell
209
+ numerai node -m [MODEL NAME] -t 11 config -s mem-lg -e signals-python3
210
+ ```
211
+
212
+ Here, the `node` command takes a model name with `-m` and an argument `-t 11` to specify the tournament number
213
+ (numerai is tournament 8, signals is tournament 11, crypto is tournament 12).
214
+ The `config` sub-command also takes a `-s` option to specify the size of the node to configure.
215
+
216
+ ### Upgrading
217
+
218
+ Upgrading numerai-cli will always require you to update the package itself using pip:
219
+
220
+ ```shell
221
+ pip install --upgrade numerai-cli --user
222
+ numerai upgrade
223
+ ```
224
+
225
+ #### 0.1/0.2 to 0.3
226
+
227
+ CLI 0.3 uses a new configuration format that is incompatible with versions 0.1 and 0.2,
228
+ but a command to migrate you configuration is provided for you. Run this in the directory
229
+ you ran `numerai setup` from the previous version:
230
+
231
+ ```shell
232
+ numerai upgrade
233
+ ```
234
+
235
+ #### 0.3 to 0.4
236
+
237
+ CLI 0.4 introduces a new provider option (Microsoft Azure) and moves the default aws
238
+ terraform into a subdirectory. You'll need to run `upgrade`:
239
+
240
+ ```shell
241
+ numerai upgrade
242
+ ```
243
+
244
+ If you want to use azure, follow the [setup guide for azure](./docs/azure_setup_guide.md)
245
+ then run:
246
+
247
+ ```shell
248
+ numerai setup --provider azure
249
+ numerai node config --provider azure
250
+ ```
251
+
252
+ #### 0.4 to 1.0
253
+
254
+ CLI 1.0 is a big change for AWS, you'll need to:
255
+
256
+ - update the permissions for the role you created in the [AWS Setup Guide](./docs/aws_setup_guide.md)
257
+ - update the terraform with `numerai setup`
258
+ - replace your aws nodes by running:
259
+ - `numerai node -m <model_name> destroy --preserve-node-config`
260
+ - `numerai node -m <model_name> config`
261
+ - `numerai node -m <model_name> deploy`
262
+
263
+ #### Beyond
264
+
265
+ Some updates will make changes to configuration files used by Numerai CLI. These will
266
+ require you to re-run some commands to upgrade your nodes to the newest versions:
267
+
268
+ - `numerai setup` will copy over changes to files in the `$HOME/.numerai` directory
269
+ - `numerai node config` will apply those changes to a node
270
+
271
+ ### Uninstalling
272
+
273
+ ```shell
274
+ numerai uninstall
275
+ ```
276
+
277
+ ## Troubleshooting and Feedback
278
+
279
+ Please review this entire section and check github issues before asking questions.
280
+ If you've exhausted this document, then join us on Discord
281
+
282
+ If you still cannot find a solution or answer, please join us on
283
+ [Discord](https://discord.gg/numerai)
284
+ and include the following information with your issue/message:
285
+
286
+ - The commands you ran that caused the error (even previous commands)
287
+ - Version information from running:
288
+ - `pip3 show numerai-cli`
289
+ - `python -V`
290
+ - `docker -v`
291
+ - System Information from running
292
+ - Mac: `system_profiler SPSoftwareDataType && system_profiler SPHardwareDataType`
293
+ - Linux: `lsb_release -a && uname -a`
294
+ - Windows: `powershell -command "Get-ComputerInfo"`
295
+
296
+ ### Python
297
+
298
+ If the environment setup script fails to install Python3 for you, report the error to Numerai
299
+ and then install it manually with one of the following options:
300
+
301
+ - [Download Python3 directly](https://www.python.org/downloads/)
302
+ - install it from [your system's package manager](https://en.wikipedia.org/wiki/List_of_software_package_management_systems)
303
+ - Use [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/) to install and manage python for you
304
+
305
+ ### Docker
306
+
307
+ If the environment setup script fails to install Docker for you, report the error to Numerai
308
+ then read the following to get a working installation on your machine. For PCs, you may need to [activate virtualization in your BIOS](https://superuser.com/questions/1382472/how-do-i-find-and-enable-the-virtualization-setting-on-windows-10) before installing.
309
+
310
+ #### MacOS and Windows 10
311
+
312
+ Just install [Docker Desktop](https://www.docker.com/products/docker-desktop) to get it running.
313
+ You should also increase the RAM allocated to the VM:
314
+
315
+ 1. Open the Docker Desktop GUI then
316
+ 2. Click Gear in top right corner
317
+ 3. Select Resources > Advanced in left sidebar
318
+ 4. Use slider to allocate more memory (leave a few gigs for your OS and background applications, otherwise your computer might crash)
319
+
320
+ #### Linux
321
+
322
+ Check here for instructions for your distribution:
323
+ <https://docs.docker.com/engine/install/>
324
+
325
+ #### Older PCs: Docker Toolbox
326
+
327
+ If your machine is older and/or doesn't have Hyper-V enabled, then you will have to follow these steps to install docker toolbox on your machine:
328
+
329
+ 1. [Install Oracle VirtualBox](https://www.virtualbox.org/wiki/Downloads) for your Operating System
330
+ 2. Restart your computer
331
+ 3. [Install Docker Toolbox](https://github.com/docker/toolbox/releases)
332
+ 4. Restart your computer
333
+ 5. After it's installed, open the "Docker QuickStart Terminal" and run the following to increase its RAM:
334
+
335
+ ```shell
336
+ docker-machine rm default
337
+ docker-machine create -d virtualbox --virtualbox-cpu-count=2 --virtualbox-memory=4096 --virtualbox-disk-size=50000 default
338
+ docker-machine restart default
339
+ ```
340
+
341
+ NOTE: your code must live somewhere under your User directory (ie. C:\Users\USER_NAME\ANY_FOLDER). This is a restriction of docker toolbox not sharing paths correctly otherwise.
342
+
343
+ ### Azure
344
+
345
+ If you just made your Azure account there's a chance your account provisioning could take some time, potentially up to 24 hours.
346
+
347
+ When configuring your node for the first time the numerai-cli may hang as it tries to provision infrastructure in your account. If running `numerai node config --provider azure` shows no log output for more than 5 minutes, your account is likely in the stuck provisioning state. While we investigate this issue, the best course of action is to wait until the following day and run the command again as there is no way to skip this Azure provisioning step.
348
+
349
+ ### Common Errors
350
+
351
+ ```shell
352
+ Error:
353
+ subprocess.CalledProcessError: Command 'docker run --rm -it -v /home/jason/tmp/.numerai:/opt/plan -w /opt/plan hashicorp/terraform:light init' returned non-zero exit status 127.
354
+
355
+
356
+ Reason:
357
+ Docker is not installed.
358
+
359
+ Solutions:
360
+ If you're certain that docker is installed, make sure that your user can execute docker, ie. try to run `docker ps`.
361
+ If that's the issue, then depending on your system, you can do the following:
362
+
363
+ - Windows/OSX
364
+ - Make sure the Docker Desktop is running and finished booting up.
365
+ It can take a few minutes to be completely ready.
366
+ When clicking on the docker tray icon, it should say "Docker Desktop is Running".
367
+ - If you're using Docker Toolbox on Windows, then make sure you've opened the "Docker Quickstart Terminal".
368
+
369
+ - Linux
370
+ - Run `sudo usermod -aG docker $USER`
371
+ - Then reboot or logout/login for this to take effect.
372
+ ```
373
+
374
+ ```shell
375
+ Error:
376
+ docker: Error response from daemon: Drive has not been shared
377
+
378
+ Solutions:
379
+ - You need to [share your drive](https://docs.docker.com/docker-for-windows/#shared-drives).
380
+ ```
381
+
382
+ ```shell
383
+ Error:
384
+ numerai: command not found
385
+
386
+ Solutions:
387
+ - osx/linux: Try and run `~/.local/bin/numerai`
388
+ - Windows: `%LOCALAPPDATA%\Programs\Python\Python37-32\Scripts\numerai.exe`
389
+ - Alternatively, exit then re-open your terminal/command prompt.
390
+ ```
391
+
392
+ ```shell
393
+ Error:
394
+ error calling sts:GetCallerIdentity: InvalidClientTokenId: The security token included in the request is invalid.
395
+ ...
396
+ Command 'docker run -e "AWS_ACCESS_KEY_ID=..." -e "AWS_SECRET_ACCESS_KEY=..." --rm -it -v /home/jason/tmp/.numerai:/opt/plan -w /opt/planhashicorp/terraform:light apply -auto-approve' returned non-zero exit status 1.
397
+
398
+ Solutions:
399
+ - Run `numerai configure` to re-write your API Keys
400
+ ```
401
+
402
+ ```shell
403
+ Error:
404
+ ERROR numerapi.base_api: Error received from your webhook server: {"tasks":[],"failures":[{"reason":"The requested CPU configuration is above your limit"}]}
405
+
406
+ Solution:
407
+ 1. Go to the [Quota Dashboard for EC2](console.aws.amazon.com/servicequotas/home/services/ec2/quotas)
408
+ 2. Search for "On-Demand", this will list all instance types and their limits for your account.
409
+ 3. Click the bubble next to "Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances"
410
+ 4. click "Request quota increase" in the top right
411
+ 5. Input a higher value than the currently applied quota and finish the request
412
+ ```
413
+
414
+ - If after AWS increases your quota, you still get this error, try again 1-2 more times
415
+ - You may have to complete a quota request for other types of instances too depending on how resource intensive your setup is
416
+
417
+ ## Billing Alerts
418
+
419
+ There's no automated way to setup billing alerts, so you'll need to
420
+ [configure one manually](https://www.cloudberrylab.com/resources/blog/how-to-configure-billing-alerts-for-your-aws-account/).
421
+ We estimate costs to be less than $5 per month unless your compute takes more than 12 hours a week,
422
+ but increasing the RAM/CPU will increase your costs.
423
+
424
+ ## Prediction Node Architecture
425
+
426
+ A Prediction Node represents a cloud-based model that Numerai can trigger for predictions; it is designed to be reliable, resource efficient, and easy to configure and debug. Prediction Nodes use a few important components like a `Dockerfile`, a `Trigger`, a `Container`, and a `Compute Cluster`, all of which can be created using one of the following examples.
427
+
428
+ ### Python Example
429
+
430
+ ```shell
431
+ numerai-python3
432
+ ├── Dockerfile
433
+ ├── .dockerignore
434
+ ├── predict.py
435
+ ├── requirements.txt
436
+ └── train.py
437
+ ```
438
+
439
+ - `Dockerfile`: Used during `numerai node deploy` to build a Docker image that's used to run your code in the cloud. It copies all files in its directory, installs Python requirements for requirements.txt, and runs `python predict.py` by default.
440
+
441
+ - `.dockerignore`: This file uses regex to match files that should not be included in the Docker image.
442
+
443
+ - `train.py`: This is an extra entry point specifically for training, it's used when running `numerai node test --local --command "python train.py"`
444
+
445
+ - `requirements.txt`: Defines python packages required to run the code.
446
+ - `predict.py`: Gets run by default locally and in the cloud when running `numerai test` without the `--command|-c` option.
447
+
448
+ ### RLang Example
449
+
450
+ ```shell
451
+ numerai-rlang
452
+ ├── Dockerfile
453
+ ├── .dockerignore
454
+ ├── install_packages.R
455
+ └── main.R
456
+ ```
457
+
458
+ - `Dockerfile`: Used during `numerai node deploy` to build a Docker image that's used to run your code in the cloud. It copies all files in its directory, installs Rlang requirements from install_packages.R, and runs main.R by default.
459
+
460
+ - `.dockerignore`: This file uses regex to match files that should not be included in the Docker image.
461
+
462
+ - `install_packages.R`: Installs dependencies necessary for running the example.
463
+ - `main.R`: Ran by default locally and in the cloud and when running `numerai test` without the `--command|-c` option.
464
+
465
+ ### The Dockerfile
466
+
467
+ This is the most important component of deploying a Prediction Node. It is a program (much like a bash script), that packages up your code as an `image`; this image contains everything your code needs to run in the cloud. The most typical case of a Dockerfile is demonstrated in [Numerai Examples](./numerai/examples/), if you're not sure how to use a Dockerfile, first copy an example with `numerai copy-example`, then read the documentation in the Dockerfile to learn the basics.
468
+
469
+ These files are very flexible, the default Dockerfile will just copy everything in whatever directory it is in, but this can be customized if you'd like to share code between models. For example, if you have a python project setup like so:
470
+
471
+ ```shell
472
+ numerai_models
473
+ ├── common
474
+ ├──── __init__.py
475
+ ├──── data.py
476
+ ├──── setup.py
477
+ ├── model_1
478
+ ├──── Dockerfile
479
+ ├──── .dockerignore
480
+ ├──── predict.py
481
+ ├──── requirements.txt
482
+ └──── train.py
483
+ ```
484
+
485
+ Where `common` is an installable python package you want to use in multiple models, you can add this line to model_1/Dockerfile: `RUN pip install ../common/`. Finally, run `numerai node deploy` from the `numerai_models` directory to install the package in the image, making it available to your model code.
486
+
487
+ If you want to learn more about how to customize this file [checkout the Dockerfile reference] (<https://docs.docker.com/engine/reference/builder/>).
488
+
489
+ ### Cloud Components
490
+
491
+ The CLI uses [Terraform](https://www.terraform.io/) to provision cloud resources. Each component and the related cloud resource(s) are listed below. The links will take you to the AWS console where you can monitor any of these resources for a given node; just visit the link and select the resource with the same name as the node you want to monitor (further directions are given for each resource below).
492
+
493
+ - `Trigger`: A small function that schedules a "task" on your `Compute Cluster`. This "task" handles pulling the image that was created by the `Dockerfile` and running it as a `Container` on your `Compute Cluster`. This is handled by two resources:
494
+
495
+ - **[API Gateway](https://console.aws.amazon.com/apigateway/main/apis)**:
496
+ Hosts the webhook (HTTP endpoint) that Numerai calls to trigger your nodes.
497
+ After clicking the link and selecting the resource, use the left sidebar to access metrics and logging.
498
+ - **[Lambda](https://console.aws.amazon.com/lambda/home#/functions)**:
499
+ Schedules your compute job when you call your Webhook URL.
500
+ After clicking the link and selecting the resource, use the "Monitor" tab below the "Function Overview" section.
501
+
502
+ - `Container`: The thing that actually contains and runs your code on a computer provisioned by the `Compute Cluster`. The `--size` (or `-s`) flag on the `numerai node config` sets the CPU and Memory limits for a `Container`. This is stored in one place:
503
+
504
+ - **[ECR (Elastic Container Repository)](https://console.aws.amazon.com/ecr/repositories)**:
505
+ Used for storing docker images. This is the location to which `numerai docker deploy` will push your image.
506
+ There is not much monitoring here, but you can view your images and when they were uploaded.
507
+
508
+ - `Compute Cluster`: A handler that accepts scheduled "tasks" and spins up and down computers to run `Containers`. This is handled by ECS:
509
+ - **[ECS (Elastic Container Service)](https://console.aws.amazon.com/ecs/home#/clusters)**:
510
+ This is where your containers will actually run and where you'll want to look if your containers don't seem to be scheduled/running.
511
+ After clicking the link, you'll be able to scroll and monitor the top-level metrics of each cluster.
512
+ After selecting a specific cluster, you can use the various tabs to view different components of the cluster (tasks are the runnable jobs
513
+ that the Lambda schedules, instances are the computers the tasks run on, and metrics will show cluster-wide information)
514
+
515
+ ## Special Thanks
516
+
517
+ - Thanks to [uuazed](https://github.com/uuazed) for their work on [numerapi](https://github.com/uuazed/numerapi)
518
+ - Thanks to [hellno](https://github.com/hellno) for starting the Signals [ticker map](https://github.com/hellno/numerai-signals-tickermap)
519
+ - Thanks to tit_BTCQASH ([numerai profile](https://numer.ai/tit_btcqash) and [twitter profile](https://twitter.com/tit_BTCQASH)) for debugging the environment setup process on Windows 8
520
+ - Thanks to [eses-wk](https://github.com/eses-wk) for implementing Azure support
@@ -76,7 +76,7 @@ To use this tool you need:
76
76
  - Windows 10 Command Prompt (windows key, type `cmd`, select Command Prompt):
77
77
 
78
78
  ```powershell
79
- powershell -command "$Script = Invoke-WebRequest 'https://raw.githubusercontent.com/numerai/numerai-cli/master/scripts/setup-win10.ps1'; $ScriptBlock = [ScriptBlock]::Create($Script.Content); Invoke-Command -ScriptBlock $ScriptBlock"
79
+ powershell -command "$Script = Invoke-WebRequest 'https://raw.githubusercontent.com/numerai/numerai-cli/master/scripts/setup-win10.ps1'; $ScriptBlock = [ScriptBlock]::Create($Script.Content); Invoke-Command criptBlock $ScriptBlock"
80
80
  ```
81
81
 
82
82
  4. After the setup script confirms Python and Docker, install `numerai-cli` via:
@@ -128,7 +128,7 @@ To use this tool you need:
128
128
  to list the vCPU/mem presets available, then you can configure a node to use one of the presets via:
129
129
 
130
130
  ```shell
131
- numerai node config -s mem-lg
131
+ numerai node config mem-lg
132
132
  ```
133
133
 
134
134
  Your compute node is now setup and ready to run! When you make changes to your code or re-train your model,
@@ -148,7 +148,7 @@ To use this tool you need:
148
148
  - The default example does _not_ make stake changes; please refer to the [numerapi docs](https://numerapi.readthedocs.io/en/latest/api/numerapi.html#module-numerapi.numerapi)
149
149
  for the methods you must call to do this.
150
150
  - You can view resources and logs in the AWS Console (region us-east-1) for your
151
- [ECS Cluster](https://console.aws.amazon.com/ecs/home?region=us-east-1#/clusters/numerai-submission-ecs-cluster/tasks)
151
+ [ECS Cluster](https://console.aws.amazon.com/ecs/home?region=us-east-1#/clusters/numeraiubmission-ecs-cluster/tasks)
152
152
  and [other resources](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups)
153
153
 
154
154
  ### List of Commands
@@ -168,12 +168,12 @@ requirements you'd use something like this (replacing [MODEL NAME] with the rele
168
168
  signals model name):
169
169
 
170
170
  ```shell
171
- numerai node -m [MODEL NAME] -s config -s mem-lg -e signals-python3
171
+ numerai node -m [MODEL NAME] -t 11 config -s mem-lg -e signals-python3
172
172
  ```
173
173
 
174
- Here, the `node` command takes a model name with `-m` and a flag `-s` to detect if it's
175
- a signals model or numerai model. The `config` sub-command also takes a `-s` option to
176
- specify the size of the node to configure.
174
+ Here, the `node` command takes a model name with `-m` and an argument `-t 11` to specify the tournament number
175
+ (numerai is tournament 8, signals is tournament 11, crypto is tournament 12).
176
+ The `config` sub-command also takes a `-s` option to specify the size of the node to configure.
177
177
 
178
178
  ### Upgrading
179
179
 
@@ -62,7 +62,7 @@ def destroy_all(ctx, verbose, preserve_node_config):
62
62
  verbose,
63
63
  provider,
64
64
  env_vars=provider_keys,
65
- inputs={"node_config_file": "nodes.json"},
65
+ inputs={"node_config_file": "../nodes.json"},
66
66
  )
67
67
 
68
68
  except Exception as e:
@@ -62,7 +62,7 @@ def destroy(ctx, preserve_node_config, verbose):
62
62
  verbose,
63
63
  provider,
64
64
  env_vars=provider_keys,
65
- inputs={"node_config_file": "nodes.json"},
65
+ inputs={"node_config_file": "../nodes.json"},
66
66
  )
67
67
 
68
68
  except Exception as e:
@@ -55,7 +55,7 @@ def uninstall():
55
55
  provider=provider,
56
56
  verbose=True,
57
57
  env_vars=provider_keys,
58
- inputs={"node_config_file": "nodes.json"},
58
+ inputs={"node_config_file": "../nodes.json"},
59
59
  )
60
60
 
61
61
  click.secho("cleaning up docker images...")
@@ -210,7 +210,7 @@ def upgrade(verbose):
210
210
  verbose,
211
211
  provider="aws",
212
212
  env_vars=load_or_init_keys("aws"),
213
- inputs={"node_config_file": "nodes.json"},
213
+ inputs={"node_config_file": "../nodes.json"},
214
214
  )
215
215
 
216
216
  click.secho("Upgrade complete!", fg="green")
@@ -151,6 +151,18 @@ def root_cause(std_out, err_msg):
151
151
  "mode: https://docs.docker.com/engine/security/rootless/"
152
152
  )
153
153
 
154
+ if (
155
+ "RepositoryAlreadyExistsException" in all_logs
156
+ or "EntityAlreadyExists" in all_logs
157
+ or "ResourceAlreadyExistsException" in all_logs
158
+ ):
159
+ raise exception_with_msg(
160
+ "AWS resources with the names this node expects already exist in your account, "
161
+ "but they are not tracked in the current local Terraform state. "
162
+ "This usually happens after a partial previous apply. "
163
+ "Delete or import the existing AWS resources shown above, then retry."
164
+ )
165
+
154
166
  # these are non-errors that either shouldn't be handled or are handled elsewhere
155
167
  if b"Can't update submission after deadline" in err_msg:
156
168
  return
@@ -69,7 +69,6 @@ def execute(command, verbose, censor_substr=None):
69
69
  shell=True,
70
70
  stdout=subprocess.PIPE,
71
71
  stderr=subprocess.PIPE,
72
- bufsize=1,
73
72
  close_fds=on_posix,
74
73
  )
75
74
  stdout_q = Queue()