3.4 KiB
To iteratively add/fix requirements:
Add more dependencies to requirements.in
, then:
pip-compile --allow-unsafe --strip-extras requirements.in -o requirements.txt
If it passes, you can run cachito_hash.sh
to fix the sha256sums.
Try to install everything in requirements.txt
:
rm -rf pyvenv.cfg lib* bin/*
virtualenv .; . bin/activate
pip install -r requirements.txt
If it fails, repeat previous step to add more dependencies requirements.in
and repeat.
Now, set up BUILD requirements, see https://github.com/containerbuildsystem/cachito/blob/master/docs/pip.md#build-dependencies to get pip_find_builddeps.py
, then run:
rm -fr /tmp/pip_find_builddeps.py*
pip_find_builddeps.py requirements.txt -o requirements-build.in --append --no-cache
Review the contents of requirements-build.in
to remove dupes. Then regenerate requirements-build.txt
pip-compile --allow-unsafe --strip-extras requirements-build.in -o requirements-build.txt
If it passes, you can run cachito_hash.sh
to fix the sha256sums.
Finally, MAKE SURE YOU OVERRIDE what's in the .txt files to add in the cachito_hash values, as pip-compile will remove them. This can be done by running cachito_hash.sh
.
mkdocs-techdocs-core @ https://github.com/backstage/mkdocs-techdocs-core/archive/bbdab44e0d3aecfdc4e77b14c72b57791d4902b2.zip#cachito_hash=sha256:40421a5f43b11fd9ea9f92e107f91089b6bfa326967ad497666ab5a451fcf136
plantuml-markdown @ https://github.com/mikitex70/plantuml-markdown/archive/17d348bfaa9112cdd2130e6410ce3a50224db3cf.zip#cachito_hash=sha256:221cc4972c75ba911cad4a56df07f61771c20077f8cbc8966181e30cabf68de1
To test in a container build in Brew, using something like:
pip3.11 install --user --no-cache-dir -r requirements.txt -r requirements-build.txt
- commit changes to midstream (gitlab) repo, in a specific branch like add-pip-deps
- collect the latest SHA for that branch
- create a topic branch in https://pkgs.devel.redhat.com/cgit/containers/rhdh-hub
- copy the above SHA into the container.yaml for the remote_source.ref values. For example: https://pkgs.devel.redhat.com/cgit/containers/rhdh-hub/commit/?h=private-nboldt-cachito-pip&id=dd6db447ee228be14f9de2c940b5e3efee4890e9
- run a scratch build and wait for results.
- review cachito and build logs to see what happened.
If the build fails, add more dependencies to the requirements file, and try again.
When the build passes, commit changes to midstream and downstream, and trigger sync to cause a downstream build to verify your changes.
Note that some files are transformed between up/mid/downstream, so you may have to apply changes in more than one file.
-
Upstream:
docker/Dockerfile
(upstream) and.rhdh/docker/Dockerfile
(mid + downstream) -
Midstream:
distgit/containers/rhdh-hub/.rhdh/docker/Dockerfile
is transformed todistgit/containers/rhdh-hub/Dockerfile.in
via sync.sh -
Downstream:
Dockerfile.in
becomesDockerfile
automatically, injecting the product version fromgcp_env/product_version