Giter Club home page Giter Club logo

kube-render's People

Contributors

andrewsmedina avatar danielfm avatar dependabot[bot] avatar felipemsantana avatar gabrielpjordao avatar leogamas avatar mardoqueu-pimentel avatar robsonpeixoto avatar ygormutti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rjansen guidiego

kube-render's Issues

[Improvement] Multiple Templates Sources

Resume

Problem: What happens if I want to use multiple templates sources?
Reply: I can't
Solution: Make -u and -t be the same command as --template-source and add multiple of them behavior an alias or priority declaration (we regex it for identify if it's a git path or local path

Development Cases

  • Alias approach
    • I could use -t or --template-source multiple times passing alias source_path something like: -t kube-templates ssh:github....
  • Priority declaration
    • The last templates that I declare override the previous -t ssh:// or t /users/....

Combo x2

with #15

  • Alias approach
    • Default dir will always be loaded into default. alias
  • Priority declaration
    • We could always load default dir and override using next declarations

with #16

Alias approach could improve user experience if he wants to use multiple templates like:
-p default.deployment local.service something.hpa

[Improvement] Simplify Interations

Resume

I think that improve docs and change something on command interface could improve a lot of experience with kube-render, but here some tips that could help :)

Merge -u and -t

Basically, we could identify if it is a github or local path, more improvement tips here (#17)

Remove -w

Once that we have -c to add yml context files we don't need to specify a "workdir", we could only pass a full path on -c and it's easier.

Main call

If you give a kube-render it throws an error, we could only call --help instead.

[Improvement] Default template folder

Resume

Problem: What happens if I don't provide a -t or -u?
Reply: Errors haha
Solution: Get templates from a default folder (set by the user using an env-var like DEFAULT_KUBE_RENDER_TEMPLATE_DIR)

Cases

  • Local usage
    • I have a kube-templates' clone on my machine
    • I don't want / I forgot to use -u or -t
    • I want to set this repo as my "default" folder and simplify my compilation
  • Cloudbuild usage
    • I want to use kube-render image to deploy my app
    • I want to make it fastier (without clone templates or configure git keys)
    • We could add kube-templates as submodules / default folder on it and make it easy
  • Override case
    • I had some templates but I want to use some default one's
    • I could load it and complete with a second folder using -t or -u

It's brooking with python 3.10

We're experiencing failures on builds on images (for example, ubuntu) with python 3.10.

The output could be seen below:

2022-11-23T17:45:06.1240888Z Defaulting to user installation because normal site-packages is not writeable
2022-11-23T17:45:06.9680677Z Collecting kuberender
2022-11-23T17:45:07.0755784Z   Downloading kuberender-0.3.6.tar.gz (5.7 kB)
2022-11-23T17:45:07.0829849Z   Preparing metadata (setup.py): started
2022-11-23T17:45:08.3557812Z   Preparing metadata (setup.py): finished with status 'done'
2022-11-23T17:45:08.3937555Z Collecting Jinja2==2.9.6
2022-11-23T17:45:08.4046276Z   Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340 kB)
2022-11-23T17:45:08.4681899Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 340.7/340.7 KB 6.0 MB/s eta 0:00:00
2022-11-23T17:45:08.5690042Z Collecting MarkupSafe==1.1.1
2022-11-23T17:45:08.5779650Z   Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
2022-11-23T17:45:08.5859576Z   Preparing metadata (setup.py): started
2022-11-23T17:45:08.7421951Z   Preparing metadata (setup.py): finished with status 'done'
2022-11-23T17:45:08.8095910Z Collecting PyYAML==5.1
2022-11-23T17:45:08.8192631Z   Downloading PyYAML-5.1.tar.gz (274 kB)
2022-11-23T17:45:08.8473941Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 274.2/274.2 KB 10.3 MB/s eta 0:00:00
2022-11-23T17:45:08.9406165Z   Preparing metadata (setup.py): started
2022-11-23T17:45:09.1383262Z   Preparing metadata (setup.py): finished with status 'done'
2022-11-23T17:45:09.1733720Z Collecting click==6.7
2022-11-23T17:45:09.1815550Z   Downloading click-6.7-py2.py3-none-any.whl (71 kB)
2022-11-23T17:45:09.1911915Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.2/71.2 KB 8.6 MB/s eta 0:00:00
2022-11-23T17:45:09.2156245Z Collecting dpath==1.4.0
2022-11-23T17:45:09.2320908Z   Downloading dpath-1.4.0.tar.gz (13 kB)
2022-11-23T17:45:09.2385978Z   Preparing metadata (setup.py): started
2022-11-23T17:45:09.4499000Z   Preparing metadata (setup.py): finished with status 'error'
2022-11-23T17:45:09.4558651Z   error: subprocess-exited-with-error
2022-11-23T17:45:09.4559170Z   
2022-11-23T17:45:09.4559801Z   × python setup.py egg_info did not run successfully.
2022-11-23T17:45:09.4560382Z   │ exit code: 1
2022-11-23T17:45:09.4560895Z   ╰─> [12 lines of output]
2022-11-23T17:45:09.4561387Z       Traceback (most recent call last):
2022-11-23T17:45:09.4561909Z         File "<string>", line 2, in <module>
2022-11-23T17:45:09.4562542Z         File "<pip-setuptools-caller>", line 34, in <module>
2022-11-23T17:45:09.4563944Z         File "/tmp/pip-install-zoukdvi7/dpath_eadffa1845b0445692e407f3c2cfafb8/setup.py", line 2, in <module>
2022-11-23T17:45:09.4564779Z           import dpath.version
2022-11-23T17:45:09.4565633Z         File "/tmp/pip-install-zoukdvi7/dpath_eadffa1845b0445692e407f3c2cfafb8/dpath/__init__.py", line 13, in <module>
2022-11-23T17:45:09.4566430Z           from .util import *
2022-11-23T17:45:09.4567252Z         File "/tmp/pip-install-zoukdvi7/dpath_eadffa1845b0445692e407f3c2cfafb8/dpath/util.py", line 1, in <module>
2022-11-23T17:45:09.4567906Z           import dpath.path
2022-11-23T17:45:09.4568706Z         File "/tmp/pip-install-zoukdvi7/dpath_eadffa1845b0445692e407f3c2cfafb8/dpath/path.py", line 9, in <module>
2022-11-23T17:45:09.4569450Z           from collections import MutableSequence, MutableMapping
2022-11-23T17:45:09.4570359Z       ImportError: cannot import name 'MutableSequence' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
2022-11-23T17:45:09.4571021Z       [end of output]
2022-11-23T17:45:09.4571455Z   

[Improvement] Pipeline Style

Problems:

  • Today we look all template-dir or template-url and compile all files (includes macro's one)
  • Today we didn't have a logical sequence between compilation and if one day we need to make some complex compile or have files that depend on another file we can't throw exceptions or make nothing related to it.
  • Our templates need to have tons of logic to prevent errors about missing params to ignore a template that doesn't fulfill the requirements

Solution:

  • I want to add a -p / --pipe to kube-render this will allow user to send me what files they want to compile in a sequence
  • When I ask for a file and this one couldn't be rendered for any reason I want to throw it.
  • Improve kube-template adding docs

Usage

kube-render -t xxxx -c xxxx -p deployment service --verbose --apply

urlparse missing in deps

Just trying this tool as I was about to write the same thing (or very similar).

Noticed straight away that its missing one of the deps:

(kube-render) ➜  example git:(master) kube-render -h
Traceback (most recent call last):
  File "/Users/pfiddes/PythonProjects/kube-render/bin/kube-render", line 7, in <module>
    from kuberender import cli_render
  File "/Users/pfiddes/PythonProjects/kube-render/lib/python3.6/site-packages/kuberender/__init__.py", line 1, in <module>
    from kuberender import render
  File "/Users/pfiddes/PythonProjects/kube-render/lib/python3.6/site-packages/kuberender/render.py", line 12, in <module>
    from .utils import load_yaml_file, make_template_path, merge_dicts
  File "/Users/pfiddes/PythonProjects/kube-render/lib/python3.6/site-packages/kuberender/utils.py", line 2, in <module>
    from urlparse import urlparse
ModuleNotFoundError: No module named 'urlparse'

(kube-render) ➜  example git:(master) pip3 list
Package    Version
---------- -------
click      6.7
dpath      1.4.0
Jinja2     2.9.6
kuberender 0.2.7
libvcs     0.2.3
MarkupSafe 1.0
pip        9.0.1
PyYAML     3.12
setuptools 38.4.0
wheel      0.30.0

(kube-render) ➜  kube-render git:(master) grep -nr 'urlparse' *
kuberender/utils.py:2:from urlparse import urlparse
kuberender/utils.py:41:    parse_result = urlparse(repo_url)

(kube-render) ➜  kube-render git:(master) pip search urlparse
bfurlparser (1.0.3)     - A blazing fast Python URL parser
giturlparse.py (0.0.5)  - A Git URL parsing module (supports parsing and rewriting)
murl (0.5.1)            - murl is a tiny wrapper for the Python module urlparse.
uritools (2.1.0)        - RFC 3986 compliant, Unicode-aware, scheme-agnostic replacement for urlparse
urlparse2 (1.1.1)       - urlparse for humans.
urlparse3 (1.1)         - urlparse3 is simple and powerful url parsing tool
urlparse4 (0.1.3)       - Performance-focused replacement for Python's urlparse module

(kube-render) ➜  kube-render git:(master) pip3 install urlparse
Collecting urlparse
  Could not find a version that satisfies the requirement urlparse (from versions: )
No matching distribution found for urlparse

As its not available as simply urlparse, is there any chance you can update to pull in the correct dependency when installed from pip3?

Or I got it running (for now) by changing this to:

from urllib.parse import urlparse

Using python3 and clean virtualenv:

(kube-render) ➜  kube-render git:(master) python3 --version
Python 3.6.4

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.