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

Upgrade tool management #224

Merged
merged 4 commits into from
Apr 23, 2024
Merged

Upgrade tool management #224

merged 4 commits into from
Apr 23, 2024

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Feb 16, 2024

Upgrade practices similar to that of syft and grype, specifically:

  • use binny to manage local tooling
  • use task over make for coordinating tasks

This helps setup getting a release pipeline into stereoscope #221 , since it will be quite similar to how syft and grype release workflow-wise, getting the practices and tooling up to date first makes the transition easier.

@wagoodman wagoodman force-pushed the upgrade-tool-management branch 2 times, most recently from 41963d7 to bf865b0 Compare February 16, 2024 15:38
Copy link

github-actions bot commented Feb 16, 2024

Benchmark Test Results

Benchmark results from the latest changes vs base branch
make .tool/task
make[1]: Entering directory '/home/runner/work/stereoscope/stereoscope'
make[1]: Leaving directory '/home/runner/work/stereoscope/stereoscope'
.tool/task show-benchstat
?   	github.com/anchore/stereoscope	[no test files]
?   	github.com/anchore/stereoscope/examples	[no test files]
PASS
ok  	github.com/anchore/stereoscope/internal	0.004s
?   	github.com/anchore/stereoscope/internal/bus	[no test files]
PASS
ok  	github.com/anchore/stereoscope/internal/containerd	0.008s
PASS
ok  	github.com/anchore/stereoscope/internal/docker	0.005s
?   	github.com/anchore/stereoscope/internal/log	[no test files]
PASS
ok  	github.com/anchore/stereoscope/internal/podman	0.006s
?   	github.com/anchore/stereoscope/pkg/event	[no test files]
?   	github.com/anchore/stereoscope/pkg/event/parsers	[no test files]
goos: linux
goarch: amd64
pkg: github.com/anchore/stereoscope/pkg/file
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkTarIndex-4   	   33666	     35556 ns/op	    5698 B/op	      93 allocs/op
BenchmarkTarIndex-4   	   33367	     35565 ns/op	    5698 B/op	      93 allocs/op
BenchmarkTarIndex-4   	   33532	     35728 ns/op	    5700 B/op	      93 allocs/op
BenchmarkTarIndex-4   	   33508	     36538 ns/op	    5699 B/op	      93 allocs/op
BenchmarkTarIndex-4   	   33452	     35748 ns/op	    5701 B/op	      93 allocs/op
BenchmarkTarIndex-4   	   33384	     35989 ns/op	    5702 B/op	      93 allocs/op
BenchmarkTarIndex-4   	   33446	     35936 ns/op	    5700 B/op	      93 allocs/op
PASS
ok  	github.com/anchore/stereoscope/pkg/file	10.961s
PASS
ok  	github.com/anchore/stereoscope/pkg/filetree	0.004s
?   	github.com/anchore/stereoscope/pkg/filetree/filenode	[no test files]
PASS
ok  	github.com/anchore/stereoscope/pkg/image	0.006s
PASS
ok  	github.com/anchore/stereoscope/pkg/image/containerd	0.010s
PASS
ok  	github.com/anchore/stereoscope/pkg/image/docker	0.006s
PASS
ok  	github.com/anchore/stereoscope/pkg/image/oci	0.005s
PASS
ok  	github.com/anchore/stereoscope/pkg/image/oci/credhelpers	0.005s
?   	github.com/anchore/stereoscope/pkg/image/podman	[no test files]
PASS
ok  	github.com/anchore/stereoscope/pkg/image/sif	0.005s
?   	github.com/anchore/stereoscope/pkg/imagetest	[no test files]
PASS
ok  	github.com/anchore/stereoscope/pkg/tree	0.003s
PASS
ok  	github.com/anchore/stereoscope/pkg/tree/node	0.003s
goos: linux
goarch: amd64
pkg: github.com/anchore/stereoscope/test/integration
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkSimpleImage_GetImage/docker-archive-4 	     986	   1185293 ns/op	  334746 B/op	    2597 allocs/op
BenchmarkSimpleImage_GetImage/docker-archive-4 	    1005	   1182521 ns/op	  334211 B/op	    2596 allocs/op
BenchmarkSimpleImage_GetImage/docker-archive-4 	    1018	   1179448 ns/op	  334196 B/op	    2596 allocs/op
BenchmarkSimpleImage_GetImage/docker-archive-4 	    1010	   1252648 ns/op	  334058 B/op	    2596 allocs/op
BenchmarkSimpleImage_GetImage/docker-archive-4 	    1015	   1229923 ns/op	  334065 B/op	    2596 allocs/op
BenchmarkSimpleImage_GetImage/docker-archive-4 	    1015	   1221737 ns/op	  333929 B/op	    2596 allocs/op
BenchmarkSimpleImage_GetImage/docker-archive-4 	    1008	   1172673 ns/op	  333881 B/op	    2596 allocs/op
BenchmarkSimpleImage_GetImage/podman-4         	      68	  17241758 ns/op	  453205 B/op	    2808 allocs/op
BenchmarkSimpleImage_GetImage/podman-4         	      68	  17122718 ns/op	  453925 B/op	    2808 allocs/op
BenchmarkSimpleImage_GetImage/podman-4         	      64	  18331920 ns/op	  454488 B/op	    2809 allocs/op
BenchmarkSimpleImage_GetImage/podman-4         	      70	  17761360 ns/op	  454297 B/op	    2808 allocs/op
BenchmarkSimpleImage_GetImage/podman-4         	      72	  17373714 ns/op	  453845 B/op	    2807 allocs/op
BenchmarkSimpleImage_GetImage/podman-4         	      68	  17332468 ns/op	  454244 B/op	    2808 allocs/op
BenchmarkSimpleImage_GetImage/podman-4         	      67	  18856384 ns/op	  454449 B/op	    2809 allocs/op
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 345B done
#2 DONE 0.0s

#3 [internal] load build context
#3 transferring context: 209B done
#3 DONE 0.0s

#4 [1/3] ADD file-1.txt /somefile-1.txt
#4 CACHED

#5 [2/3] ADD file-2.txt /somefile-2.txt
#5 CACHED

#6 [3/3] ADD target /
#6 CACHED

#7 exporting to image
#7 exporting layers done
#7 writing image sha256:24671860f16f5cd8be327c3dc8015bcd6e7a3e912c74ac2fb1d065dbd67b1b2d done
#7 naming to docker.io/library/stereoscope-fixture-image-simple:04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7 done
#7 naming to docker.io/library/stereoscope-fixture-image-simple:latest done
#7 DONE 0.0s
ctr: failed to dial "/run/containerd/containerd.sock": connection error: desc = "transport: error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied"
--- FAIL: BenchmarkSimpleImage_GetImage
    image_fixtures.go:193: using existing image tar: 'test-fixtures/cache/stereoscope-fixture-image-simple-04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7.tar' (size: 21504, modified: 2024-04-23 13:48:00.032836542 +0000 UTC, mode: -rw-r--r--)
    image_fixtures.go:241: Build docker image: name="stereoscope-fixture-image-simple" tag="04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7"
    image_fixtures.go:291: saveImage running: docker image save stereoscope-fixture-image-simple:04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7
    image_fixtures.go:286: 
        	Error Trace:	/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:286
        	            				/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:162
        	            				/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:152
        	            				/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:33
        	            				/home/runner/work/stereoscope/stereoscope/test/integration/fixture_image_simple_test.go:163
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	BenchmarkSimpleImage_GetImage
        	Messages:   	could not import docker image to containerd (shell out)
BenchmarkSimpleImage_FetchSquashedContents/docker-archive-4         	   54595	     21960 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/docker-archive-4         	   54483	     21906 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/docker-archive-4         	   54003	     21986 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/docker-archive-4         	   54656	     21884 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/docker-archive-4         	   54621	     21913 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/docker-archive-4         	   54398	     21873 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/docker-archive-4         	   53954	     21876 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/podman-4                 	   54188	     21965 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/podman-4                 	   54536	     21946 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/podman-4                 	   54676	     21943 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/podman-4                 	   54158	     21981 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/podman-4                 	   54260	     21899 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/podman-4                 	   54596	     21996 ns/op	    2712 B/op	      21 allocs/op
BenchmarkSimpleImage_FetchSquashedContents/podman-4                 	   54686	     21939 ns/op	    2712 B/op	      21 allocs/op
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 345B done
#2 DONE 0.0s

#3 [internal] load build context
#3 transferring context: 209B done
#3 DONE 0.0s

#4 [1/3] ADD file-1.txt /somefile-1.txt
#4 CACHED

#5 [2/3] ADD file-2.txt /somefile-2.txt
#5 CACHED

#6 [3/3] ADD target /
#6 CACHED

#7 exporting to image
#7 exporting layers done
#7 writing image sha256:24671860f16f5cd8be327c3dc8015bcd6e7a3e912c74ac2fb1d065dbd67b1b2d done
#7 naming to docker.io/library/stereoscope-fixture-image-simple:04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7 done
#7 naming to docker.io/library/stereoscope-fixture-image-simple:latest done
#7 DONE 0.0s
ctr: failed to dial "/run/containerd/containerd.sock": connection error: desc = "transport: error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied"
--- FAIL: BenchmarkSimpleImage_FetchSquashedContents
    image_fixtures.go:193: using existing image tar: 'test-fixtures/cache/stereoscope-fixture-image-simple-04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7.tar' (size: 21504, modified: 2024-04-23 13:48:00.032836542 +0000 UTC, mode: -rw-r--r--)
    image_fixtures.go:241: Build docker image: name="stereoscope-fixture-image-simple" tag="04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7"
    image_fixtures.go:291: saveImage running: docker image save stereoscope-fixture-image-simple:04e16e44161c8888a1a963720fd0443cbf7eef8101434c431de8725cd98cc9f7
    image_fixtures.go:286: 
        	Error Trace:	/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:286
        	            				/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:162
        	            				/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:152
        	            				/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:33
        	            				/home/runner/work/stereoscope/stereoscope/pkg/imagetest/image_fixtures.go:64
        	            				/home/runner/work/stereoscope/stereoscope/test/integration/fixture_image_simple_test.go:189
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	BenchmarkSimpleImage_FetchSquashedContents
        	Messages:   	could not import docker image to containerd (shell out)
FAIL
exit status 1
FAIL	github.com/anchore/stereoscope/test/integration	39.317s
?   	github.com/anchore/stereoscope/test/integration/test-fixtures/registry	[no test files]
FAIL
goos: linux
goarch: amd64
pkg: github.com/anchore/stereoscope/pkg/file
cpu: AMD EPYC 7763 64-Core Processor                
ctr: 
           │ .tmp/benchmark-29bc61c.txt │
           │           sec/op           │
TarIndex-4                  35.75µ ± 2%

           │ .tmp/benchmark-29bc61c.txt │
           │            B/op            │
TarIndex-4                 5.566Ki ± 0%

           │ .tmp/benchmark-29bc61c.txt │
           │         allocs/op          │
TarIndex-4                   93.00 ± 0%

pkg: github.com/anchore/stereoscope/test/integration
                                      │ .tmp/benchmark-29bc61c.txt │
                                      │           sec/op           │
SimpleImage_GetImage/docker-archive-4                  1.185m ± 6%
SimpleImage_GetImage/podman-4                          17.37m ± 9%
geomean                                                4.538m

                                      │ .tmp/benchmark-29bc61c.txt │
                                      │            B/op            │
SimpleImage_GetImage/docker-archive-4                 326.2Ki ± 0%
SimpleImage_GetImage/podman-4                         443.6Ki ± 0%
geomean                                               380.4Ki

                                      │ .tmp/benchmark-29bc61c.txt │
                                      │         allocs/op          │
SimpleImage_GetImage/docker-archive-4                  2.596k ± 0%
SimpleImage_GetImage/podman-4                          2.808k ± 0%
geomean                                                2.700k

ctr: failed to dial "/run/containerd/containerd.sock": connection error: desc = "transport: error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied"
                                                   │ .tmp/benchmark-29bc61c.txt │
                                                   │           sec/op           │
SimpleImage_FetchSquashedContents/docker-archive-4                  21.91µ ± 0%
SimpleImage_FetchSquashedContents/podman-4                          21.95µ ± 0%
geomean                                                             21.93µ

                                                   │ .tmp/benchmark-29bc61c.txt │
                                                   │            B/op            │
SimpleImage_FetchSquashedContents/docker-archive-4                 2.648Ki ± 0%
SimpleImage_FetchSquashedContents/podman-4                         2.648Ki ± 0%
geomean                                                            2.648Ki

                                                   │ .tmp/benchmark-29bc61c.txt │
                                                   │         allocs/op          │
SimpleImage_FetchSquashedContents/docker-archive-4                   21.00 ± 0%
SimpleImage_FetchSquashedContents/podman-4                           21.00 ± 0%
geomean                                                              21.00
goos: linux
goarch: amd64
pkg: github.com/anchore/stereoscope/pkg/file
cpu: AMD EPYC 7763 64-Core Processor                
ctr: 
           │ .tmp/benchmark-29bc61c.txt │
           │           sec/op           │
TarIndex-4                  35.75µ ± 2%

           │ .tmp/benchmark-29bc61c.txt │
           │            B/op            │
TarIndex-4                 5.566Ki ± 0%

           │ .tmp/benchmark-29bc61c.txt │
           │         allocs/op          │
TarIndex-4                   93.00 ± 0%

pkg: github.com/anchore/stereoscope/test/integration
                                      │ .tmp/benchmark-29bc61c.txt │
                                      │           sec/op           │
SimpleImage_GetImage/docker-archive-4                  1.185m ± 6%
SimpleImage_GetImage/podman-4                          17.37m ± 9%
geomean                                                4.538m

                                      │ .tmp/benchmark-29bc61c.txt │
                                      │            B/op            │
SimpleImage_GetImage/docker-archive-4                 326.2Ki ± 0%
SimpleImage_GetImage/podman-4                         443.6Ki ± 0%
geomean                                               380.4Ki

                                      │ .tmp/benchmark-29bc61c.txt │
                                      │         allocs/op          │
SimpleImage_GetImage/docker-archive-4                  2.596k ± 0%
SimpleImage_GetImage/podman-4                          2.808k ± 0%
geomean                                                2.700k

ctr: failed to dial "/run/containerd/containerd.sock": connection error: desc = "transport: error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied"
                                                   │ .tmp/benchmark-29bc61c.txt │
                                                   │           sec/op           │
SimpleImage_FetchSquashedContents/docker-archive-4                  21.91µ ± 0%
SimpleImage_FetchSquashedContents/podman-4                          21.95µ ± 0%
geomean                                                             21.93µ

                                                   │ .tmp/benchmark-29bc61c.txt │
                                                   │            B/op            │
SimpleImage_FetchSquashedContents/docker-archive-4                 2.648Ki ± 0%
SimpleImage_FetchSquashedContents/podman-4                         2.648Ki ± 0%
geomean                                                            2.648Ki

                                                   │ .tmp/benchmark-29bc61c.txt │
                                                   │         allocs/op          │
SimpleImage_FetchSquashedContents/docker-archive-4                   21.00 ± 0%
SimpleImage_FetchSquashedContents/podman-4                           21.00 ± 0%
geomean                                                              21.00

@wagoodman wagoodman force-pushed the upgrade-tool-management branch 3 times, most recently from cd9193a to cce2aab Compare February 16, 2024 16:05
@wagoodman wagoodman marked this pull request as ready for review February 16, 2024 17:09
@wagoodman wagoodman requested a review from a team February 16, 2024 18:01
Copy link
Contributor

@spiffcs spiffcs left a comment

Choose a reason for hiding this comment

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

small comments added with questions about use of variables and potential project name conflict

.github/actions/bootstrap/action.yaml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Taskfile.yaml Outdated Show resolved Hide resolved
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman force-pushed the upgrade-tool-management branch 2 times, most recently from 7a480e4 to c55369e Compare April 23, 2024 13:47
Copy link
Contributor

@spiffcs spiffcs left a comment

Choose a reason for hiding this comment

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

👍 with comments addressed

@wagoodman wagoodman merged commit ab850ea into main Apr 23, 2024
7 checks passed
@wagoodman wagoodman deleted the upgrade-tool-management branch April 23, 2024 13:58
@wagoodman wagoodman added the changelog-ignore Don't include this issue in the release changelog label Apr 23, 2024
@wagoodman wagoodman self-assigned this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-ignore Don't include this issue in the release changelog
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants