New Docker build configuration
Describe changes
This PR greatly increases the flexibility in which users can specify how ZenML builds the Docker image that is used to run their pipeline steps in remote orchestrators/step operators. Additionally, it reduces the code duplication of the Docker image building code that was found in many stack components by introducing a simple pydantic mixin PipelineDockerImageBuilder which all stack components can inherit from to easily build Docker images.
Pre-requisites
Please ensure you have done the following:
- [x] I have read the CONTRIBUTING.md document.
- [x] If my change requires a change to docs, I have updated the documentation accordingly.
- [ ] If I have added an integration, I have updated the integrations table and the corresponding website section.
- [x] I have added tests to cover my changes.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Other (add details above)
@stefannica, @safoinme, @bcdurak 1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.
@stefannica, @safoinme, @bcdurak 1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.
@stefannica, @safoinme, @bcdurak 1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.
@safoinme I'm assuming that by build argument in this case you mean adding an additional line to the generated Dockfile.
Here would be one potential solution how to do that:
MyModelDeployer(BaseModelDeployer, PipelineDockerImageBuilder):
@staticmethod
def _generate_zenml_pipeline_dockerfile(
parent_image: str,
docker_configuration: DockerConfiguration,
requirements_files: Sequence[str] = (),
entrypoint: Optional[str] = None,
) -> List[str]:
lines = PipelineDockerImageBuilder._generate_zenml_pipeline_dockerfile(parent_image, docker_configuration, requirements_files, entrypoint)
lines.append("EXPOSE 5000")
return lines