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

Update couchdb, add new couchdb-nouveau fulltext search addon #17633

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

Conversation

janl
Copy link
Contributor

@janl janl commented Sep 27, 2024

No description provided.

This comment has been minimized.

Copy link
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

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

-1

This fails for me at least:

Starting buildx build at Fri Sep 27 03:50:08 EDT 2024...
[+] Building 3.1s (6/6) FINISHED                                                                                                                                             docker-container:apache-couchdb
 => [internal] load build definition from Dockerfile                                                                                                                                                    0.0s
 => => transferring dockerfile: 4.46kB                                                                                                                                                                  0.0s
 => CANCELED [linux/arm64 internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                            3.0s
 => CANCELED [linux/amd64 internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                            3.0s
 => ERROR [linux/s390x internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                               3.0s
 => ERROR [linux/ppc64le internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                             3.0s
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                                                                           0.0s
------
 > [linux/s390x internal] load metadata for docker.io/library/debian:bullseye-slim:
------
------
 > [linux/ppc64le internal] load metadata for docker.io/library/debian:bullseye-slim:
------
Dockerfile:13
--------------------
  11 |     # the License.
  12 |     
  13 | >>> FROM debian:bullseye-slim
  14 |     
  15 |     LABEL maintainer="CouchDB Developers [email protected]"
--------------------
ERROR: failed to solve: debian:bullseye-slim: failed to resolve source metadata for docker.io/library/debian:bullseye-slim: no match for platform in manifest: not found

@janl
Copy link
Contributor Author

janl commented Sep 27, 2024

fix incoming shortly

This comment has been minimized.

@tianon
Copy link
Member

tianon commented Sep 27, 2024

From the CI:

Invalid 'FROM' + 'Architectures' combinations detected:

  • couchdb:3.3.3 (FROM debian:bullseye-slim) [ppc64le, s390x]

Debian Bullseye is officially in LTS now, so the set of supported architectures is limited and you'll need to either drop the now-unsupported ones or update to Bookworm.

I think you'll also want to remove 3.2, right? (I understand it's EOL now?) As a reminder, removing tags here will remove them from the "Supported" section on the Hub readme (and will prevent us from spending cycles rebuilding them on the official build servers), but the tags will still be available to users who want them. (See https://github.com/docker-library/official-images#library-definition-files for more detail on this.)

Also, unfortunately we won't likely accept nouveau as a new image (new repo namespace) -- I would suggest using a tag naming scheme like couchdb:3.4-nouveau if nouveau is simply an optional add-on to couchdb, or couchdb:nouveau-3.4 if nouveau is a wholly separate tool (and the version numbers are only coincidentally the same). Relevant to the former, would it be possible/reasonable for the new nouveau images to be FROM couchdb:3.4 so they can share layers? One major benefit of doing so is that it's then less "expensive" for users to swap back and forth between them.

@nickva
Copy link
Contributor

nickva commented Sep 27, 2024

@tianon Thank you for your guidance. We'll use bookworm for the base, remove 3.2 and use a tagging scheme for nouveau

@janl
Copy link
Contributor Author

janl commented Sep 28, 2024

Relevant to the former, would it be possible/reasonable for the new nouveau images to be FROM couchdb:3.4 so they can share layers? One major benefit of doing so is that it's then less "expensive" for users to swap back and forth between them.

Nouveau needs a Java runtime environment and CouchDB needs an Erlang runtime environment, so stacking them on top of each other does not make too much sense.

The other points I have addressed with the latest commit. Am I missing anything?

This comment has been minimized.

@janl
Copy link
Contributor Author

janl commented Sep 28, 2024

OH! does the CI error mean we have to bump 3.3.3 to bookworm as well? Sorry if I misunderstood that.

Fix incoming shortly

This comment has been minimized.

Copy link

Diff for 9eda0c9:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 46b25ab..ea683a6 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,11 +1,16 @@
 Maintainers: Joan Touzet <[email protected]> (@wohali), Jan Lehnardt <[email protected]> (@janl), Nick Vatamaniuc (@nickva)
 GitRepo: https://github.com/apache/couchdb-docker
 GitFetch: refs/heads/main
-GitCommit: 58910ed097489dc588b2a87592406f8faa1bdadf
+GitCommit: f68db4cb1bdc671ddff413d9ccf2113a55b430f2
 
-Tags: 3.2.3, 3.2
-Directory: 3.2.3
-
-Tags: latest, 3.3.3, 3.3, 3
+Tags: 3.3.3, 3.3
 Architectures: amd64, arm64v8, ppc64le, s390x
 Directory: 3.3.3
+
+Tags: 3.4.1-nouveau, 3.4-nouveau, 3-nouveau
+Architectures: amd64, arm64v8, s390x
+Directory: 3.4.1-nouveau
+
+Tags: latest, 3.4.1, 3.4, 3
+Architectures: amd64, arm64v8, s390x
+Directory: 3.4.1
diff --git a/_bashbrew-list b/_bashbrew-list
index 3457842..a1e649e 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -1,6 +1,9 @@
 couchdb:3
-couchdb:3.2
-couchdb:3.2.3
+couchdb:3-nouveau
 couchdb:3.3
 couchdb:3.3.3
+couchdb:3.4
+couchdb:3.4-nouveau
+couchdb:3.4.1
+couchdb:3.4.1-nouveau
 couchdb:latest
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index 66a11cc..833251e 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -1,2 +1,3 @@
 couchdb:3
-couchdb:3.2
+couchdb:3-nouveau
+couchdb:3.3
diff --git a/couchdb_3.2/Dockerfile b/couchdb_3-nouveau/Dockerfile
similarity index 36%
copy from couchdb_3.2/Dockerfile
copy to couchdb_3-nouveau/Dockerfile
index d1d4d4f..b07d77a 100644
--- a/couchdb_3.2/Dockerfile
+++ b/couchdb_3-nouveau/Dockerfile
@@ -10,12 +10,12 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-FROM debian:bullseye-slim
+FROM debian:bookworm-slim
 
 LABEL maintainer="CouchDB Developers [email protected]"
 
 # Add CouchDB user account to make sure the IDs are assigned consistently
-RUN groupadd -g 5984 -r couchdb && useradd -u 5984 -d /opt/couchdb -g couchdb couchdb
+RUN groupadd -g 5984 -r nouveau && useradd -u 5984 -d /opt/nouveau -g nouveau nouveau
 
 # be sure GPG and apt-transport-https are available and functional
 RUN set -ex; \
@@ -28,6 +28,13 @@ RUN set -ex; \
      ; \
     rm -rf /var/lib/apt/lists/*
 
+# Nouveau wants a JRE/JDK
+RUN set -ex; \
+    apt-get update; \
+    apt-get install -y --no-install-recommends \
+        openjdk-17-jre-headless \
+     ;
+
 # grab tini for signal handling and zombie reaping
 # see https://github.com/apache/couchdb-docker/pull/28#discussion_r141112407
 RUN set -eux; \
@@ -37,9 +44,10 @@ RUN set -eux; \
     tini --version
 
 # http://docs.couchdb.org/en/latest/install/unix.html#installing-the-apache-couchdb-packages
-ENV GPG_COUCH_KEY \
 # gpg: rsa8192 205-01-19 The Apache Software Foundation (Package repository signing key) <[email protected]>
-    390EF70BB1EA12B2773962950EE62FB37A00258D
+
+ENV GPG_COUCH_KEY 390EF70BB1EA12B2773962950EE62FB37A00258D
+
 RUN set -eux; \
    apt-get update; \
    apt-get install -y curl; \
@@ -53,52 +61,26 @@ RUN set -eux; \
    apt purge -y --autoremove curl; \
    rm -rf /var/lib/apt/lists/*
 
-ENV COUCHDB_VERSION 3.2.3
-
 RUN . /etc/os-release; \
-    echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" | \
+   echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ bookworm main" | \
        tee /etc/apt/sources.list.d/couchdb.list >/dev/null
 
 # https://github.com/apache/couchdb-pkg/blob/master/debian/README.Debian
 RUN set -eux; \
     apt-get update; \
     \
-    echo "couchdb couchdb/mode select none" | debconf-set-selections; \
-# we DO want recommends this time
-    DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \
-            couchdb="$COUCHDB_VERSION"~bullseye \
-    ; \
-# Undo symlinks to /var/log and /var/lib
-    rmdir /var/lib/couchdb /var/log/couchdb; \
-    rm /opt/couchdb/data /opt/couchdb/var/log; \
-    mkdir -p /opt/couchdb/data /opt/couchdb/var/log; \
-    chown couchdb:couchdb /opt/couchdb/data /opt/couchdb/var/log; \
-    chmod 777 /opt/couchdb/data /opt/couchdb/var/log; \
-# Remove file that sets logging to a file
-    rm /opt/couchdb/etc/default.d/10-filelog.ini; \
-# Check we own everything in /opt/couchdb. Matches the command in dockerfile_entrypoint.sh
-    find /opt/couchdb \! \( -user couchdb -group couchdb \) -exec chown -f couchdb:couchdb '{}' +; \
-# Setup directories and permissions for config. Technically these could be 555 and 444 respectively
-# but we keep them as 755 and 644 for consistency with CouchDB defaults and the dockerfile_entrypoint.sh.
-    find /opt/couchdb/etc -type d ! -perm 0755 -exec chmod -f 0755 '{}' +; \
-    find /opt/couchdb/etc -type f ! -perm 0644 -exec chmod -f 0644 '{}' +; \
-# only local.d needs to be writable for the docker_entrypoint.sh
-    chmod -f 0777 /opt/couchdb/etc/local.d; \
-# apt clean-up
-    rm -rf /var/lib/apt/lists/*;
+    echo "couchdb-nouveau couchdb-nouveau/enable select false" | debconf-set-selections; \
+    DEBIAN_FRONTEND=noninteractive COUCHDB_NOUVEAU_ENABLE=1 apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages --no-install-recommends \
+            couchdb-nouveau=3.4.1~bookworm;
 
-# Add configuration
-COPY --chown=couchdb:couchdb 10-docker-default.ini /opt/couchdb/etc/default.d/
-COPY --chown=couchdb:couchdb vm.args /opt/couchdb/etc/
+RUN chown -R nouveau:nouveau /opt/nouveau
+COPY --chown=nouveau:nouveau nouveau.yaml /opt/nouveau/etc/nouveau.yaml
 
-COPY docker-entrypoint.sh /usr/local/bin
-RUN ln -s usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh # backwards compat
-ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
+VOLUME /opt/nouveau/data
 
-VOLUME /opt/couchdb/data
+# 5987: Nouveau App
+# 5988: Nouveau Admin
+EXPOSE 5987 5988
 
-# 5984: Main CouchDB endpoint
-# 4369: Erlang portmap daemon (epmd)
-# 9100: CouchDB cluster communication port
-EXPOSE 5984 4369 9100
-CMD ["/opt/couchdb/bin/couchdb"]
+# TODO: re-add tini
+CMD ["/usr/bin/java", "-server", "-Djava.awt.headless=true", "-Xmx2g", "-jar", "/opt/nouveau/lib/nouveau-1.0-SNAPSHOT.jar", "server", "/opt/nouveau/etc/nouveau.yaml"]
diff --git a/couchdb_3-nouveau/nouveau.yaml b/couchdb_3-nouveau/nouveau.yaml
new file mode 100644
index 0000000..5750942
--- /dev/null
+++ b/couchdb_3-nouveau/nouveau.yaml
@@ -0,0 +1,27 @@
+maxIndexesOpen: 3000
+commitIntervalSeconds: 30
+idleSeconds: 60
+rootDir: ./data/nouveau
+
+logging:
+  level: INFO
+
+server:
+  applicationConnectors:
+    - type: http
+      bindHost: 0.0.0.0
+      port: 5987
+      useDateHeader: false
+  adminConnectors:
+    - type: http
+      bindHost: 0.0.0.0
+      port: 5988
+      useDateHeader: false
+  gzip:
+    includedMethods:
+      - GET
+      - POST
+  requestLog:
+    appenders:
+      - type: console
+        target: stderr
diff --git a/couchdb_3.2/vm.args b/couchdb_3.2/vm.args
deleted file mode 100644
index d606217..0000000
diff --git a/couchdb_3.2/10-docker-default.ini b/couchdb_3.3/10-docker-default.ini
similarity index 100%
rename from couchdb_3.2/10-docker-default.ini
rename to couchdb_3.3/10-docker-default.ini
diff --git a/couchdb_3.2/Dockerfile b/couchdb_3.3/Dockerfile
similarity index 97%
rename from couchdb_3.2/Dockerfile
rename to couchdb_3.3/Dockerfile
index d1d4d4f..6d86dfb 100644
--- a/couchdb_3.2/Dockerfile
+++ b/couchdb_3.3/Dockerfile
@@ -10,7 +10,7 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-FROM debian:bullseye-slim
+FROM debian:bookworm-slim
 
 LABEL maintainer="CouchDB Developers [email protected]"
 
@@ -53,7 +53,7 @@ RUN set -eux; \
     apt purge -y --autoremove curl; \
     rm -rf /var/lib/apt/lists/*
 
-ENV COUCHDB_VERSION 3.2.3
+ENV COUCHDB_VERSION 3.3.3
 
 RUN . /etc/os-release; \
     echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" | \
@@ -66,7 +66,7 @@ RUN set -eux; \
     echo "couchdb couchdb/mode select none" | debconf-set-selections; \
 # we DO want recommends this time
     DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \
-            couchdb="$COUCHDB_VERSION"~bullseye \
+            couchdb="$COUCHDB_VERSION-1"~bookworm \
     ; \
 # Undo symlinks to /var/log and /var/lib
     rmdir /var/lib/couchdb /var/log/couchdb; \
diff --git a/couchdb_3.2/docker-entrypoint.sh b/couchdb_3.3/docker-entrypoint.sh
similarity index 100%
rename from couchdb_3.2/docker-entrypoint.sh
rename to couchdb_3.3/docker-entrypoint.sh
diff --git a/couchdb_3/vm.args b/couchdb_3.3/vm.args
similarity index 100%
copy from couchdb_3/vm.args
copy to couchdb_3.3/vm.args
diff --git a/couchdb_3/Dockerfile b/couchdb_3/Dockerfile
index 16bdf32..2314c8d 100644
--- a/couchdb_3/Dockerfile
+++ b/couchdb_3/Dockerfile
@@ -10,7 +10,7 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-FROM debian:bullseye-slim
+FROM debian:bookworm-slim
 
 LABEL maintainer="CouchDB Developers [email protected]"
 
@@ -53,7 +53,7 @@ RUN set -eux; \
     apt purge -y --autoremove curl; \
     rm -rf /var/lib/apt/lists/*
 
-ENV COUCHDB_VERSION 3.3.3
+ENV COUCHDB_VERSION 3.4.1
 
 RUN . /etc/os-release; \
     echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" | \
@@ -66,7 +66,7 @@ RUN set -eux; \
     echo "couchdb couchdb/mode select none" | debconf-set-selections; \
 # we DO want recommends this time
     DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \
-            couchdb="$COUCHDB_VERSION"~bullseye \
+            couchdb="$COUCHDB_VERSION"~bookworm \
     ; \
 # Undo symlinks to /var/log and /var/lib
     rmdir /var/lib/couchdb /var/log/couchdb; \

Relevant Maintainers:

@janl
Copy link
Contributor Author

janl commented Sep 28, 2024

finally, all checks green ✅✅✅

thanks for the help!

@yosifkit
Copy link
Member

yosifkit commented Oct 2, 2024

One comment for change and a few others for thought:
A few of the new/modified apt-get install lines are missing a corresponding rm -rf /var/lib/apt/lists/* in the same layer.

I don't know what the -server argument does for /usr/bin/java, but I guess if it runs, it is probably fine. You could get away with just java for the CMD instead of the whole path (since container runtimes use PATH for resolution), but it is fine either way.

@janl
Copy link
Contributor Author

janl commented Oct 2, 2024

@yosifkit thanks for the additional notes. We’re happy to address those in future releases unless anyone here thinks these are showstoppers? Nouveau is marked as a beta feature for this release.

We’d love to get the new CouchDB release onto the official library. If the new Nouveau image is holding that up, we can also split this out into a separate PR.

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

Successfully merging this pull request may close these issues.

4 participants