Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to use a custom progress printer for the build progress output #11624

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5fb0b24
add an option to use a custom progress printer for the build progress
rarguelloF Feb 6, 2024
76b720f
Fix canonical container name
jhrotko Jan 30, 2024
d6a8116
ci(deps): replace buildkit to fix fsutil issues on Windows (#11426)
crazy-max Jan 30, 2024
eab44a3
chore(e2e): fix flaky test & standalone behavior (#11382)
milas Jan 30, 2024
c41f3a9
Fix load .env from project directory when project file is set by COMP…
ndeloof Jan 25, 2024
a34a367
build(deps): bump github.com/docker/cli
dependabot[bot] Feb 1, 2024
0a1f22d
CI: docker engine version matrix
ndeloof Feb 5, 2024
f1c01ef
bump compose-go to v2.0.0-rc.4
ndeloof Feb 7, 2024
2259da0
Include all networks in ContainerCreate call if API >= 1.44
laurazard Jan 30, 2024
240f15b
chore(load): ensure context passed to load
milas Feb 5, 2024
54ba387
feat(tracing): add project hash attr
milas Feb 5, 2024
0f10e17
build(deps): bump github.com/opencontainers/image-spec
dependabot[bot] Feb 6, 2024
0ac1318
Add OTEL specs: build, depends_on, capabilities (gpu/tpu)
jhrotko Feb 8, 2024
18e8245
pass All option to backend api.Service when length statuses is not eq…
1arp Feb 8, 2024
7825cc2
ci(deps): bump docker/cli to v25.0.3 (#11481)
ndeloof Feb 12, 2024
69c916a
fix deadlock collecting large logs
ndeloof Feb 13, 2024
5a587b4
Use listener for file metadata
jhrotko Feb 12, 2024
22e24bc
docs: unify no trailing dots in docstrings and help (#11301)
PiotrDabrowskey Feb 14, 2024
a41fc58
chore(watch): remove old `docker cp` implementation
milas Feb 13, 2024
ba30ec9
docs: update cli reference link
dvdksn Feb 9, 2024
070d515
use listeners to collect include metrics
ndeloof Feb 15, 2024
4257567
discard stdout for laaarge log test
ndeloof Feb 15, 2024
8f9261a
sort containers to optimize scale down
ndeloof Feb 7, 2024
5628053
ci: bump engine version to `25.0.3`
laurazard Feb 16, 2024
75343a5
Issue-11374: Modified compose up command to respect COMPOSE_REMOVE_OR…
Feb 17, 2024
f74ee6d
when ran with ANSI disabled, force progress=plain
ndeloof Feb 16, 2024
5d11902
pass QuietOption when starting dependencies from run command
glours Feb 19, 2024
dc6d7dd
add support of QuietOption to create command
glours Feb 19, 2024
3989aa1
use an dedicated compose file --quiet-pull e2e test
glours Feb 21, 2024
3a99e20
bump compose-go to version v2.0.0-rc.8
glours Feb 21, 2024
476dbee
Add a fallback check of Watch pid on Windows
glours Feb 16, 2024
531f0f6
get log to manage `attach`
ndeloof Feb 22, 2024
a2803e9
remove docker cli step in ci.yml
jhrotko Feb 27, 2024
895f451
restore support for `config --no-interpolate`
ndeloof Feb 28, 2024
96de87a
move code into small functions for better readability
ndeloof Feb 28, 2024
d05c176
introduce --watch
ndeloof Feb 19, 2024
fcef7a9
avoid duplicated "xx exited with code 0" message
ndeloof Feb 29, 2024
ba5792e
make code simpler
ndeloof Feb 21, 2024
cd93bac
Add test summary for test jobs in ci
jhrotko Feb 27, 2024
5a1c495
ci(deps): bump moby/moby & docker/cli to v25.0.4 (#11566)
milas Mar 5, 2024
0e527d4
chore(deps): upgrade go to 1.21.8 (#11578)
milas Mar 5, 2024
7b7f6a0
feat(desktop): add Docker Desktop detection and client skeleton (#11593)
milas Mar 12, 2024
5a8c9c0
only use ToModel when --no-interpolate is set
ndeloof Mar 12, 2024
bf30287
fix TestBuildPlatformsWithCorrectBuildxConfig
ndeloof Mar 15, 2024
ea75fd7
services shell completion bugfix
oandrew Feb 28, 2024
11ac649
Bump compose-go v2.0.0
ndeloof Mar 15, 2024
bff6d36
add an option to use a custom progress printer for the build progress…
rarguelloF Mar 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 22 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ jobs:
name: coverage-data-unit
path: bin/coverage/unit/
if-no-files-found: error

-
name: Unit Test Summary
uses: test-summary/action@v2
with:
paths: bin/coverage/unit/report.xml
if: always()
e2e:
runs-on: ubuntu-latest
strategy:
Expand All @@ -138,10 +143,20 @@ jobs:
mode:
- plugin
- standalone
engine:
- 24.0.9
- 25.0.3
steps:
-
name: Checkout
uses: actions/checkout@v3
- name: Install Docker ${{ matrix.engine }}
run: |
sudo apt-get install curl
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh --version ${{ matrix.engine }}
- name: Check Docker Version
run: docker --version
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -152,11 +167,6 @@ jobs:
go-version-file: 'go.mod'
check-latest: true
cache: true
-
name: Setup docker CLI
run: |
curl https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_CLI_VERSION}.tgz | tar xz
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
-
name: Build
uses: docker/bake-action@v2
Expand Down Expand Up @@ -197,7 +207,12 @@ jobs:
rm -f /usr/local/bin/docker-compose
cp bin/build/docker-compose /usr/local/bin
make e2e-compose-standalone

-
name: e2e Test Summary
uses: test-summary/action@v2
with:
paths: /tmp/report/report.xml
if: always()
coverage:
runs-on: ubuntu-22.04
needs:
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG GO_VERSION=1.21.6
ARG GO_VERSION=1.21.8
ARG XX_VERSION=1.2.1
ARG GOLANGCI_LINT_VERSION=v1.55.2
ARG ADDLICENSE_VERSION=v1.0.0
Expand Down Expand Up @@ -106,11 +106,14 @@ RUN --mount=type=bind,target=. \
--mount=type=cache,target=/go/pkg/mod \
rm -rf /tmp/coverage && \
mkdir -p /tmp/coverage && \
go test -tags "$BUILD_TAGS" -v -cover -covermode=atomic $(go list $(TAGS) ./... | grep -vE 'e2e') -args -test.gocoverdir="/tmp/coverage" && \
rm -rf /tmp/report && \
mkdir -p /tmp/report && \
go run gotest.tools/gotestsum@latest --format testname --junitfile "/tmp/report/report.xml" -- -tags "$BUILD_TAGS" -v -cover -covermode=atomic $(go list $(TAGS) ./... | grep -vE 'e2e') -args -test.gocoverdir="/tmp/coverage" && \
go tool covdata percent -i=/tmp/coverage

FROM scratch AS test-coverage
COPY --from=test --link /tmp/coverage /
COPY --from=test --link /tmp/report /

FROM base AS license-set
ARG LICENSE_FILES
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ install: binary

.PHONY: e2e-compose
e2e-compose: ## Run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a single test
go test -v $(TEST_FLAGS) -count=1 ./pkg/e2e
go run gotest.tools/gotestsum@latest --format testname --junitfile "/tmp/report/report.xml" -- -v $(TEST_FLAGS) -count=1 ./pkg/e2e

.PHONY: e2e-compose-standalone
e2e-compose-standalone: ## Run End to end local tests in standalone mode. Set E2E_TEST=TestName to run a single test
go test $(TEST_FLAGS) -v -count=1 -parallel=1 --tags=standalone ./pkg/e2e
go run gotest.tools/gotestsum@latest --format testname --junitfile "/tmp/report/report.xml" -- $(TEST_FLAGS) -v -count=1 -parallel=1 --tags=standalone ./pkg/e2e

.PHONY: build-and-e2e-compose
build-and-e2e-compose: build e2e-compose ## Compile the compose cli-plugin and run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a single test
Expand Down
4 changes: 2 additions & 2 deletions cmd/compose/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func attachCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service
}
runCmd := &cobra.Command{
Use: "attach [OPTIONS] SERVICE",
Short: "Attach local standard input, output, and error streams to a service's running container.",
Short: "Attach local standard input, output, and error streams to a service's running container",
Args: cobra.MinimumNArgs(1),
PreRunE: Adapt(func(ctx context.Context, args []string) error {
opts.service = args[0]
Expand All @@ -64,7 +64,7 @@ func attachCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service
}

func runAttach(ctx context.Context, dockerCli command.Cli, backend api.Service, opts attachOpts) error {
projectName, err := opts.toProjectName(dockerCli)
projectName, err := opts.toProjectName(ctx, dockerCli)
if err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/compose/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ func buildCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service)
ValidArgsFunction: completeServiceNames(dockerCli, p),
}
flags := cmd.Flags()
flags.BoolVar(&opts.push, "push", false, "Push service images.")
flags.BoolVar(&opts.push, "push", false, "Push service images")
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Don't print anything to STDOUT")
flags.BoolVar(&opts.pull, "pull", false, "Always attempt to pull a newer version of the image.")
flags.StringArrayVar(&opts.args, "build-arg", []string{}, "Set build-time variables for services.")
flags.BoolVar(&opts.pull, "pull", false, "Always attempt to pull a newer version of the image")
flags.StringArrayVar(&opts.args, "build-arg", []string{}, "Set build-time variables for services")
flags.StringVar(&opts.ssh, "ssh", "", "Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent)")
flags.StringVar(&opts.builder, "builder", "", "Set builder to use.")
flags.BoolVar(&opts.deps, "with-dependencies", false, "Also build dependencies (transitively).")
flags.StringVar(&opts.builder, "builder", "", "Set builder to use")
flags.BoolVar(&opts.deps, "with-dependencies", false, "Also build dependencies (transitively)")

flags.Bool("parallel", true, "Build images in parallel. DEPRECATED")
flags.MarkHidden("parallel") //nolint:errcheck
Expand All @@ -136,7 +136,7 @@ func buildCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service)
}

func runBuild(ctx context.Context, dockerCli command.Cli, backend api.Service, opts buildOptions, services []string) error {
project, err := opts.ToProject(dockerCli, services, cli.WithResolvedPaths(true), cli.WithoutEnvironmentResolution)
project, _, err := opts.ToProject(ctx, dockerCli, services, cli.WithResolvedPaths(true), cli.WithoutEnvironmentResolution)
if err != nil {
return err
}
Expand Down
9 changes: 5 additions & 4 deletions cmd/compose/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ func noCompletion() validArgsFn {
func completeServiceNames(dockerCli command.Cli, p *ProjectOptions) validArgsFn {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
p.Offline = true
project, err := p.ToProject(dockerCli, nil)
project, _, err := p.ToProject(cmd.Context(), dockerCli, nil)
if err != nil {
return nil, cobra.ShellCompDirectiveNoFileComp
}
var values []string
serviceNames := append(project.ServiceNames(), project.DisabledServiceNames()...)
for _, s := range serviceNames {
if toComplete == "" || strings.HasPrefix(s, toComplete) {
serviceNames = append(serviceNames, s)
values = append(values, s)
}
}
return serviceNames, cobra.ShellCompDirectiveNoFileComp
return values, cobra.ShellCompDirectiveNoFileComp
}
}

Expand All @@ -72,7 +73,7 @@ func completeProjectNames(backend api.Service) func(cmd *cobra.Command, args []s
func completeProfileNames(dockerCli command.Cli, p *ProjectOptions) validArgsFn {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
p.Offline = true
project, err := p.ToProject(dockerCli, nil)
project, _, err := p.ToProject(cmd.Context(), dockerCli, nil)
if err != nil {
return nil, cobra.ShellCompDirectiveNoFileComp
}
Expand Down