On Sat, Oct 19, 2019 at 6:39 AM Sam Ruby <ru...@intertwingly.net> wrote:
>
> On Sat, Oct 19, 2019 at 12:43 AM Dave Fisher <wave4d...@comcast.net> wrote:
> >
> > Maybe a docker image is the way to go. I’ll test it if you point it out.
>
> A docker image is VERY appealing.  There are things that don't work
> and/or are hard to do on Mac (for example, setting up Apache httpd
> with LDAP enabled as brew no longer supports that).  And there would
> be the added benefit of having the development environment more
> closely match the deployment environment.
>
> Two issues:
>
> 1) We would need to work through how to get your users git and
> subversion credentials onto the container.  This is solvable.
>
> 2) Mounted file systems are fast only on Linux.  On Mac and Windows,
> they are dog slow.  This likely means that the way to go is have the
> /srv directory in a container.  Faster, but less convenient.  At the
> moment, a full /srv directory is 29G.  Perhaps the container could run
> something like nfs enabling the host to mount it?

I'm starting to look at this and things are a bit more promising than
the last time I looked at Docker.  In particular, mounted file system
performance has improved significantly, and docker-compose can deal
with much of the configuration stuff (e.g. volume mounts).

Current thoughts:

* Docker works best with static data in the images and all persistent
data in volumes (i.e., no transient data in containers).  We nearly
have that split now with the /srv directory being the persistent data
(including whimsy source!) and nearly everything else being static.
The one thing that I would consider adding to the volume is the
installed gems as that is something a developer may wish to add to.
This can be done by setting the GEM_HOME environment variable to
/srv/gems in the Dockerfile.

* The developer model would be roughly thus: create an empty directory
in that directory clone the whimsy source.  Change directory into that
source and run a command like "rake docker:build" to build the image,
and "rake docker:update" to populate the "/srv" directory.  As the
/srv directory will be mounted on the parent directory of the whimsy
source, these files will reside on the host computer, and one can use
your favorite IDE or editor on this data.  "rake docker:run" and "rake
docker:stop" could start and stop a web server which could be accessed
at a predefined port number.

* Down the road, it may make sense to provide options to allow
directories like iclas, grants, cclas, and member_apps to be skipped,
as these are primarily for a single tool (the secretary workbench) and
currently are over 22G.  The remainder of the srv directory is
currently under 7G.  I don't yet know how big the image itself will
need to be, I'd guess a few G.

* For users who have ssh access to whimsy.apache.org, it may also be
worth adding commands that will selectively rsync various directories
from whimsy.apache.org to the host directory containing the
container's /srv directory.  I do this frequently when I debug board
agenda issues.

Net-net: a person with a developer class laptop with 10G of available
space and a good internet connection could get up and running with a
few commands.  All they would need to have installed is docker and
git.  They could make local changes, see the results in their browser,
and commit and push the changes once they are happy with the result.

Should even work on Windows.

- Sam Ruby

Reply via email to