-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from chainguard-dev/paulgibert/more-python
Fixed a few python test samples
- Loading branch information
Showing
4 changed files
with
319 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package: | ||
name: az-2.62.0-r0 | ||
version: 2.62.0 | ||
epoch: 0 | ||
description: Azure CLI | ||
copyright: | ||
- license: MIT | ||
environment: | ||
contents: | ||
packages: | ||
- build-base | ||
- busybox | ||
- ca-certificates-bundle | ||
- py3.11-pip | ||
- python-3.11 | ||
- python-3.11-dev | ||
pipeline: | ||
- uses: git-checkout | ||
with: | ||
repository: https://github.com/paulgibert/azure-cli | ||
expected-commit: 297101dfa88827df48b2717dfec3757431dc1fb9 | ||
- runs: | | ||
exit 1 | ||
- name: Python Build | ||
runs: 'pip install wheel | ||
cd src/azure-cli | ||
python setup.py bdist_wheel | ||
cd ../azure-cli-core | ||
python setup.py bdist_wheel | ||
' | ||
- runs: '# Setup the virtualenv | ||
python -m venv .venv | ||
# Bump pip to patch a CVE | ||
#.venv/bin/pip install --upgrade pip==23.3.2 | ||
' | ||
- runs: '.venv/bin/pip install --no-compile src/azure-cli/dist/*.whl src/azure-cli-core/dist/*.whl | ||
' | ||
- runs: 'mkdir -p ${{targets.destdir}}/usr/share/az | ||
# Remove pip | ||
exit 1 | ||
rm -rf .venv/lib/python3.11/site-packages/pip | ||
rm -rf .venv/lib/python3.11/site-packages/pip-* | ||
mv .venv ${{targets.destdir}}/usr/share/az/ | ||
# edit the venv paths | ||
sed -i "s|/home/build|/usr/share/az|g" ${{targets.destdir}}/usr/share/az/.venv/bin/* | ||
' | ||
- runs: 'mkdir -p ${{targets.destdir}}/usr/bin | ||
ln -s /usr/share/az/.venv/bin/az ${{targets.destdir}}/usr/bin/az | ||
' | ||
- uses: strip | ||
test: | ||
pipeline: | ||
- runs: 'az --version | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# Generated from https://pypi.org/project/cassandra-medusa/ | ||
package: | ||
name: py3-cassandra-medusa | ||
version: 0.22.3 | ||
epoch: 0 | ||
description: Apache Cassandra backup and restore tool | ||
copyright: | ||
- license: Apache-2.0 | ||
options: | ||
no-provides: true | ||
no-depends: true | ||
dependencies: | ||
runtime: | ||
- poetry | ||
- python-3.11-base | ||
|
||
environment: | ||
contents: | ||
packages: | ||
- build-base | ||
- busybox | ||
- ca-certificates-bundle | ||
- py3.11-installer | ||
- py3.11-pip | ||
- python-3.11 | ||
- python-3.11-dev | ||
- wolfi-base | ||
|
||
pipeline: | ||
- uses: git-checkout | ||
with: | ||
repository: https://github.com/thelastpickle/cassandra-medusa | ||
tag: v${{package.version}} | ||
expected-commit: 6202aca6e4c2859d2ad601571571a774df7bebc8 | ||
|
||
- name: Python Build | ||
runs: | | ||
pip install wheel | ||
pip install poetry==1.8.5 | ||
poetry add "dnspython==2.6.1" | ||
poetry add "pyOpenSSL@^24.0.0" | ||
poetry run pip freeze | grep -v cassandra-medusa > requirements.txt | ||
POETRY_VIRTUALENVS_IN_PROJECT=true poetry install | ||
poetry build | ||
- runs: | | ||
# Setup the virtualenv | ||
python -m venv .venv --system-site-packages | ||
# Bump pip to patch a CVE | ||
.venv/bin/pip install --upgrade pip==24.0 setuptools==70.0.0 | ||
- runs: | | ||
.venv/bin/pip install -I -r requirements.txt --no-compile | ||
.venv/bin/pip install -I --no-compile dist/*.whl | ||
- runs: | | ||
# python-snappy is required to run medusa using $MEDUSA_MODE=GRPC. | ||
.venv/bin/pip install -I python-snappy --no-compile | ||
- runs: | | ||
# Remove pip | ||
rm -rf .venv/lib/python3.11/site-packages/pip | ||
rm -rf .venv/lib/python3.11/site-pacakges/pip-* | ||
mkdir -p ${{targets.destdir}}/home/cassandra | ||
mv .venv ${{targets.destdir}}/home/cassandra/ | ||
# edit the venv paths | ||
sed -i "s|/home/build|${{targets.destdir}}/home/cassandra|g" ${{targets.destdir}}/home/cassandra/.venv/bin/* | ||
# allow site-packages | ||
sed -i "s|include-system-site-packages = false|include-system-site-packages = true|g" ${{targets.destdir}}/home/cassandra/.venv/pyvenv.cfg | ||
- runs: | | ||
mkdir -p ${{targets.destdir}}/usr/bin | ||
cp k8s/medusa.sh ${{targets.destdir}}/usr/bin/medusa | ||
chmod +x ${{targets.destdir}}/usr/bin/medusa | ||
- runs: | | ||
cp pyproject.toml ${{targets.destdir}}/home/cassandra | ||
cp k8s/docker-entrypoint.sh ${{targets.destdir}}/home/cassandra | ||
chmod +x ${{targets.destdir}}/home/cassandra/docker-entrypoint.sh | ||
subpackages: | ||
- name: "${{package.name}}-compat" | ||
description: "Compatibility package to place binaries and docker entrypoints in the location expected by upstream helm charts" | ||
dependencies: | ||
runtime: | ||
# The entrypoint script fails to start without bash and sleep (which comes from busybox) | ||
- bash | ||
- busybox | ||
pipeline: | ||
- runs: | | ||
mkdir -p "${{targets.subpkgdir}}/home/cassandra/" | ||
ln -sf /usr/bin/medusa ${{targets.subpkgdir}}/home/cassandra/medusa | ||
# Symlink the binary from usr/bin to /bin | ||
mkdir -p "${{targets.subpkgdir}}"/bin | ||
ln -sf /usr/bin/grpc-health-probe ${{targets.subpkgdir}}/bin/grpc_health_probe | ||
update: | ||
enabled: true | ||
github: | ||
identifier: thelastpickle/cassandra-medusa | ||
strip-prefix: v | ||
|
||
test: | ||
environment: | ||
contents: | ||
packages: | ||
- python-3.11 | ||
- python-3.11-dev | ||
- grpc-health-probe | ||
pipeline: | ||
- runs: medusa --version | ||
- runs: | | ||
set +e | ||
fail() { echo "$@" 1>&2; exit 1; } | ||
out=$(/home/cassandra/.venv/bin/python3 -m medusa.service.grpc.server 2>&1) | ||
status=$? | ||
echo "$out" | grep -q '/etc/medusa/medusa.ini' || fail "medusa.service.grpc.server output did not contain expected 'medusa.ini' message. Exit status $status: $out" | ||
echo "medusa.service.grpc.server exited with expected error message" |
Oops, something went wrong.