Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit be20fdc

Browse files
iciclespiderPatrick J. McNerthney
authored andcommitted
Initial commit
0 parents  commit be20fdc

File tree

97 files changed

+4556
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+4556
-0
lines changed

.gitignore

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Emacs
2+
*~
3+
4+
# Byte-compiled / optimized / DLL files
5+
__pycache__/
6+
*.py[codz]
7+
*$py.class
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
share/python-wheels/
27+
*.egg-info/
28+
.installed.cfg
29+
*.egg
30+
MANIFEST
31+
32+
# PyInstaller
33+
# Usually these files are written by a python script from a template
34+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
35+
*.manifest
36+
*.spec
37+
38+
# Installer logs
39+
pip-log.txt
40+
pip-delete-this-directory.txt
41+
42+
# Unit test / coverage reports
43+
htmlcov/
44+
.tox/
45+
.nox/
46+
.coverage
47+
.coverage.*
48+
.cache
49+
nosetests.xml
50+
coverage.xml
51+
*.cover
52+
*.py.cover
53+
.hypothesis/
54+
.pytest_cache/
55+
cover/
56+
57+
# Translations
58+
*.mo
59+
*.pot
60+
61+
# Django stuff:
62+
*.log
63+
local_settings.py
64+
db.sqlite3
65+
db.sqlite3-journal
66+
67+
# Flask stuff:
68+
instance/
69+
.webassets-cache
70+
71+
# Scrapy stuff:
72+
.scrapy
73+
74+
# Sphinx documentation
75+
docs/_build/
76+
77+
# PyBuilder
78+
.pybuilder/
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
# For a library or package, you might want to ignore these files since the code is
90+
# intended to run in multiple environments; otherwise, check them in:
91+
# .python-version
92+
93+
# pipenv
94+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
96+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
97+
# install all needed dependencies.
98+
#Pipfile.lock
99+
100+
# UV
101+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
102+
# This is especially recommended for binary packages to ensure reproducibility, and is more
103+
# commonly ignored for libraries.
104+
#uv.lock
105+
106+
# poetry
107+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108+
# This is especially recommended for binary packages to ensure reproducibility, and is more
109+
# commonly ignored for libraries.
110+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111+
#poetry.lock
112+
#poetry.toml
113+
114+
# pdm
115+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
116+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
117+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
118+
#pdm.lock
119+
#pdm.toml
120+
.pdm-python
121+
.pdm-build/
122+
123+
# pixi
124+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
125+
#pixi.lock
126+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
127+
# in the .venv directory. It is recommended not to include this directory in version control.
128+
.pixi
129+
130+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
131+
__pypackages__/
132+
133+
# Celery stuff
134+
celerybeat-schedule
135+
celerybeat.pid
136+
137+
# SageMath parsed files
138+
*.sage.py
139+
140+
# Environments
141+
.env
142+
.envrc
143+
.venv
144+
env/
145+
venv/
146+
ENV/
147+
env.bak/
148+
venv.bak/
149+
150+
# Spyder project settings
151+
.spyderproject
152+
.spyproject
153+
154+
# Rope project settings
155+
.ropeproject
156+
157+
# mkdocs documentation
158+
/site
159+
160+
# mypy
161+
.mypy_cache/
162+
.dmypy.json
163+
dmypy.json
164+
165+
# Pyre type checker
166+
.pyre/
167+
168+
# pytype static type analyzer
169+
.pytype/
170+
171+
# Cython debug symbols
172+
cython_debug/
173+
174+
# PyCharm
175+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
176+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
177+
# and can be added to the global gitignore or merged into this file. For a more nuclear
178+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
179+
#.idea/
180+
181+
# Abstra
182+
# Abstra is an AI-powered process automation framework.
183+
# Ignore directories containing user credentials, local state, and settings.
184+
# Learn more at https://abstra.io/docs
185+
.abstra/
186+
187+
# Visual Studio Code
188+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
189+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
190+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
191+
# you could uncomment the following to ignore the entire vscode folder
192+
# .vscode/
193+
194+
# Ruff stuff:
195+
.ruff_cache/
196+
197+
# PyPI configuration file
198+
.pypirc
199+
200+
# Cursor
201+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
202+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
203+
# refer to https://docs.cursor.com/context/ignore-files
204+
.cursorignore
205+
.cursorindexingignore
206+
207+
# Marimo
208+
marimo/_static/
209+
marimo/_lsp/
210+
__marimo__/

CloudOps.groovy

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
cloudops.dockerImage {
2+
3+
container {
4+
name 'podman'
5+
image 'quay.io/podman/stable:latest'
6+
requests {
7+
cpu '1'
8+
memory '4Gi'
9+
}
10+
root true
11+
privileged true
12+
}
13+
14+
build { context ->
15+
def arches = ['amd64', 'arm64']
16+
arches.each { arch ->
17+
container('podman') {
18+
sh "podman build --platform=linux/$arch --tag=$arch ."
19+
sh "podman image save --format docker-archive localhost/$arch --output image.$arch"
20+
}
21+
sh "crossplane xpkg build --package-root=package --embed-runtime-image-tarball=image.$arch --package-file=xpkg.$arch"
22+
}
23+
sh "crossplane xpkg push --package-files=${arches.collect{"xpkg.$it"}.join(',')} $context.INTERIM_IMAGE"
24+
}
25+
}

Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# It's important that this is Debian 12 to match the distroless image.
4+
FROM debian:12-slim AS build
5+
6+
#RUN --mount=type=cache,target=/var/lib/apt/lists \
7+
# --mount=type=cache,target=/var/cache/apt \
8+
RUN \
9+
rm -f /etc/apt/apt.conf.d/docker-clean \
10+
&& apt-get update \
11+
&& apt-get install --no-install-recommends --yes python3-venv git
12+
13+
# Don't write .pyc bytecode files. These speed up imports when the program is
14+
# loaded. There's no point doing that in a container where they'll never be
15+
# persisted across restarts.
16+
ENV PYTHONDONTWRITEBYTECODE=true
17+
18+
# Use Hatch to build a wheel. The build stage must do this in a venv because
19+
# Debian doesn't have a hatch package, and it won't let you install one globally
20+
# using pip.
21+
WORKDIR /build
22+
#RUN --mount=target=. \
23+
# --mount=type=cache,target=/root/.cache/pip \
24+
COPY . /build
25+
RUN \
26+
python3 -m venv /venv/build \
27+
&& /venv/build/bin/pip install hatch \
28+
&& /venv/build/bin/hatch build -t wheel /whl
29+
30+
# Create a fresh venv and install only the function wheel into it.
31+
#RUN --mount=type=cache,target=/root/.cache/pip \
32+
RUN \
33+
python3 -m venv /venv/fn \
34+
&& /venv/fn/bin/pip install /whl/*.whl
35+
36+
# Copy the function venv to our runtime stage. It's important that the path be
37+
# the same as in the build stage, to avoid shebang paths and symlinks breaking.
38+
FROM gcr.io/distroless/python3-debian12 AS image
39+
WORKDIR /
40+
USER nonroot:nonroot
41+
COPY --from=build --chown=nonroot:nonroot /venv/fn /venv/fn
42+
EXPOSE 9443
43+
ENTRYPOINT ["/venv/fn/bin/function"]

0 commit comments

Comments
 (0)