Giter Club home page Giter Club logo

Comments (22)

livenson avatar livenson commented on June 3, 2024

I think main block is missing in the script. Make sure you have something like:

if __name__ == "__main__":
    run()

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

I do have a main block:

def run():
    print("Hello World!")

if __name__ == "__main__":
    run()

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

But even with a main block i get the error, i only have a creation script defined for testing, bash scripts run fine.

from waldur-mastermind.

livenson avatar livenson commented on June 3, 2024

Are you executing in docker or in k8s?
Basically the code responsible for the execution is here - https://github.com/waldur/waldur-mastermind/blob/develop/src/waldur_mastermind/marketplace_script/utils.py#L42

As you can see, it simply runs a configured command within a configured container image with provided script saved as a file.
https://github.com/waldur/waldur-mastermind/blob/26ef55432e72bb158bfb72ba4f756b735ab973c1/src/waldur_core/core/metadata.py#L549C7-L549C7

Can you check if your script is launched in that way? you might get more insights as to what is not working

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

im using docker, dont quite understand what should i look for?

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

Il try setting the container to not be removed see what happens when i try to manualy run it

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024
image

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

it creates directory "/tmp/docker56h63i98" and mounts that in the container at
"/work/script"

Folder "/tmp/docker56h63i98" is blank and has no script in it.

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

Indeed the file thats passed to the container is not created.

For bash and python.

from waldur-mastermind.

livenson avatar livenson commented on June 3, 2024

Ok, then I guess the issue are the permissions in the folder where script is deployed.
https://docs.waldur.com/admin-guide/mastermind-configuration/configuration-guide/#docker_script_dir can be used to set it to something else.

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

I also had some permissions with docker socket anything I need to do like set a user ID on the containers?

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

Won’t this still happen if I change the script dir?

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

Dont see a bind mount for /work in the compose file does it need to be bound to the host?
image

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

guessing i need to pass /opt/waldur-script-launchzone as the custom dir?

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

Changing script dir does not make a difference :(

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

could you hint me in the direction of a supported OS / Distro for this and or best practices for installing?

Im fairly certain ive followed everything install wise but clearly something is incompatible or the setup by default in docker is not quite right.

I dont want to recompile it as root, any chance you have a host based setup that does not rely on docker as the docker compose does not seem production ready at this point.

from waldur-mastermind.

livenson avatar livenson commented on June 3, 2024

Well for sure it works on Ubuntu, OS X and Almalinux, that's where we have dev or supported environments, also in Docker-compose.

As a general comment, docker-compose is not really something we promote for production as it lack HA properties, but it should work in general. I will have more time tomorrow and will try to reproduce on Debian the issue.

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

Amazing, otherwise if you have a none docker none kubernetes prod option id be happy to change my course :)

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

Hey @livenson did you get a chance to look at it?

from waldur-mastermind.

livenson avatar livenson commented on June 3, 2024

Hi, I've managed to setup a Debian deployment and do the needed preparations, but then a priority bug was discovered in live in marketplace_remote and had to switch. Sorry for delay, I plan to finish debugging today in the evening or tomorrow.

from waldur-mastermind.

livenson avatar livenson commented on June 3, 2024

Pushed a fix to waldur-docker-compose so it would work out of the box.

https://github.com/waldur/waldur-docker-compose/blob/c555a350dc98eac1c65c770705c273706be28b5c/config/waldur-mastermind/override.conf.py#L7

Basically DOCKER_SCRIPT_DIR needs to be set to '/opt/waldur-script-launchzone' -- a folder mapped from host to a container. https://github.com/waldur/waldur-docker-compose/blob/c555a350dc98eac1c65c770705c273706be28b5c/docker-compose.yml#L33

from waldur-mastermind.

mattronix avatar mattronix commented on June 3, 2024

amazing! thank you !

from waldur-mastermind.

Related Issues (19)

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.