[![Doodba deployment](https://img.shields.io/badge/deployment-doodba-informational)](https://github.com/Tecnativa/doodba) [![Last template update](https://img.shields.io/badge/last%20template%20update-v2.4.2-informational)](https://github.com/Tecnativa/doodba-copier-template/tree/v2.4.2) [![Odoo](https://img.shields.io/badge/odoo-v14.0-a3478a)](https://github.com/odoo/odoo/tree/14.0) [![AGPL-3.0-or-later license](https://img.shields.io/badge/license-AGPL--3.0--or--later-success})](LICENSE) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/) [Read the docs.](https://github.com/Tecnativa/doodba#scaffolding) # Myceliandre freezing There are a number of floating target that needs to be replaced to ensure as much as possible a rebuildable fixed target image. ## How do we freeze The fixing process will be conducted by an external script that will go through all moving targets to replace them with a fixed version. The fixing process could have involved running a docker build, and using the resulting image to fix and freeze things by modifying files in `odoo_base`. But, because some cleaning processes (removing of `.git` dir) are conducted, we choose to do part of it before (inspecting git sources, and fixing `repos.yaml` before hand). Other part of this process still are more simply done on the resulting image built by `pip` or `apt` because the full version dep graph is more easily queryiable on a resulting installation that buildable by inference. ## What is freezed This modify files everywhere and this will be pushed as a commit automatically with a tag -. The corresponding image should be easily found in `docker.0k.io` repository with same tag. When possible, the version will also be saved locally. ### original docker base Check if `FROM` is local (from docker.0k.io), otherwise we need to tag it and push it to `docker.0k.io`. tecnativa/doodba:12.0-onbuild once caught, execute a `docker pull MOVING_REF`, then tag and push on docker.0k.io, modify file in odoodba ### full git-aggregators track any refs that are branches. If repository has a branch, is not cloned in gittea, then clone it, create tag with current global tag (-), replace source URL, target in yaml file by tag. Keep in comments the actual original source and original targets. Needs to be checked on the checked image, on the repositories. ### Pip package A `pip freeze` need to be run to get all versions, and for easy diff, output a file that would be: ``` package1==version ... ## Unspecified deps packageA==version ``` ### apt packages Same here ``` ## gives all packages installed and their version dpkg-query -l | grep ^ii | awk '{print $2 "\t" $3}' ``` # We need to produce a meaningfull report of differences between versions The best would be to be able to use `git diff`. # Additional possibility for committing a new release we could flatten git history, and docker resulting incremental image (diffing exports of docker files). # Process ## freezing a completely new version ``` bin/freeze ``` That will be run on gitea automatically and pushed as a tagged version. But this is also doable from the dev computer. ## Making modification git co master # (unfreezed version) OR git clone -b BRANCH release/candidate/YYYMMDD-HHMMSS Make modif, commit. Gitea will automatically create a new: - release/candidate/YYYMMDD-HHMMSS branch ## Checking possible updates (optional) Identify locked entries, and go fetch update, allow to update. ## Updating Ask to update one of the links ## Troubleshooting ``` docker run -ti \ --env PLUGIN_SSH_KNOWN_HOSTS="$(ssh-keyscan -H -p 10022 git.0k.io 2>/dev/null)" \ --env PLUGIN_SSH_PRIVATE_KEY="$(cat ~/.ssh/ssh_myceliandre_mirror)" \ --env PLUGIN_DOCKER_CONFIG_JSON='{"auths": {"docker.0k.io": {"auth": "bWlycm9yOkh1bnZNSlpJMW9ra3VoSWs="}}}' \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /home/vaab/dev/docker/odoo_base:/tmp/odoo_base \ -w /tmp/odoo_base \ -v /home/vaab/dev/sh/0k-docker/src/bin/dupd:/usr/local/bin/dupd \ docker.0k.io/0k-mirror-freezer /bin/bash ```