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 dev Dockerfile for nouveau #275

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mrjones-plip
Copy link

@mrjones-plip mrjones-plip commented Jan 28, 2025

Overview

While some work was done in #257 to get a development build of main in Docker, there's still no easy way to get a development image of Nouveau with latest passing build. This PR aims to use the latest passing build artifacts (see lastSuccessfulBuild in CI) for Nouveau into a docker image.

The approach will be to take the Dockerfile found in 3.4.2 for Nouveau and instead of using the released package from the apt repo, instead download the .deb from CI and install this. As such, the Dockerfile will skip all the effort to add the GPG key and adding the CouchDB Apt repo. It will also not install tini (which looks to be unused anyway)

Changes

  • Adds new Dockerfile-nouveau in the dev directory
  • adds compose.yml in dev for easy docker compose up of dev containers
  • adds supporting .ini and .yaml files for running dev compose per above
  • adds a line to .gitignore for those JetBrains IDE users like me ;)

Testing recommendations

Docker

  1. check out this branch
  2. get into dev: cd dev
  3. build image: docker build -t couchdb-nouveau:dev -f Dockerfile-nouveau .
  4. run image: docker run -p 5988:5988 couchdb-nouveau:dev
  5. see the service field requests: curl 172.17.0.2:5988/openapi.yaml

Docker compose

  1. check out this branch
  2. get into dev: cd dev
  3. run it: docker compose up

All images should build (might take a good loooooong while for couchdb!) and then start up.

GitHub issue number

NA

Related Pull Requests

This IS a pull request ;)

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

@mrjones-plip
Copy link
Author

Looking good! I can build the image, run it in docker and make a curl request into it (see video below (apologies for the 404 in the test curl call - I don't really know how to test Nouveau just yet)). I think it'd be really nice to have a compose.yml that built both the dev images for couch and nouveau, and bind mounted the required .ini files and such - I'll see if I can't add that too! I'll be sure to update the development images section of the readme too.

test.build.webm

@mrjones-plip
Copy link
Author

Ok! got a working compose.yaml. Came together nicely once I figured out where all the .ini and .yaml files needed to be and what is in them. I suspect this is good to go as is, but I've only done smoke testing, so I'll keep it a draft until I've actually been able to see the couch <> nouveau integration actually do something. Stay tuned!

test.compose.webm

@mrjones-plip mrjones-plip marked this pull request as ready for review January 30, 2025 22:12
@big-r81
Copy link

big-r81 commented Jan 31, 2025

Hey @mrjones-plip,

first, thank you for your contribution to CouchDB.

Why do you need a separate "Nouveau-only" Image for development instead of a All-In-One (CouchDB + Nouveau) Docker dev image?

@mrjones-plip
Copy link
Author

mrjones-plip commented Jan 31, 2025

Hi @big-r81! Thanks for the question - great to get extra eyes on this.

We'd wanted to test an upgrade scenario for Nouveau, so in order to do this we needed to start on 3.4.2 and then upgrade to something newer. The all in one you mentioned is pinned to 3.4.2 via an apt install, released on Oct 19, 2024, 3 months ago.

The solution in this PR removes the apt calls (as well as any related gpg and tini calls) to instead use curl to fetch the very latest which, as of this writing, was built from main on Jan 28, 2025, 2 days ago.

This PR also brings parity to the Dockerfile in dev for CouchDB which builds the binary on demand from main (via a git clone) when you build the docker image.

@big-r81
Copy link

big-r81 commented Jan 31, 2025

We'd wanted to test an upgrade scenario for Nouveau, so in order to do this we needed to start on 3.4.2 and then upgrade to something newer. The all in one you mentioned is pinned to 3.4.2 via an apt install, released on Oct 19, 2024, 3 months ago.

What about to update the Dockerfile in the dev directory to build CouchDB and Nouveau from main - I would guess it was created for that reason? (never used it personally)

So we would need to add

  • an OpenJDK runtime
  • tell the ./configure script to build Nouveau e.g. ./configure [...] --with-nouveau
  • expose the ports and start CouchDB and Noveau

The you would have a Docker image from main with all inside.

@mrjones-plip
Copy link
Author

mrjones-plip commented Feb 3, 2025

Thanks for the feedback @big-r81 ! I'd interpreted the dev directory as the ability to get the latest dev build running in Docker which this PR achieves. I'd checked in with @janl before starting the PR on Slack and he said:

The general shape of this looks fine.

I admit using a curl call to suck in the very latest pre-compiled binary is a handy trick I'd like to keep, but I'm open to refactoring the PR to compile from scratch if that's what folks want.

lemme know!

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.

2 participants