Page MenuHomePhabricator

[reports-service] Add Dockerfile
ClosedPublic

Authored by bartek on Aug 30 2023, 1:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 10:34 AM
Unknown Object (File)
Wed, Nov 6, 4:41 AM
Unknown Object (File)
Wed, Nov 6, 4:41 AM
Unknown Object (File)
Wed, Nov 6, 4:41 AM
Unknown Object (File)
Wed, Nov 6, 4:41 AM
Unknown Object (File)
Wed, Nov 6, 4:39 AM
Unknown Object (File)
Sun, Oct 27, 4:49 PM
Unknown Object (File)
Oct 20 2024, 10:39 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
No Lint Coverage
Unit
No Test Coverage

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.