PBMS Docker
Information regarding PBMS odoo and background task docker images and their creation
Concepts
Dockers are created via GitHub workflows by triggering them manually. Dockers may be created from the command line as well. The docker images for PBMS Odoo and Background Tasks (API, Celery Beat Producer, and Celery Worker) are created independent of each other.
The contents of the Docker are listed in a package file available in the openg2p-pbms-docker repo. This package file is read by the docker-build-odoo.yml workflow for odoo and docker-build-bg-tasks.yml workflow for background tasks. These workflows create the Docker Images and push them to the Docker Hub.
For odoo, the name and tag of the Docker are specified as the first line in the package file followed by the base version of the Odoo that is used to create the Docker. See example below.
#!openg2p/openg2p-pbms-core:3.0.0
#!17.0-20250807
# OCA dependencies
oca = git://v1.0.4//https://github.com/openg2p/openg2p-pbms-community-addons
# OpenG2P developed modules
openg2p_commons = git://v1.4.0//https://github.com/OpenG2P/openg2p-odoo-commons
openg2p_pbms = git://v3.0.0//https://github.com/openg2p/openg2p-pbms-odoo
openg2p_pbms_extensions = git://v3.0.0//https://github.com/openg2p/openg2p-pbms-odoo-extensions For background tasks, separate package files are provided for the API, Celery Beat, and Celery Worker services. The Docker image name and tag are defined on the second line of each file, followed by the Dockerfile reference used to build the image. Any additional dependencies required can be listed at the end of the file. See the example API packaging below.
# bg-task-api.txt
#!openg2p/openg2p-pbms-bg-task-api:3.0.0
#!openg2p-pbms-bg-tasks/Dockerfile.api
#!.
git+https://github.com/openg2p/[email protected]#subdirectory=openg2p-bg-task-registry-adaptersThe package may contain private repositories, in which case, the token to clone the repositories must be set in the GitHub secret.
Versions of all repositories that are used to create the Docker are specified in the package file. For Dockers that are "frozen" it is assumed that all versions of repositories are frozen as well (i.e., tagged).
Steps to create PBMS Docker
Creating tokens to clone private repositories
This procedure only applies if repositories in your Docker package are private. Otherwise, skip to the next step.
Create a new token for OpenG2P Bot user and add it to the private repo with the name
OPENG2P_BOT_GITHUB_PAT. This token must have read permissions to the repositoryTo create this token you will have to log in to Github as OpenG2P Bot user.
Give Write permission to OpenG2P Bot user on Github (under Settings --> Collaborators and Teams).
Tagging the repositories
Run the "Tag the repo" (
tag.yml) workflow using Github Actions. Make sureOpenG2PBotuser on Github has 'Write' permission to the repository. The workflow checks if there are any changes w.r.t. to the previous version specified. If there are no changes the workflow fails with a message and a new tag is not created.
Creating Docker Packages
Docker package for Odoo
Create a package file for the new version that you want to create. See example. The name of the package file can be arbitrary but it is recommended that it reflects the Docker tag version. E.g.
3.0.0.txt.IMPORTANT: Update the first line in the package file to the new version. (This is critical otherwise previous tag will get overwritten on Docker Hub.)
Inspect the contents of the package file on which versions of repositories need to be packed in this Docker.
Make sure the repositories are tagged with the versions matching in the package file. See above section on tagging.
Trigger
OpenG2P PBMS Odoo Dockersaction using the Github Actions. Provide the correct branch and above file path as input w.r.t topackagesfolder.Verify that the new Docker has been pushed on Docker Hub.
Automatic build and upload of private Dockers
Refer to the guide: Automatic Build and Upload of Private Dockers
Last updated
Was this helpful?

