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

Proposal: first-class support for developing on Docker #585

Open
4 of 7 tasks
aiven-anton opened this issue Apr 18, 2023 · 0 comments
Open
4 of 7 tasks

Proposal: first-class support for developing on Docker #585

aiven-anton opened this issue Apr 18, 2023 · 0 comments

Comments

@aiven-anton
Copy link
Contributor

aiven-anton commented Apr 18, 2023

I've opened a few draft PRs related to improving the Docker container, and wanted to share where I'm going with this. We decided to put those on hold until we have at least a rudimentary smoke test in place for the container image.

The purpose of this issue to serve as an umbrella for those and further changes, that will facilitate easier set up of development environments, especially for non-linux work stations. The end goal is to be able to easily run the test suite in a docker container, with local changes mounted for quick iterations. The draft PRs that are already lined-up also help in facilitating this by making sure local container rebuilds are quick.

In making these changes, I am also modernizing some of the tooling that we're using where appropriate, like using Docker's Github actions to build container metadata and versioning, using a more recent Python version, etc.

It's important to note that all of these changes are intended to only have minor effects on the resulting production container image.

Items to address

  • Introduce smoke-test of container image. Should start up container in both modes (rest/registry) with a Kafka back-end, and verify communications work through some relatively simple operations.
  • Build ARM image (fixes Provide images for the arm64 architecture  #521).
  • Optimize container build time.
  • #580 Narrow docker context, this assures changes to unrelated files in the repository don't trigger cache eviction of Docker layers.
  • Introduce a dev build target, separate from the production build target, that installs full test requirements in the container.
  • Make sure there's a docker compose file that uses the new dev target, should enable running tests with something like docker compose run --rm karapace pytest.
  • Introduce proxy targets in Makefile, so that we can easily run common make targets within a container. make docker:unit-tests should result in a call to make unit-tests within the docker-compose container.

Why?

  • Current setup leaves lingering processes on developer machines.
  • No need to install, and keep versions in sync, of dependency binaries on developer machines (java, protoc, snappy, kafka).
  • Alignment of developer environments, possibly easier to reason about and recreate issues.
  • A streamlined dev env setup hopefully means it's easier to attract contributors.
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

No branches or pull requests

1 participant