cloudbender 0.23.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. cloudbender-0.23.0/.flake8 +3 -0
  2. cloudbender-0.23.0/.gitattributes +1 -0
  3. cloudbender-0.23.0/.gitignore +63 -0
  4. cloudbender-0.23.0/.justfile +8 -0
  5. cloudbender-0.23.0/CHANGES.md +152 -0
  6. cloudbender-0.23.0/Dockerfile +56 -0
  7. cloudbender-0.23.0/Jenkinsfile +5 -0
  8. cloudbender-0.23.0/LICENSE.md +651 -0
  9. cloudbender-0.23.0/PKG-INFO +144 -0
  10. cloudbender-0.23.0/README.md +109 -0
  11. cloudbender-0.23.0/cloudbender/__init__.py +20 -0
  12. cloudbender-0.23.0/cloudbender/_version.py +24 -0
  13. cloudbender-0.23.0/cloudbender/cli.py +523 -0
  14. cloudbender-0.23.0/cloudbender/connection.py +95 -0
  15. cloudbender-0.23.0/cloudbender/core.py +136 -0
  16. cloudbender-0.23.0/cloudbender/exceptions.py +18 -0
  17. cloudbender-0.23.0/cloudbender/hooks.py +47 -0
  18. cloudbender-0.23.0/cloudbender/jinja.py +283 -0
  19. cloudbender-0.23.0/cloudbender/pulumi.py +210 -0
  20. cloudbender-0.23.0/cloudbender/stack.py +1376 -0
  21. cloudbender-0.23.0/cloudbender/stackgroup.py +201 -0
  22. cloudbender-0.23.0/cloudbender/templates/__init__.py +0 -0
  23. cloudbender-0.23.0/cloudbender/templates/outputs.yaml +6 -0
  24. cloudbender-0.23.0/cloudbender/templates/stack-doc.md +38 -0
  25. cloudbender-0.23.0/cloudbender/utils.py +117 -0
  26. cloudbender-0.23.0/cloudbender.png +3 -0
  27. cloudbender-0.23.0/conf/containers.conf +14 -0
  28. cloudbender-0.23.0/conf/registries.conf +2 -0
  29. cloudbender-0.23.0/conf/storage.conf +2 -0
  30. cloudbender-0.23.0/pyproject.toml +64 -0
  31. cloudbender-0.23.0/renovate.json +13 -0
  32. cloudbender-0.23.0/tests/__init__.py +0 -0
  33. cloudbender-0.23.0/tests/test_utils.py +14 -0
  34. cloudbender-0.23.0/uv.lock +1296 -0
@@ -0,0 +1,3 @@
1
+ [flake8]
2
+ extend-ignore = E501
3
+ exclude = .git,__pycache__,build,dist,report,.venv
@@ -0,0 +1 @@
1
+ *.png filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,63 @@
1
+ # Vim
2
+ *.swp
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ env/
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ .pytest*
46
+ nosetests.xml
47
+ coverage.xml
48
+ *,cover
49
+ .hypothesis/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # dotenv
56
+ .env
57
+
58
+ # virtualenv
59
+ .venv/
60
+ ENV/
61
+
62
+ cloudbender/_version.py
63
+ .ci
@@ -0,0 +1,8 @@
1
+ import '.ci/python.just'
2
+
3
+ # container image tasks
4
+ mod container '.ci/container.just'
5
+
6
+ toolchain := "python"
7
+
8
+ default: build
@@ -0,0 +1,152 @@
1
+ # Changelog
2
+
3
+ ## 0.10.2
4
+ - Optionally skip all `sops` operations when `DISABLE_SOPS` environment variable it set
5
+
6
+ ## 0.10.1
7
+ - First official release supporting for Pulumi stacks
8
+ - Dockerfile and Alpine based public images provided incl. Pulumi binaries and podman for docker tasks
9
+
10
+ ## 0.9.9
11
+ - Add workaround for inconsistent AWS API S3 GetBucketLocation
12
+ - validate now exits with non-zero exit code if valiation of any template failed
13
+ - the embedded md5 hash in templates are now verified reading the template
14
+
15
+ ## 0.9.8
16
+ - Remove support for FortyTwo legacy mode as AWS now behaves as it should
17
+ - Add support for embedded custom output yaml format and removed hardcoded kubezero output template
18
+
19
+ ## 0.9.7
20
+ - CloudBender now requires Python >= 3.7
21
+ - drop oyaml requirement
22
+ - support for short intrinsic functions like !Ref, !Sub etc. by ignoring custom constructors before sending them to AWS to resolve
23
+
24
+ ## 0.9.6
25
+ - only upload templates if render is successful
26
+ - support for jinja user-data
27
+ - tweak for kubezero output template
28
+
29
+ ## 0.9.5
30
+ ### New Features
31
+ Support for uploading and retrieving rendered templates from S3!
32
+
33
+ Enabled by setting `template_bucket_url` to a valid S3 location: ```s3://<bucket_name>[/<prefix>]```
34
+ Templates will still be stored and updated in the local file system to allow tracking via git.
35
+
36
+ ## 0.9.4
37
+ - new option to generate Dot Graph files via `--graph` option for the create-docs command
38
+ - fix validate command using latest cfn-lint library
39
+
40
+ ## 0.9.3
41
+ - Improved bash minify for user-data
42
+ - Unused additional parameters are now printed as a warning to catch potential typos early
43
+
44
+ ## 0.9.2
45
+ - Bug fix release only
46
+
47
+ ## 0.9.1
48
+ - Added explicitly set parameter values to the create-doc markdown to get complete stack picture
49
+
50
+ ## 0.9.0
51
+ New Features:
52
+
53
+ - *Hooks* can now be defined as artifact metadata and are executed at the specified step.
54
+ Current supported hook entrypoints are: `pre_create, pre_update, post_create, post_update`
55
+
56
+ Current implemented hooks:
57
+
58
+ - *cmd*: Allows arbritary commands via subprocess
59
+ - *export_outputs_kubezero*: writes the outputs of kubernetes stacks into a format to be included by KubeZero
60
+
61
+ - Stack outputs are now written into a yaml file under `outputs` if enabled. Enabled via `options.StoreOutputs`
62
+ *create-docs* now includes latest stack output values if an output file is found
63
+ - Removed deprecated support for storing parameters as these can be constructed any time from existing and tracked configs
64
+
65
+ - some code cleanups and minor changes for cli outputs
66
+
67
+ ## 0.8.4
68
+ - New Feature: `create-docs` command
69
+ Renders a markdown documentation next to the rendered stack templated by parsing parameters and other relvant metadata
70
+
71
+ ## 0.8.2
72
+ - Bug fix release to allow empty stack configs again
73
+
74
+ ## 0.8.1
75
+ - Work around for bug in Go AWS SDK to pick up cli credentials, see https://github.com/aws/aws-sdk-go/issues/934
76
+
77
+ ## 0.8.0
78
+ - Added support for sops encrypted config files, see: https://github.com/mozilla/sops
79
+ - hide stack parameter output in terminal if `NoEcho` is set
80
+ - *CloudBender no longer writes stack parameter files to prevent leaking secret values !*
81
+ These files were never actually used anyways and there sole purpose was to track changes via git.
82
+
83
+ ## 0.7.8
84
+ - Add new function `outputs`, to query already deployed stack for their outputs
85
+
86
+ ## 0.7.7
87
+ - Add support for CLOUDBENDER_PROJECT_ROOT env variable to specify your root project
88
+ - Switch most os.path operations to pathlib to fix various corner cases caused by string matching
89
+
90
+ ## 0.7.6
91
+ - Added warning if rendered templates exceed max. inline size of 51200 bytes
92
+ - Added optional removal of comments during include_raw processing to reduce user-data size
93
+
94
+ ## 0.7.4
95
+ - Fix for only Iterate in use
96
+
97
+ ## 0.7.3
98
+ - Added support for variables within config files, incl. usual inheritance
99
+ - Set Legacy to False by default, requires templates to check for False explicitly, allows to enabled/disable per stack
100
+
101
+ ## 0.7.2
102
+ - Add line numbers to easy debugging
103
+ - Fix tests
104
+
105
+ ## 0.7.1
106
+ - Release emergency bugfix, 0.7.0 broke recursive option parsing
107
+
108
+ ## 0.7.0
109
+ - Add support for SNS Notifcations to Cloudformation create and update operations
110
+ - Refactored recursive handling of options withing stack groups
111
+
112
+ ## 0.6.2
113
+ - Fixed custom root directory to allow automated template tests
114
+
115
+ ## 0.6.1
116
+ - Add support for onfailure for create stack, defaults to DELETE
117
+
118
+ ## 0.6.0
119
+ - Implemented Piped mode again
120
+ Allows all stack references to be supplied via injected parameters
121
+ Tries to automatically resolve injected paramteres by inspecting matching outputs from othe running stacks at provision time
122
+ - minor bugfixing
123
+
124
+ ## 0.5.2
125
+ - Remove tox dependency during build
126
+ - Introduce drone.io support
127
+ - Makefile cleanup
128
+
129
+ ## 0.5.1
130
+ - Automatic dependency resolution to artifacts referred to by StackRef or FortyTwo
131
+
132
+ ## 0.5.0
133
+ - new custom Jinja function `sub`, works the same as re.sub
134
+ - added possibility to use custom Jinja function `inline_yaml` to set data as yaml
135
+ - disabled SilentUndefined
136
+ - added Jinja2 extension `do` and `loopcontrols`
137
+ - new custom Jinja function `option` to access options at render time incl. default support for nested objects
138
+ - removed custom Jinja functions around old remote Ref handling
139
+
140
+ ## 0.4.2
141
+ - silence warnings by latest PyYaml 5.1
142
+
143
+ ## 0.4.1
144
+ - add *sync* command combining *render* and *provision* into one task
145
+ - make cb (boolean) available in Jinja context to allow easy toggle for features relying on cloudbender in templates
146
+
147
+ ## 0.4.0
148
+ - support for environment variables in any config file
149
+ Example: `profile: {{ env.AWS_DEFAULT_PROFILE }}`
150
+ - support for jinja `{% do %}` extension
151
+ - support for inline yaml style complex data definitions, via custom jinja filter `yaml`
152
+ - missing variables now cause warnings, but rendering continues with ''
@@ -0,0 +1,56 @@
1
+ FROM alpine:3.23
2
+
3
+ ARG USER=cloudbender
4
+
5
+ # trades about 300MB container size for 5s more startup latency
6
+ # ENV PYTHONDONTWRITEBYTECODE=1
7
+
8
+ RUN ALPINE_VERSION=$(. /etc/os-release && echo "$VERSION_ID" | cut -d. -f1,2) && \
9
+ cd /etc/apk/keys && \
10
+ wget "https://cdn.zero-downtime.net/alpine/stefan@zero-downtime.net-61bb6bfb.rsa.pub" && \
11
+ echo "@kubezero https://cdn.zero-downtime.net/alpine/v${ALPINE_VERSION}/kubezero" >> /etc/apk/repositories && \
12
+ apk upgrade -U -a --no-cache && \
13
+ apk add --no-cache \
14
+ ca-certificates \
15
+ podman \
16
+ passt \
17
+ py3-boto3 \
18
+ aws-cli \
19
+ pulumi@kubezero \
20
+ pulumi-language-python@kubezero
21
+
22
+ ADD dist /dist
23
+
24
+ RUN python3 -m venv venv && \
25
+ . /venv/bin/activate && \
26
+ pip install --no-cache-dir dist/cloudbender-*.whl
27
+
28
+ # Dont run as root by default
29
+ RUN addgroup $USER && adduser $USER -G $USER -D && \
30
+ mkdir -p /home/$USER/.local/share/containers && \
31
+ chown $USER:$USER -R /home/$USER
32
+
33
+ # Rootless podman
34
+ RUN mkdir -p /home/$USER/.config/containers
35
+
36
+ ADD --chown=$USER:$USER conf/containers.conf conf/registries.conf conf/storage.conf /home/$USER/.config/containers
37
+
38
+ RUN echo -e "$USER:1:999\n$USER:1001:64535" > /etc/subuid && \
39
+ echo -e "$USER:1:999\n$USER:1001:64535" > /etc/subgid && \
40
+ cd /usr/bin && ln -s podman docker && \
41
+ chown $USER:$USER -R /home/$USER
42
+
43
+ WORKDIR /workspace
44
+
45
+ ENV _CONTAINERS_USERNS_CONFIGURED=""
46
+
47
+ ENV VIRTUAL_ENV=/venv
48
+ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
49
+ ENV PULUMI_SKIP_UPDATE_CHECK=true
50
+
51
+ USER $USER
52
+
53
+ # Allow container layers to be stored in PVCs
54
+ VOLUME /home/$USER/.local/share/containers
55
+
56
+ CMD ["cloudbender"]
@@ -0,0 +1,5 @@
1
+ library identifier: 'zdt-lib@main', retriever: modernSCM(
2
+ [$class: 'GitSCMSource',
3
+ remote: 'https://git.zero-downtime.net/ZeroDownTime/ci-tools-lib.git'])
4
+
5
+ justContainer(needBuilder: true, scanFail: false)