Page MenuHomePhabricator

WVUI Docker improvements
Closed, DeclinedPublic

Description

The Docker setup for WVUI has room for some improvements:

  • The release scripts to easily release a new version of WVUI on npm. Those scripts as of now can only be run outside the container, but ideally should be run inside Docker with a command like: docker-compose run --rm node ./bin/release-dev. Another option: move the prepublishOnly NPM script out of package.json and into the shell scripts, and call docker-compose run --rm node <command> from the shell scripts as needed.
  • Based on your host OS, the Dockerfile will behave differently in assigning Docker generated files a user and group. The docker-compose commands also require build arguments (docker-compose run --rm --build-args UID) to get this to work properly. Look into a cleaner way of doing this, to be consistent across OS's and/or remove the number of CLI args required.

Event Timeline

nnikkhoui renamed this task from Execute rolling release scripts inside Docker container to WVUI Docker improvements .Sep 25 2020, 4:29 PM
nnikkhoui updated the task description. (Show Details)
nnikkhoui added a subscriber: Niedzielski.

Change 640245 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[wvui@master] Experimental: Publish new wvui versions through Docker container

https://gerrit.wikimedia.org/r/640245

Change 640245 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[wvui@master] Experimental: Publish new wvui versions through Docker container

https://gerrit.wikimedia.org/r/640245

Running into an issue to document:

Node modules are compiled differently when npm install-ed on the host machine (for me a Mac) vs the docker Debian image. This causes a problem because the pre-commit hooks that fire on the host would need Mac OS-compiled node modules, but the release scripts that run inside the docker image would need a set of Debian-compiled node modules. This makes it so we can't use the same node_modules directory when doing a local commit to gerrit and running the release scripts inside the docker container.

The easiest option I see is to require running npm ci before committing any code to gerrit so the whole node_modules directory is rebuilt. A little annoying, but this situation shouldnt come up too often.

Change 649758 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[wvui@master] WIP: Separate node_modules between host and docker

https://gerrit.wikimedia.org/r/649758

Change 640245 merged by jenkins-bot:

[wvui@master] Publish new wvui development versions through Docker container

https://gerrit.wikimedia.org/r/640245

Change 649758 abandoned by Nikki Nikkhoui:

[wvui@master] Separate node_modules between host and docker

Reason:

https://gerrit.wikimedia.org/r/649758

Volker_E subscribed.

As WVUI is deprecated and on the brink of being removed from MediaWiki, I'll decline this task. All focus is on Codex now.