-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpy3-cassandra-medusa-0.21.0-r3.yaml
140 lines (90 loc) · 3.15 KB
/
py3-cassandra-medusa-0.21.0-r3.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package:
name: py3-cassandra-medusa-0.21.0-r3
version: 0.21.0
epoch: 100
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: ba543db3a2be5e5781de3280fb7c0343861a2d96
- name: Python Build
runs: 'pip install wheel
pip install poetry==1.8.5
poetry add "aiohttp==3.9.4"
poetry add "dnspython==2.6.1"
poetry add "idna==3.7"
# CVE-2024-35195: requests
poetry add "requests@^2.23.0"
# GHSA-m5vv-6r4h-3vj9: azure-identity
poetry add "azure-identity==1.16.1"
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==65.5.1
'
- 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: '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:
- 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