Closed Bug 1516347 Opened 6 years ago Closed 6 years ago

Build all services in a single docker image

Categories

(Taskcluster :: Services, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dustin, Assigned: dustin)

References

Details

When building the Taskcluster services for deployment, build a single docker image which can run any of the services (including the oddballs).
taskcluster/taskcluster-monoservice    SVC-bf32b825c5c3    9cedd97b6fe0        About a minute ago   218MB
                                                                                                    ^^^^^

Note that this does not include the "oddballs". I think that's probably for the best, at least for now. Two of those (tc-events and tc-docs) will go away soon, anyway.

I need to work on the docs export and a few other things, then get this up for review.

I think I might need to solve bug 1520841 in the process. References are implemented in a docker image that contains both node and nginx - it uses node to "relativize" the references to the rootUrl, then nginx to serve teh data.

We need nginx for tc-web, too, for a similar thing: we'll need to set it up to run with the current rootUrl.

So let's build a single docker image based on node (since we're probably most sensitive to node version) with nginx installed as well. Then set up references to use the monorepo to relativize and serve the result with nginx.

Depends on: 1520841

OK, since I'm getting no time to actually write the code, let me outline my plans:

  • [bug 1520841] import tc-references into services/references
  • build everything in services/* into a "monoimage" and run "write-docs" for each of those services to generate docs
    • special-case some services as not generating docs
  • clone the monorepo from the working copy, erroring if there are unchanged files (with an option to override that warning)
  • build an image based on node-alpine but including nginx (just use apk update; apk add ngnix)
  • build the generated docs directory into the monoimage directly
  • set up tc-references to use that generated docs repo on startup to write rootUrl-specific output, then start nginx
  • clone tc-docs (still from its own repo) into the monoimage and run gulp there, then configure it to start nginx on startup
  • update tc-terraform to point to this new monoimage

after that, all that's left outside of the monoimage is:

"taskcluster_image_gce-provider": "taskcluster/taskcluster-gce-provider:SVC-d93c9b13f9b1",
"taskcluster_image_events": "taskcluster/taskcluster-events:SVC-95c3cacc81f5",
"taskcluster_image_tools": "taskcluster/taskcluster-tools:SVC-a6a0705442b3",

all of which are slated to go away soon.

Depends on: 1516353
Blocks: docs

OK, some additional progress -- references is now in the monoimage!

Some random notes to self:

  • move special-case support to its own commit, add build and check
    methods
  • run yarn build for tc-web-server during build phase
  • use an emptyDir for /references in the references pod
  • rather than copying, just merge tc-docs into the monorepo (hopefully this helps owlish as some things become a git mv)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Component: Platform and Services → Services
You need to log in before you can comment on or make changes to this bug.