Skip to content

Commit

Permalink
add jgo, pyimage patch and update docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeul committed Jul 19, 2024
1 parent f785f77 commit 37b9454
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
10 changes: 8 additions & 2 deletions docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ COPY . /bfio_src
RUN git apply --directory=bfio_src /bfio_src/docker/m2_repo.patch

# Install
RUN pip3 install /bfio_src --no-cache-dir && \
rm -rf /bfio_src
RUN pip3 install /bfio_src --no-cache-dir

#Apply jgo copy patch
RUN git apply --directory=usr/local/lib/python3.10/dist-packages /bfio_src/docker/jgo_copy.patch

# clean up
RUN rm -rf /bfio_src


# Update Maven local repository path
RUN mkdir -p /usr/share/maven/conf
Expand Down
12 changes: 10 additions & 2 deletions docker/imagej/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,22 @@ COPY . /bfio_src
RUN git apply --directory=bfio_src /bfio_src/docker/m2_repo.patch

# Install
RUN pip3 install /bfio_src --no-cache-dir && \
rm -rf /bfio_src
RUN pip3 install /bfio_src --no-cache-dir

#Apply jgo copy patch
RUN git apply --directory=usr/local/lib/python3.9/dist-packages /bfio_src/docker/jgo_copy.patch

# Install packages
ENV LIBRARY_PATH=/lib:/usr/lib
RUN pip3 install cython --no-cache-dir && \
pip3 install pyimagej==1.4.1 --no-cache-dir

#Apply pyimagej patch
RUN git apply --directory=usr/local/lib/python3.9/dist-packages /bfio_src/docker/pyimagej_m2repo.patch

# clean up
RUN rm -rf /bfio_src

# Update Maven local repository path
RUN mkdir -p /usr/share/maven/conf
RUN echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" ' \
Expand Down
13 changes: 13 additions & 0 deletions docker/jgo_copy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/jgo/jgo.py b/jgo/jgo.py
index bd2b328..e2a824a 100644
--- a/jgo/jgo.py
+++ b/jgo/jgo.py
@@ -710,7 +710,7 @@ def resolve_dependencies(
jar_file_in_workspace,
link_type=link_type,
)
- except FileExistsError:
+ except (FileExistsError, shutil.SameFileError):
# Do not throw exception if target file exists.
pass
pathlib.Path(build_success_file).touch(exist_ok=True)
12 changes: 12 additions & 0 deletions docker/pyimagej_m2repo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/imagej/__init__.py b/imagej/__init__.py
index 18aa9a8..74524ce 100644
--- a/imagej/__init__.py
+++ b/imagej/__init__.py
@@ -1421,6 +1421,7 @@ def _create_jvm(
sj.config.endpoints.extend(original_endpoints)

try:
+ sj.config.set_m2_repo("/etc/m2/")
sj.start_jvm()
except subprocess.CalledProcessError as e:
# Check to see if initialization failed due to "un-managed"
9 changes: 7 additions & 2 deletions docker/tensorflow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ COPY . /bfio_src
RUN git apply --directory=bfio_src /bfio_src/docker/m2_repo.patch

# Install
RUN pip3 install /bfio_src --no-cache-dir && \
rm -rf /bfio_src
RUN pip3 install /bfio_src --no-cache-dir

#Apply jgo copy patch
RUN git apply --directory=usr/local/lib/python3.8/dist-packages /bfio_src/docker/jgo_copy.patch

# clean up
RUN rm -rf /bfio_src

# Update Maven local repository path
RUN mkdir -p /usr/share/maven/conf
Expand Down

0 comments on commit 37b9454

Please sign in to comment.