Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41366: Add Docker image build for butler server #900

Merged
merged 5 commits into from
Nov 3, 2023
Merged

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Oct 27, 2023

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (5baa637) 87.68% compared to head (84a2dc8) 87.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #900      +/-   ##
==========================================
- Coverage   87.68%   87.67%   -0.01%     
==========================================
  Files         276      277       +1     
  Lines       36326    36338      +12     
  Branches     7581     7583       +2     
==========================================
+ Hits        31851    31858       +7     
- Misses       3313     3318       +5     
  Partials     1162     1162              
Files Coverage Δ
...on/lsst/daf/butler/remote_butler/server/_server.py 88.67% <33.33%> (-1.71%) ⬇️
...on/lsst/daf/butler/remote_butler/server/_config.py 63.63% <63.63%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dhirving dhirving force-pushed the tickets/DM-41366 branch 2 times, most recently from 7b3d8c7 to 403d76f Compare October 30, 2023 16:18
@dhirving dhirving marked this pull request as ready for review November 2, 2023 22:01
Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. It would be nice if the github action could run a simple test to check that the code can be loaded. eg by running something like:

$ butler create tmp
$ butler config-dump tmp

Dockerfile Outdated

COPY . /workdir
WORKDIR /workdir
RUN pip install --no-cache-dir .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add --no-deps here so it doesn't try again to install all the dependencies that we've installed via requirements.txt above? Historically we have had some weird things going on with version number matches if requirements.txt is pointing to git repos and pip is using pyproject.toml dependencies from PyPI.

compose.yml Outdated
ports:
- "8080:8080"
environment:
BUTLER_SERVER_BUTLER_ROOT: "/butler_root"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pondering whether BUTLER_ROOT is the right term now. This is really the URI to the butler configuration (with or without the butler.yaml).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed BUTLER_SERVER_CONFIG_URI

@@ -0,0 +1,2 @@
uvicorn
psycopg2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory pip install .[postgres] should pick up this dependency (it's listed as an optional dep in the pyproject.toml), but not if I've just told you to use --no-deps for that part above...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependencies actually want to be installed in a separate step from the pip install of the application itself -- if the requirements.txt files don't change, Docker can cache the intermediate dependency image and save a few minutes on the next build.

Also the requirements will need to be pinned in future so we won't want pyproject.toml involved.

@dhirving dhirving merged commit 97f57a3 into main Nov 3, 2023
15 of 17 checks passed
@dhirving dhirving deleted the tickets/DM-41366 branch November 3, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants