Coder Social home page Coder Social logo

Comments (6)

raffaeleguidi avatar raffaeleguidi commented on July 26, 2024

nope, I added the python deps with apt-get into the running container and restarted it. Managed to get a python stack trace, though:

Traceback (most recent call last):
File "/var/lib/rundeck/libext/cache/rancher-plugin/container_resource_model.py", line 35, in
api_res_environment = requests.get(api_url_environment, auth=api_auth).json()
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 850, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
File "/var/lib/rundeck/libext/cache/rancher-plugin/container_resource_model.py", line 35, in
api_res_environment = requests.get(api_url_environment, auth=api_auth).json()
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 850, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")

from rundeck-rancher.

DamienMure avatar DamienMure commented on July 26, 2024

Hi.
Thank for using this module.
Can you tell me your rancher version (and API version) please ?

Did you try the plugin outside rundeck ?
Using "scripts/test_container_resource_model.sh", you can check the link with rancher from a simple bash.
Can you try using the test script and send me:

  • console output
  • your value for: RD_NODE_RANCHER_URL
  • your value for : RD_CONFIG_ENVIRONMENTS_IDS
    Don't forget to add the api version in the rancher URL (like: https://rancher.com/v1)

Are you able to reach "http://yourrancher.com/v1/projects/" using a simple
curl like :
curl -X GET \ https://yourrancher.com/v1/projects/ -H 'accept: application/json' -H 'authorization: Basic XXXXXXX=='
You need to replace XXXXXX== by the base64 encoding of "RANCHER_ACCES_KEY" concatenated with "RANCHER_SECRET_KEY" using a ":" (a colon) as separator.

Regards.
(I won't be here the next week)

from rundeck-rancher.

raffaeleguidi avatar raffaeleguidi commented on July 26, 2024

Are you able to reach "http://yourrancher.com/v1/projects/" using a simple
curl

yes, I tried from inside the container and use the api with other applications (jenkins) on the same server

Did you try the plugin outside rundeck ?
scripts/test_container_resource_model.sh"

where exactly the file is located?

from rundeck-rancher.

raffaeleguidi avatar raffaeleguidi commented on July 26, 2024

ok, found the file but I have to modify it to adapt to my environment. Gimme some minutes

Rancher is v1.6.3

from rundeck-rancher.

raffaeleguidi avatar raffaeleguidi commented on July 26, 2024

I can confirm that, adapting the script to run from the docker host and putting the correct values into the environment variables, everything works fine and it returns the list of my containers - but I still have to figure out how to launch the .sh from within the container. Where are the python scripts located in the installed version?

from rundeck-rancher.

raffaeleguidi avatar raffaeleguidi commented on July 26, 2024

got it! the url was wrong, I edited your examples and the url contained a "home" that mislead me. Now It works fine, I just suggest some more logging to improve investigations in case of configuration mistakes.

Thanks a lot,
Raffaele

from rundeck-rancher.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.