Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Compose in go #919

Merged
merged 16 commits into from
Nov 17, 2020
Merged

Compose in go #919

merged 16 commits into from
Nov 17, 2020

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Nov 17, 2020

What I did
Implemented compose for local backend
this is not feature-complete and is missing e2e coverage, but we'd like to avoid long-running branches

Related issue
docker/roadmap#15

(not mandatory) A picture of a cute animal, if possible in relation with what you did
image

@github-actions github-actions bot added the ecs label Nov 17, 2020
@ndeloof ndeloof added local Local context (moby) and removed ecs labels Nov 17, 2020
Signed-off-by: Nicolas De Loof <[email protected]>
@github-actions github-actions bot added the ecs label Nov 17, 2020
@@ -144,7 +145,10 @@ func (cs *containerService) Run(ctx context.Context, r containers.ContainerConfi
}

func (cs *containerService) create(ctx context.Context, containerConfig *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, name string) (string, error) {
created, err := cs.apiClient.ContainerCreate(ctx, containerConfig, hostConfig, networkingConfig, name)
created, err := cs.apiClient.ContainerCreate(ctx, containerConfig, hostConfig, networkingConfig, &v1.Platform{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cause error 1.41 is too new. Maximum supported API version is 1.40 on CI and on my Linux box :'(

}

for _, service := range project.Services {
err := s.applyPullPolicy(ctx, service)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we do this in parallel?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure we can, I wonder there's any reason parallel_pull is set to False on docker/compose (https://github.com/docker/compose/blob/854c003359bd07d0d3ca137d7a08509cfeab0436/compose/project.py#L724)
Engine will download layers in parallel anyway
This whole thing will need to be revisited anyway with addition of build support (by importing some code from bake)

gtardif and others added 2 commits November 17, 2020 15:13
…first container logs for every container)

Signed-off-by: Guillaume Tardif <[email protected]>
Copy link
Contributor

@gtardif gtardif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consts for compose labels could be a nice quick fix, I fixed a bug in logs... We could continue improving a lot of things but I'd rather merge this quickly and do follow up PRs, seems already plenty of features. (Will certainly need tests ta validate the many possible scenarios)

local/compose.go Outdated Show resolved Hide resolved
local/compose.go Outdated Show resolved Hide resolved
Signed-off-by: Nicolas De Loof <[email protected]>
@ndeloof ndeloof merged commit bbcf445 into main Nov 17, 2020
@ndeloof ndeloof deleted the compose-in-go branch November 17, 2020 15:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ecs local Local context (moby)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants