Conversation
a5b199b to
73bb946
Compare
|
Nice to see moby API as a dedicated module, so we don't get transitive dependencies from engine inside Compose ! ❤️ |
| @@ -0,0 +1,89 @@ | |||
| // Package urlutil provides helper function to check if a given build-context | |||
There was a problem hiding this comment.
Added this fork temporarily; didn't realise compose itself also uses it (not only through cli); the CLI fork is "internal", so probably needs to made public, or we keep a fork here 😞
|
Remaining uses of docker/docker; |
|
Build failure looks like it may be an incompatible change in buildx itself? |
|
OK, it's because buildx depends on an unreleased version of BuildKit, so go modules considers it to be older than the latest release and won't update; https://github.com/docker/buildx/blob/3f4bf829d8c5b92a8f670609417d9aa4c0b6be98/go.mod#L32 |
83ca48f to
13827c4
Compare
|
|
Yes, or at least the type; the utilities could be "client" - those packages are messy. Also looking at things that are in the api, but shouldn't (api/types/plugins/logdriver) |
|
Also included a (WIP) branch for docker/cli#6202 Before/After; DetailsBefore: After: |
d2146d4 to
3a7124d
Compare
3b1ec4c to
6cd56af
Compare
|
Down to two packages; both possibly candidates for CLI still needs sorting out; Details |
6cd56af to
8925b9c
Compare
d7c329f to
04ac165
Compare
083a7c9 to
cb07967
Compare
| // filter out useless commandConn.CloseWrite warning message that can occur | ||
| // when using a remote context that is unreachable: "commandConn.CloseWrite: commandconn: failed to wait: signal: killed" | ||
| // https://github.com/docker/cli/blob/e1f24d3c93df6752d3c27c8d61d18260f141310c/cli/connhelper/commandconn/commandconn.go#L203-L215 | ||
| logrus.AddHook(logutil.NewFilter([]logrus.Level{ |
| text = jm.Progress.String() | ||
| // FIXME(thaJeztah): what's the replacement for Progress.String()? | ||
| // text = jm.Progress.String() |
There was a problem hiding this comment.
This one probably still needs to be looked into.
There was a problem hiding this comment.
@ndeloof looks like the data is used in different fields for toPushProgressEvent than in toPullProgressEvent - slightly confused which data should go in which field;
In toPullProgressEvent, we set the Details field, and Text is set to jm.Status, but in toPushEvent, we don't use the Details field;
-func toPullProgressEvent(parent string, jm jsonstream.Message, events api.EventProcessor) {
- if jm.ID == "" || jm.Progress == nil {
+func toPushProgressEvent(prefix string, jm jsonstream.Message, events api.EventProcessor) {
+ if jm.ID == "" {
+ // skipped
return
}
-
var (
- details string
+ text string
+ status = api.Working
total int64
- percent int
current int64
- status = api.Working
+ percent int
)
-
- switch jm.Status {
- case PreparingPhase, WaitingPhase, PullingFsPhase:
- percent = 0
- case DownloadingPhase, ExtractingPhase, VerifyingChecksumPhase:
- if jm.Progress != nil {
+ if isDone(jm) {
+ status = api.Done
+ percent = 100
+ }
+ if jm.Error != nil {
+ status = api.Error
+ text = jm.Error.Message
+ }
+ if jm.Progress != nil {
+ // FIXME(thaJeztah): what's the replacement for Progress.String()?
+ // text = jm.Progress.String()
+ if jm.Progress.Total != 0 {
current = jm.Progress.Current
total = jm.Progress.Total
if jm.Progress.Total > 0 {
@@ -436,32 +161,25 @@ func toPullProgressEvent(parent string, jm jsonstream.Message, events api.EventP
}
}
}
- case DownloadCompletePhase, AlreadyExistsPhase, PullCompletePhase:
- status = api.Done
- percent = 100
- }
-
- if strings.Contains(jm.Status, "Image is up to date") ||
- strings.Contains(jm.Status, "Downloaded newer image") {
- status = api.Done
- percent = 100
- }
-
- if jm.Error != nil {
- status = api.Error
- details = jm.Error.Message
- } else {
- details = units.HumanSize(float64(jm.Progress.Current))
}
events.On(api.Resource{
+ ParentID: prefix,
ID: jm.ID,
- ParentID: parent,
+ Text: text,
+ Status: status,
Current: current,
Total: total,
Percent: percent,
- Status: status,
- Text: jm.Status,
- Details: details,
})
}
pkg/compose/pull.go
Outdated
| progress = jm.Progress.String() | ||
| // FIXME(thaJeztah): what's the replacement for Progress.String()? | ||
| // progress = jm.Progress.String() |
ce597b5 to
8797fa0
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
8797fa0 to
b6784a8
Compare
b6784a8 to
3dbbaa6
Compare
| func TestDefaultNetworkSettings(t *testing.T) { | ||
| t.Run("returns the network with the highest priority when service has multiple networks", func(t *testing.T) { | ||
| t.Skip("FIXME: test is failing (but for legacy API versions?)") | ||
| service := composetypes.ServiceConfig{ |
There was a problem hiding this comment.
I put this as a separate commit, but this test can probably be removed, as I for legacy API versions ("1.43"), which the client no longer supports; https://github.com/moby/moby/blob/client/v0.2.2/client/client.go#L112-L114
There was a problem hiding this comment.
I forgot what the exact failure was, so temporarily enabled it again;
=== Failed
=== FAIL: pkg/compose TestDefaultNetworkSettings/returns_the_network_with_the_highest_priority_when_service_has_multiple_networks (0.00s)
create_test.go:225: assertion failed: expected map[myProject_myNetwork1:%!s(*network.EndpointSettings=&{0xc00017efa0 [] [myProject-myService-1 myService] map[] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} [] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} 0 []}) myProject_myNetwork2:%!s(*network.EndpointSettings=&{0xc00017ef50 [] [myProject-myService-1 myService] map[] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} [] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} 0 []})] (length 2) to have length 1
--- FAIL: TestDefaultNetworkSettings/returns_the_network_with_the_highest_priority_when_service_has_multiple_networks (0.00s)
=== FAIL: pkg/compose TestDefaultNetworkSettings (0.00s)
So it expects a single network, but returns 2?
create_test.go:225: assertion failed: expected
map[
myProject_myNetwork1: %!s(*network.EndpointSettings=&{0xc00017efa0 [] [myProject-myService-1 myService] map[] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} [] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} 0 []})
myProject_myNetwork2: %!s(*network.EndpointSettings=&{0xc00017ef50 [] [myProject-myService-1 myService] map[] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} [] 0 {{0 0} {<nil>}} {{0 0} {<nil>}} 0 []})
]
(length 2) to have length 1
There was a problem hiding this comment.
Ah, right, yes, indeed: that's code that was only ran on API < 1.44, but that conditional code is removed, so it will no longer return a single network (which was because older daemons didn't support that);
Lines 523 to 539 in af0029a
3dbbaa6 to
8bf3cdc
Compare
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1a7e8e8 to
6510727
Compare
Test that the network with the highest priority is returned as "primary" network, and other networks as extra networks. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
…ture Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- use an intermediate serviceNetworks slice so that we don't have to call service.NetworksByPriority multiple times. - shift the primary network from the slice (if any), so that we can drop some checks for "additional networks" - group code related to setting up the primary network as first step, then append remaining networks. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
6510727 to
fae6d96
Compare
… render individual layers Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Format layer progress details with minimal efforts as new UI does not render individual layers
What I did
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did