docker-archive / deploykit

A toolkit for creating and managing declarative, self-healing infrastructure.
Apache License 2.0
2.25k stars 262 forks source link

Error no-plugin from Instance-aws #597

Closed ghost closed 7 years ago

ghost commented 7 years ago

Following the instructions for the intro playbook:

infrakit playbook add intro https://docker.github.io/infrakit/playbooks/intro/index.ikb

infrakit playbook intro start-infrakit

Infrakit image? [infrakit/devbundle:dev]:
Infrakit port for remote access? [24864]:
What's the name of the project? [testproject]:
Start AWS plugin? [no]: y
What's the profile for your .aws/credentials? [default]:
What's the region? [us-west-1]: us-east-1
What's the AWS plugin image? [infrakit/aws:dev]:
Start GCP plugin? [no]: n
Start HYPERKIT plugin? [no]:
Start Digital Ocean plugin? [no]:
Starting up infrakit base...  You can connect to it at infrakit -H localhost:24864
8339f6dfd2a9a0785087f560a611db0d53877c1eef035665071d682feb14ca7a
222062f36f3b3e8f4389f3e36b049bc9324c5ef4fa6e6516bfc35a745d61e936
28d26c2c2b0c3c2984f6d67bfe0e8a73da8c371a20bd8b66c1eabecd25734b64
cac7b75d6e89861acbc2de2be4eeee6e5b8237882c7d8e58cda899cf08da1030
8dc5b7a4900f9442183d9198da86445a718ab080a4cdfe26724e9a7fd6707969
18a94ec213924c4aa9ad83c3d894a83e3a8d93ccff55562c5993dc953d691801
56bd91fcdee0230800f20c7c6380763358a98ec33e3ed90ac76ef96d723d9018
Starting AWS plugin
0c598f9ea959126d81c9dc4f944df04ff020e4210ac21a7c00b9f49d081aeb44

Followed by: infrakit group commit aws-vanilla.json

where the JSON file was

{
  "ID": "aws-example",
  "Type":"instance-aws/ec2-instance",
  "Properties": {
    "Allocation": {
      "Size": 1
    },
    "Instance": {
      "Plugin": "instance-aws",
      "Properties": {
        "RunInstancesInput": {
          "ImageId": "ami-80861296",
          "InstanceType":"t2.micro",
          "KeyName": "secret",
          "Placement": {
            "AvailabilityZone": "us-east-1e"
          },
          "SecurityGroupIds": ["sg-dc6f38a0"],
          "SubnetId": "subnet-704dfc4c"
        },
        "Tags": {
          "Name": "infrakit-example"
        }
      }
    },
    "Flavor": {
      "Plugin": "flavor-vanilla",
      "Properties": {
        "Init": [
          "sh -c \"echo 'Hello, World!' > /hello\""
        ]
      }
    }
  }
}

Resulted in the follow log / error message:

time="2017-06-16T18:48:04Z" level=debug msg="Sending response HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: application/json; charset=utf-8\r\nX-Content-Type-Options: nosniff\r\n\r\n{\"jsonrpc\":\"2.0\",\"result\":{\"APIs\":[{\"Name\":\"Event\",\"Version\":\"0.1.0\"},{\"Name\":\"Instance\",\"Version\":\"0.5.0\"}]},\"id\":1941690318252646593}\n"
time="2017-06-16T18:48:04Z" level=debug msg="Received request POST / HTTP/1.1\r\nHost: h\r\nAccept-Encoding: gzip\r\nContent-Length: 355\r\nContent-Type: application/json\r\nUser-Agent: Go-http-client/1.1\r\n\r\n{\"jsonrpc\":\"2.0\",\"method\":\"Instance.Validate\",\"params\":{\"Type\":\"\",\"Properties\":{\"RunInstancesInput\":{\"ImageId\":\"ami-80861296\",\"InstanceType\":\"t2.micro\",\"KeyName\":\"secret\",\"Placement\":{\"AvailabilityZone\":\"us-east-1e\"},\"SecurityGroupIds\":[\"sg-dc6f38a0\"],\"SubnetId\":\"subnet-704dfc4c\"},\"Tags\":{\"Name\":\"infrakit-example\"}}},\"id\":6899107766006066763}"
time="2017-06-16T18:48:04Z" level=debug msg="Sending response HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: application/json; charset=utf-8\r\nX-Content-Type-Options: nosniff\r\n\r\n{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32000,\"message\":\"no-plugin:\",\"data\":null},\"id\":6899107766006066763}\n"

Running on an AWS instance:

docker --version
Docker version 17.05.0-ce, build 89658be

uname -a
Linux ip-10-50-1-104 4.4.0-1018-aws #27-Ubuntu SMP Fri May 19 17:20:58 UTC 2017 x86_64 x86_64 
x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

I am assuming I have missed something as the AWS plugin is probably used in your CloudFormation template. Any idea what I missed?

ghost commented 7 years ago

Answering my own question, the example JSON has the "Plugin" key as "aws-instance". I changed it to "aws-instance/ec2-instance" and it worked like a champ.