hyperhq/hyperd

Creating container with link via hyper REST API is not working

zero88 opened this issue · 1 comments

I used selenium hub and node in latest version.

  • Firstly starting selenium hub
    dab53e13d222 selenium/hub "/opt/bin/entry_point" 4 minutes ago Up 4 minutes 0.0.0.0:4445->4444/tcp selenium-hub

  • Then I run selenium node via REST API with parameters as below

{'content-type': 'application/json', 'x-hyper-date': '20171211T093453Z'}
{'Image': 'selenium/node-firefox', 'Labels': {'sh_hyper_instancetype': 'M2'}, 'Hostname': 'firefox-ba1c22ddd1', 'Env': ['SE_OPTS=-id firefox-ba1c22ddd1', 'NODE_APPLICATION_NAME=firefox-ba1c22ddd1'], 'HostConfig': {'Links': ['selenium-hub:hub']}}
https://us-west-1.hyper.sh/v1.23/containers/create?name=firefox-ba1c22ddd1
201
{
  "Id": "3752f92070b0ff3eb4cbcd8a575eb5248473ca71abe1da044d1534c1fab68d17",
  "Warnings": []
}
3752f92070b0ff3eb4cbcd8a575eb5248473ca71abe1da044d1534c1fab68d17
  • But when checking result, selenium node cannot start:
hyper start firefox-ba1c22ddd1 && hyper logs firefox-ba1c22ddd1
firefox-ba1c22ddd1
Not linked with a running Hub container
  • When using hyper cli, selenium node run successfully.
hyper run -d  --link selenium-hub:hub -e SE_OPTS="-id firefox-ba1c22ddd1" -e NODE_APPLICATION_NAME=firefox-ba1c22ddd1 --name firefox-123 selenium/node-firefox
84eda34e58486e33c15ed7fe4f762e5eead331ca5a3b8726f395f37f5aabc881

84eda34e5848        selenium/node-firefox          "/opt/bin/entry_point"   23 seconds ago      Up 17 seconds           firefox-123
  • Inspected 2 containers, one from using REST API, one from using CLI
    cli.log
    rest.log

  • I used Docker REST API with this mechanism without no problem.

Any luck for my case
Thanks,
Son

@Zero-88 I checked the server code and suspect it is related with some client code. Which language SDK are you working with?

PS: this repo is not the hyper.sh server code, and it is the open source local runtime daemon repo. And I suggest you submit a topic in the hyper.sh forum , or slack ; or file issue in the API repo if you are using the official golang SDK.