Getting Started with Computes
This page will help you get started with Computes. You'll be up and running in a jiffy!
1. Generate Keypair
This keypair will be used to authorize your Computes cluster.
Currently we support RSA
keys. A minimum key size of 2048 bits is required for RSA keys.
You may save the keypair wherever you'd like, the examples below provide a convenient default.
openssl genrsa -out ~/.config/computes/license.pem 2048
2. Upload Public Key
Visit https://admin.computes.com to add the public key to your account.
Private Keys are Private
Magic Leap will never ask you for your private key. If you upload your private key to another service, it will no longer be secret.
Here is an example of how to get the public key contents to upload.
openssl rsa -in ~/.config/computes/license.pem -outform PEM -pubout
Copy everything starting with and including -----BEGIN PUBLIC KEY-----
, up to and including -----END PUBLIC KEY-----
.
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxUjbsjuWoZ8oiYpFcrzh
11y1K87yUysjgw+87v2Qz1VBwsp4jugburAdTqec4vdAKUwlMrqrKgGf8COLOzQf
iJ38oT2BzOFIo6Ocg78BBagfMCbO3rRWAwz3GzHx1AKWrpJB5niWVhQAsbbuuFj+
nAPfEXLuE1LaU/RrNlMYTHFrV2JuCmD8dSkc+bkxooAcNQb0km0+tQLtKSoxjsAo
1qK5aOreKfRNbOb6l7aMV52v14Y3Hs4B6NQU64Gd0MpMia5and8b3V4+wlveg1TU
giRF49/ndjSyVLwhtzvJcT5iQE/UsYbli+quDoy+iHPD8MZ47hr59TQAJIZCCjgE
uwIDAQAB
-----END PUBLIC KEY-----
![Create_License_Key.png 2014](https://files.readme.io/88ae587-Create_License_Key.png)
3. Install IPFS
Download and install IPFS as a private network. Run the IPFS daemon with pubsub enabled.
ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub
4. Download the latest Computes release
Download the latest computes release.
5. Install Docker (optional)
Install Docker. Computes does not require docker, but we do support running Computes tasks in Docker containers.
6. Create a Whitelist
Using the permissive whitelist is easiest for getting started, but not recommended for production use. Save this JSON as whitelist.json and upload it to IPFS.
{
"runners": {
"bin-json-runner": {
"manifests": ["*"]
},
"docker-json-runner": {
"manifests": ["*"]
}
}
}
cat whitelist.json | ipfs dag put
> zdpuB3VESBQjvVmFaCcGWReNGeMzuMHErgmqpmAUAuQzMkjzR
7. Start Computes Daemon
(Please note that all computes-daemons in your cluster must use the same values for these parameters.)
Property | Description |
---|---|
COMPUTES_LICENSE_KEY | The private key you generated in step 1. |
COMPUTES_NAMESPACE | A random string that prevents collisions in public IPFS. Provide any value you'd like. |
COMPUTES_QUEUE_SEED | A random string that seeds the computes queue. This allows all daemons to generate the same IPFS hash to start the queue on. |
COMPUTES_WHITELIST | A whitelist of authorized binaries and/or docker images. |
env \
COMPUTES_LICENSE_KEY=licence-key \
COMPUTES_NAMESPACE=namespace \
COMPUTES_QUEUE_SEED=example-queue \
COMPUTES_WHITELIST=zdpuB3VESBQjvVmFaCcGWReNGeMzuMHErgmqpmAUAuQzMkjzR \
computes-daemon run
8. Try running a Task
Check the Simple Task
Updated almost 6 years ago