Skip to content

chore: add Makefile and local registry cache #138

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

Merged
merged 8 commits into from
Apr 24, 2024
Merged

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Apr 24, 2024

  • Adds a Makefile
  • Adds a local registry cache to avoid hitting Docker Hub rate-limits
  • Updates existing tests to reference locally cached images

Note: there is an existing in-memory registry implementation that I looked into using instead, but this was cheaper to implement.

@johnstcn johnstcn self-assigned this Apr 24, 2024
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM!

@johnstcn johnstcn merged commit f59bd37 into main Apr 24, 2024
2 checks passed
@johnstcn johnstcn deleted the cj/local-registry branch April 24, 2024 10:10
./scripts/develop.sh

build: scripts/envbuilder-$(GOARCH)
./scripts/build.sh
Copy link
Member

Choose a reason for hiding this comment

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

These seem like they should be phony atm?


.PHONY: test
test: test-registry test-images
go test -count=1 ./...
Copy link
Member

Choose a reason for hiding this comment

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

Count will disable go caching, let's remove it as I imagine anyone developing the project would prefer caching on?

.registry-cache:
mkdir -p .registry-cache && chmod -R ag+w .registry-cache

.registry-cache/docker/registry/v2/repositories/envbuilder-test-alpine:
Copy link
Member

Choose a reason for hiding this comment

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

These should perhaps depend on the test-registry?

@@ -605,7 +609,7 @@ func TestPrivateRegistry(t *testing.T) {
})
t.Run("Auth", func(t *testing.T) {
t.Parallel()
image := setupPassthroughRegistry(t, "library/alpine", &registryAuth{
image := setupPassthroughRegistry(t, "envbuilder-test-alpine:latest", &registryAuth{
Copy link
Member

Choose a reason for hiding this comment

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

Is it intentional to use hard-coded name here, compared to e.g. testImageAlpine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants