-
Notifications
You must be signed in to change notification settings - Fork 27
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
✨ ooil executable in a docker image #3458
Merged
pcrespov
merged 24 commits into
ITISFoundation:master
from
pcrespov:is3418/ooil-fsgenerator
Oct 25, 2022
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ae47bee
adds binder program template
pcrespov b36ab6d
minor changes on API sleeper test
pcrespov 1f35d17
WIP: OOIL dockerfile
pcrespov 0ff35c3
adds python ignote to .dockerignore
pcrespov 540d533
defines docker executable
pcrespov dd808da
cleanup
pcrespov 9f874ec
rm binder-program
pcrespov e46071e
adds in deploy so it can be tagged
pcrespov 8bb538c
adds info
pcrespov e76746d
fixes mypy
pcrespov cd78a30
mypy
pcrespov 4d8d00d
some more mypy fixes
pcrespov 1f0690d
undid pyupgrade
pcrespov 7fdf30b
@mrnicegyu11 review: docker cli
pcrespov a3fa056
@sanderegg review: unnecessary info in ci
pcrespov 48d5b2f
@sanderegg review: rm todo
pcrespov b2da15b
@sanderegg review: comment
pcrespov cdf1dcf
update
pcrespov a8b41cb
prune imports
pcrespov cbd5035
@GitHK review: undo indent
pcrespov 1c1b8fd
@GitHK review; dockerfile
pcrespov ab47436
@GitHK review: doc
pcrespov 061928f
fixes wrong class
pcrespov 5c8b065
renamed
pcrespov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
ARG PYTHON_VERSION="3.9.12" | ||
FROM python:${PYTHON_VERSION}-slim-buster as base | ||
|
||
LABEL maintainer=pcrespov | ||
|
||
# Sets utf-8 encoding for Python et al | ||
ENV LANG=C.UTF-8 | ||
# Turns off writing .pyc files; superfluous on an ephemeral container. | ||
ENV PYTHONDONTWRITEBYTECODE=1 \ | ||
VIRTUAL_ENV=/home/scu/.venv | ||
# Ensures that the python and pip executables used | ||
# in the image will be those from our virtualenv. | ||
ENV PATH="${VIRTUAL_ENV}/bin:$PATH" | ||
|
||
|
||
# -------------------------- Build stage ------------------- | ||
|
||
FROM base as build | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# NOTE: python virtualenv is used here such that installed | ||
# packages may be moved to production image easily by copying the venv | ||
RUN python -m venv "${VIRTUAL_ENV}" | ||
|
||
RUN pip install --no-cache-dir --upgrade \ | ||
pip~=22.0 \ | ||
wheel \ | ||
setuptools | ||
|
||
WORKDIR /build | ||
|
||
COPY --chown=scu:scu packages/models-library packages/models-library | ||
COPY --chown=scu:scu packages/service-integration packages/service-integration | ||
|
||
|
||
# WARNING: keep synced with `make install-prod` (did not use it directly because if would require copying scripts/common.Makefile and other parts of the repo) | ||
RUN cd packages/service-integration \ | ||
&& pip install --no-cache-dir -r requirements/_base.txt \ | ||
&& pip install --no-cache-dir ../models-library/ \ | ||
&& pip install --no-cache-dir . | ||
|
||
|
||
# -------------------------- Build stage ------------------- | ||
|
||
FROM base as production | ||
|
||
COPY --from=build --chown=scu:scu ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
|
||
# NOTE: do not activate ENV PYTHONOPTIMIZE=TRUE since excutable contains pytest code | ||
ENTRYPOINT [ "ooil" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a thought but: the idea with dockerignore files I think are:
*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed offline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle I agree with this approach but IMO there is a flaw. Say that you want to include
packages/servicelib
. Using your approach you exclude everything except whatever is in that folder. The problem is, what happens e.g. with all the artifacts produced for python development (i.e.__cache__
,eggs
, etc) inside of that folder? Shouldn't it make sense that the.dockerignore
includes as well the.gitignore
?