Decouple different cloud providers' requirements/dependencies
Now, for Wellbore DMS there is a single requirements.in
file for all cloud providers. It works well unless cloud-specific libraries depend on the same third-parties with different versions; so, there is a problem with executing pip-compile requirements.in
.
Example:
There are incompatible versions in the resolved dependencies:
osdu-api~=0.15.0.dev (from osdu-core-lib-python-anthos==1.0.1->-r requirements.in (line 44))
osdu-api==0.14.0 (from osdu-core-lib-python-aws==1.0.1->-r requirements.in (line 43))
In the example above this error is possible to fix by synchronizing osdu-api
library, however, a similar issue with the same third-parties can occur in cloud SDKs, so, we are not able to fix them that easily.
As a solution I can propose splitting building Wellbore DMS image into two steps:
- Build a base image with the basic requirements installed.
- Build separate images with cloud specific requirements and dependencies based on the previous one.
The working example of such two-step-builds is implemented here. Firstly, we build the base image, and then the providers build their own images based on the previous one (e.g., GCP).