-
Notifications
You must be signed in to change notification settings - Fork 1
Update base image and crane #561
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
Open
bio-boris
wants to merge
14
commits into
main
Choose a base branch
from
update_python_base_image
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+291
−612
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ba2c1d4
Update Python base image version in Dockerfile
bio-boris 9dcbbad
Switch to slim version of Python base image
bio-boris e496637
Update Dockerfile to install curl and tidy up commands
bio-boris b0c9a08
Remove curl installation step
bio-boris 3af41d0
Fix Dockerfile syntax and install dependencies
bio-boris fd3be38
Parameterize Python version in Dockerfile
bio-boris 95a54c9
Remove curl and git installation from Dockerfile
bio-boris af9e2c1
Update CRANE_VER and install dependencies
bio-boris f5cf37b
Fix Dockerfile to use correct tar.gz filename
bio-boris f0f78b9
Update Dockerfile to set CRANE_VER environment variable
bio-boris f2e720e
Update as htcondor doesn't work on mac
0e51c03
Update deps
56cd19d
Update deps
f2acd6d
update starlette to fix tests
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 hidden or 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 |
|---|---|---|
| @@ -1,58 +1,59 @@ | ||
| FROM python:3.12 AS build | ||
| ARG PYTHON_VERSION=3.12.13-slim | ||
|
|
||
| ENV CRANE_VER=v0.20.2 | ||
| FROM python:${PYTHON_VERSION} AS build | ||
|
|
||
| # Install crane | ||
| RUN apt-get update && apt-get install -y --no-install-recommends curl git \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /craneinstall | ||
|
|
||
| # crane install docs: https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md | ||
| # Note that the provenance verification step is broken, which wasted an hour or two of time | ||
| # https://github.com/google/go-containerregistry/issues/1982 | ||
| RUN curl -sL https://github.com/google/go-containerregistry/releases/download/$CRANE_VER/go-containerregistry_Linux_x86_64.tar.gz > go-containerregistry.tar.gz \ | ||
| && tar -zxvf go-containerregistry.tar.gz | ||
| ENV CRANE_VER=v0.21.2 | ||
| RUN curl -sL https://github.com/google/go-containerregistry/releases/download/$CRANE_VER/go-containerregistry_Linux_x86_64.tar.gz > go-containerregistry_Linux_x86_64.tar.gz \ | ||
| && curl -sL https://github.com/google/go-containerregistry/releases/download/$CRANE_VER/checksums.txt > checksums.txt \ | ||
| && grep "go-containerregistry_Linux_x86_64.tar.gz" checksums.txt | sha256sum -c - \ | ||
| && tar -zxvf go-containerregistry_Linux_x86_64.tar.gz | ||
|
|
||
| # Write the git commit for the service | ||
|
|
||
| WORKDIR /git | ||
| COPY .git /git | ||
| RUN GITCOMMIT=$(git rev-parse HEAD) && echo "GIT_COMMIT=\"$GITCOMMIT\"" > /git/git_commit.py | ||
|
|
||
| FROM python:3.12 | ||
|
|
||
| RUN apt update \ | ||
| && apt install -y tini \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| FROM python:${PYTHON_VERSION} | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends tini curl \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # install uv | ||
| RUN pip install --upgrade pip && \ | ||
| pip install uv | ||
| pip install uv | ||
|
|
||
| # install deps | ||
| ARG UV_DEV_ARGUMENT=--no-dev | ||
| RUN mkdir /uvinstall | ||
| WORKDIR /uvinstall | ||
| COPY pyproject.toml uv.lock .python-version . | ||
| ENV UV_PROJECT_ENVIRONMENT=/usr/local/ | ||
| ARG UV_DEV_ARGUMENT=--no-dev | ||
| RUN uv sync --locked --inexact $UV_DEV_ARGUMENT | ||
|
|
||
| # install the actual code | ||
| RUN mkdir /cts | ||
| COPY cdmtaskservice /cts/cdmtaskservice | ||
| COPY scripts/* /cts | ||
| COPY cdmtaskservice_*config.toml.jinja /cts | ||
|
|
||
| COPY --from=build /craneinstall/crane /cts | ||
| COPY --from=build /git/git_commit.py /cts/cdmtaskservice/ | ||
| ENV KBCTS_CRANE_PATH=/cts/crane | ||
|
|
||
| WORKDIR /cts | ||
|
|
||
| # build the code archive | ||
|
|
||
| RUN tar -czf cts.tgz --exclude="*/__pycache__*" cdmtaskservice -C /uvinstall . | ||
| ENV KBCTS_CODE_ARCHIVE_PATH=/cts/cts.tgz | ||
| ENV KBCTS_HTC_EXE_PATH=/cts/cdmtaskservice/condor/run_job.sh | ||
|
|
||
| ENTRYPOINT ["tini", "--", "/cts/entrypoint.sh"] | ||
|
|
||
This file contains hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.