I had to create a custom model DockerDeployerNetwork because there was no "network" model in the Docker SDK for Python that resembled what docker.APIClient.create_network expects. There is docker.types.NetworkingConfig, docker.types.NetworkAttachmentConfig, and docker.models.networks.Network, but they don't directly match what the input for docker.APIClient.create_network is, nor what the networks section of Docker Compose expects.
And of course, I created a WorkspaceDockerDeployer model too, to describe the type of the deployers field in Workspace. I could've added workflow-pipelines as a dependency, and then just use DockerDeployer, but the fields were slightly different (e.g. client, secrets, deploy_wait_time, deploy_max_replicas, and some Union on most fields' types because they differ before/after validator transformations).
Though if we feel it's better to import workflow-pipelines, we can maybe(?) make it work by making some changes in DockerDeployer through a PR in workflow-pipelines.
Closes #59
I had to create a custom model
DockerDeployerNetwork
because there was no "network" model in the Docker SDK for Python that resembled whatdocker.APIClient.create_network
expects. There isdocker.types.NetworkingConfig
,docker.types.NetworkAttachmentConfig
, anddocker.models.networks.Network
, but they don't directly match what the input fordocker.APIClient.create_network
is, nor what thenetworks
section of Docker Compose expects.And of course, I created a
WorkspaceDockerDeployer
model too, to describe the type of thedeployers
field inWorkspace
. I could've addedworkflow-pipelines
as a dependency, and then just useDockerDeployer
, but the fields were slightly different (e.g.client
,secrets
,deploy_wait_time
,deploy_max_replicas
, and someUnion
on most fields' types because they differ before/after validator transformations).Though if we feel it's better to import
workflow-pipelines
, we can maybe(?) make it work by making some changes inDockerDeployer
through a PR inworkflow-pipelines
.