Page MenuHomePhabricator

[reports-service] Add Dockerfile
ClosedPublic

Authored by bartek on Aug 30 2023, 1:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 6, 6:13 AM
Unknown Object (File)
Sun, May 5, 12:06 AM
Unknown Object (File)
Fri, May 3, 8:09 PM
Unknown Object (File)
Wed, May 1, 11:08 PM
Unknown Object (File)
Mon, Apr 29, 8:05 AM
Unknown Object (File)
Fri, Apr 26, 5:55 PM
Unknown Object (File)
Thu, Apr 25, 4:57 PM
Unknown Object (File)
Apr 15 2024, 8:48 PM
Subscribers

Details

Summary

Added Dockerfile for reports-service along with other usual config, like docker-compose.
Based on other dockerfiles we have.

Depends on D9036

Test Plan
# for amd64 linux
docker compose build reports-server

# for m1 arm
cd services/reports
docker buildx build -t commapp/reports-server:latest ../../ -f ./Dockerfile

# then ran it
docker run -p 50056:50056 commapp/reports-server:latest

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Aug 30 2023, 2:34 PM
bartek added inline comments.
services/docker-compose.yml
38 ↗(On Diff #30609)

Not directly related, but I add this every time I build blob. Identity has this already

services/reports/Dockerfile
13 ↗(On Diff #30609)

This one might be interesting.
Ofen when building cargo in docker, it hangs on Updating crates.io index - I found either enabling "sparse registry" or setting --config git-fetch-with-cli=true helpful.

Source: https://github.com/rust-lang/cargo/issues/10781

Is there a reason for not building dependencies on another layer?

services/docker-compose.yml
79 ↗(On Diff #30652)

Should it depend on blob?

This revision is now accepted and ready to land.Aug 31 2023, 7:06 AM

Is there a reason for not building dependencies on another layer?

  1. Performance. The second build, with actual source code, wasn't much faster than the dependencies build, so in fact we nearly doubled the build time.
    • Also encountered issues when did cargo build and then cargo install. The latter one badly deals with prebuilt state
  2. We don't use these docker images for development, and on CI they're built from scratch every time so it doesn't really make sense
services/docker-compose.yml
79 ↗(On Diff #30652)

It indeed should

Add blob-server dependency in docker-compose

This revision was landed with ongoing or failed builds.Sep 3 2023, 11:41 PM
This revision was automatically updated to reflect the committed changes.