summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Lankton <zachlankton@gmail.com>2022-08-15 17:17:25 +0000
committerNick Vatamaniuc <nickva@users.noreply.github.com>2022-08-19 22:32:36 -0400
commitb9afb4590a5cf31a67cfe13c341eecb64dea0102 (patch)
treecdb51158df311dbdd08aebe5ac08de776c3042c8
parente6db35b6b5737a7397e10758a87c06c10f729200 (diff)
downloadcouchdb-b9afb4590a5cf31a67cfe13c341eecb64dea0102.tar.gz
update devcontainer
-rw-r--r--.devcontainer/Dockerfile31
-rw-r--r--.devcontainer/devcontainer.json30
-rw-r--r--README-DEV.rst15
-rw-r--r--README.rst18
4 files changed, 63 insertions, 31 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 04a117cb2..46a09d0cf 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,24 +1,13 @@
-ARG ELIXIR_VERSION
-FROM elixir:${ELIXIR_VERSION}
+ARG IMG
+FROM ${IMG}
-# Install SpiderMonkey 60 and tell CouchDB to use it in configure
-ENV SM_VSN=60
+# Install SpiderMonkey 78 and tell CouchDB to use it in configure
+ENV SM_VSN=78
-# Use NodeSource binaries for Node.js (Fauxton dependency)
-RUN set -ex; \
- curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -; \
- echo "deb https://deb.nodesource.com/node_10.x buster main" | tee /etc/apt/sources.list.d/nodesource.list; \
- echo "deb-src https://deb.nodesource.com/node_10.x buster main" | tee -a /etc/apt/sources.list.d/nodesource.list
+USER root
-RUN set -ex; \
- apt-get update; \
- apt-get install -y --no-install-recommends \
- libmozjs-${SM_VSN}-dev \
- libicu-dev \
- python3-venv \
- python3-pip \
- python3-sphinx \
- nodejs
-
-# Documentation theme
-RUN pip3 install sphinx_rtd_theme
+# These lines are necessary if the user has cloned the repo to their local machine
+# and clicked the "Reopen in container button"
+RUN mkdir -p /workspaces/couchdb
+WORKDIR /workspaces/couchdb
+COPY . .
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 666f9fa16..5dbf45dbd 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,19 +1,29 @@
{
"build": {
"dockerfile": "Dockerfile",
+ "context": "..",
"args": {
+ "name": "couchdb-dev",
// Useful choices include:
- // 1.11 -> Erlang 23, Debian Buster
- // 1.10 -> Erlang 22, Debian Buster
- // 1.9 -> Erlang 22, Debian Buster
+ // apache/couchdbci-debian:bullseye-erlang-25.0.2
+ // apache/couchdbci-debian:bullseye-erlang-24.3.4.2
+ // apache/couchdbci-debian:bullseye-erlang-23.3.4.15
//
- // Older versions based on Debian Stretch will not include
- // SpiderMonkey 60, which the Dockerfile expects to be able
- // to install via apt-get.
- "ELIXIR_VERSION": "1.10"
+ "IMG": "apache/couchdbci-debian:bullseye-erlang-25.0.2"
}
},
- "extensions": [
- "erlang-ls.erlang-ls"
- ]
+
+ // We are using a volume mount to improve performance
+ // https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-a-named-volume-for-your-entire-source-tree
+ //
+ // and eliminate test flake.
+ // https://github.com/apache/couchdb/discussions/4145
+ //
+ // Your code will not be bound to the host OS folder you started this project from.
+ // Your code will live inside the volume created for the container under /workspace.
+ "workspaceMount": "target=/workspaces/couchdb,type=volume",
+ "workspaceFolder": "/workspaces/couchdb",
+ "postCreateCommand": "./configure && make",
+
+ "extensions": ["erlang-ls.erlang-ls"]
}
diff --git a/README-DEV.rst b/README-DEV.rst
index 863218de9..84e16def7 100644
--- a/README-DEV.rst
+++ b/README-DEV.rst
@@ -64,6 +64,21 @@ associated ``devcontainer.json`` file to quickly provision a
development environment using `GitHub Codespaces <https://github.com/features/codespaces>`_
or `Visual Studio Code <https://code.visualstudio.com/docs/remote/containers>`_.
+
+.. image:: https://img.shields.io/static/v1?label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode
+ :target: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/apache/couchdb
+
+If you already have VS Code and Docker installed, you can click the badge above or
+`here <https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/apache/couchdb>`_
+to get started. Clicking these links will cause VS Code to automatically install the
+Remote - Containers extension if needed, clone the source code into a container volume,
+and spin up a dev container for use.
+
+This ``devcontainer`` will automatically run ``./configure && make`` the first time it is created.
+While this may take some extra time to spin up, this tradeoff means you will be able to
+run things like ``./dev/run`` and ``make check`` straight away. Subsequent startups should be quick.
+
+
Debian-based (inc. Ubuntu) Systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/README.rst b/README.rst
index e6d294ceb..6bb69cd09 100644
--- a/README.rst
+++ b/README.rst
@@ -60,6 +60,24 @@ Run a basic test suite for CouchDB by browsing here:
Getting started with developing
-------------------------------
+**Quickstart:**
+
+
+.. image:: https://img.shields.io/static/v1?label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode
+ :target: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/apache/couchdb
+
+If you already have VS Code and Docker installed, you can click the badge above or
+`here <https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/apache/couchdb>`_
+to get started. Clicking these links will cause VS Code to automatically install the
+Remote - Containers extension if needed, clone the source code into a container volume,
+and spin up a dev container for use.
+
+This ``devcontainer`` will automatically run ``./configure && make`` the first time it is created.
+While this may take some extra time to spin up, this tradeoff means you will be able to
+run things like ``./dev/run`` and ``make check`` straight away. Subsequent startups should be quick.
+
+**Manual Dev Setup:**
+
For more detail, read the README-DEV.rst file in this directory.
Basically you just have to install the needed dependencies which are