Git Product home page Git Product logo

Comments (6)

moxious avatar moxious commented on August 16, 2024

Another example of the sort of thing you run into at deployment container run-time. The error is clear and straightforward, it's just easier to catch earlier in the cycle.

May 9, 2018, 10:27:55 AM | config_helper.InvalidSchema: Property authEnabled has a default value of invalid type
-- | --
deployer | May 9, 2018, 10:27:55 AM | format(name))
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 116, in __init__
deployer | May 9, 2018, 10:27:55 AM | for k, v in dictionary.get('properties', {}).iteritems()
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 79, in <dictcomp>
deployer | May 9, 2018, 10:27:55 AM | for k, v in dictionary.get('properties', {}).iteritems()
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 79, in __init__
deployer | May 9, 2018, 10:27:55 AM | return Schema(d)
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 69, in load_yaml_file
deployer | May 9, 2018, 10:27:55 AM | args.schema_file_encoding)
deployer | May 9, 2018, 10:27:55 AM | File "/bin/expand_config.py", line 60, in main
deployer | May 9, 2018, 10:27:55 AM | main()
deployer | May 9, 2018, 10:27:55 AM | File "/bin/expand_config.py", line 123, in <module>
deployer | May 9, 2018, 10:27:55 AM | Traceback (most recent call last):
deployer | May 9, 2018, 10:27:55 AM | + /bin/expand_config.py

from marketplace-k8s-app-tools.

huyhg avatar huyhg commented on August 16, 2024

We actually wanted to do this, and thought about using ONBUILD. Unfortunately ONBUILD commands run right at FROM time.

Do you know of a way to have commands that run at the end of the inherited Dockerfile commands?

from marketplace-k8s-app-tools.

moxious avatar moxious commented on August 16, 2024

My thoughts were more basic. In the example, you have a Makefile that is dependent on all of these resources and that builds the Docker image. Seems the validation step happens in the Makefile maybe, reusing existing scripts you'd provide in tools, and the docker image doesn't get built at all (and the build fails) if schema validation doesn't happen.

I happen to use the Makefile, but even if someone else chose a different build setup, at least they'd see a validation example of how it's done, which they could adapt to whatever setup.

from marketplace-k8s-app-tools.

huyhg avatar huyhg commented on August 16, 2024

If we don't have a way to do it directly in the Dockerfile, totally agree that your proposal is the next best option.

We will look into adding that to the make targets. Thanks!

from marketplace-k8s-app-tools.

moxious avatar moxious commented on August 16, 2024

A way to do this in dockerfile would be possibly:

  • COPY schema.yaml /tmp
  • RUN validate.py schema.yaml > validated_schema.yaml
  • RUN cp validated_schema.yaml /data/schema.yaml

If validation fails, the copy fails, and I get a message saying I'm missing a validated schema. Then you just need the guarantee that "validate.py" behaves to parse and re-dump the same content on validity. Or something like that.

from marketplace-k8s-app-tools.

huyhg avatar huyhg commented on August 16, 2024

That makes sense too. The only caveat is that it the creator of the inheriting Dockerfile has to add these commands. The nice thing about something like ONBUILD is that they would automatically inherit this (except it doesn't work as we wanted ;) ).

I think we will add this to both Makefile and Dockerfile. Useful for the user to pick whatever suitable for them.

from marketplace-k8s-app-tools.

Related Issues (20)

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.