-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from impresso/adapt-to-runai
Adapt to runai
- Loading branch information
Showing
107 changed files
with
3,393 additions
and
15,131 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,79 @@ | ||
FROM daskdev/dask:2.3.0 | ||
# Set base image | ||
FROM daskdev/dask:2023.11.0-py3.11 | ||
|
||
# Install some necessary tools. | ||
RUN apt-get update && apt-get install -y \ | ||
cmake \ | ||
build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Set environment variables for user | ||
ENV GROUP_NAME=DHLAB-unit | ||
ENV GROUP_ID=11703 | ||
|
||
# Add local impresso_pycommons | ||
ADD . . | ||
ARG USER_NAME | ||
ARG USER_ID | ||
|
||
# Install build tools and libraries | ||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
ca-certificates \ | ||
pkg-config \ | ||
cmake \ | ||
software-properties-common | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
apt-utils \ | ||
git \ | ||
curl \ | ||
vim \ | ||
unzip \ | ||
wget \ | ||
tmux \ | ||
screen \ | ||
wget \ | ||
sudo \ | ||
openssh-client | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install --upgrade pip | ||
# Create a group and user | ||
RUN groupadd -g $GROUP_ID $GROUP_NAME | ||
RUN useradd -ms /bin/bash -u $USER_ID -g $GROUP_ID $USER_NAME | ||
|
||
# Add new user to sudoers | ||
RUN echo "${USER_NAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
# install desired libraries. | ||
# TODO remove boto once it's removed from all functions. | ||
RUN pip install --upgrade pip setuptools | ||
RUN pip install numpy scipy pillow beautifulsoup4 pandas PyYAML jsonlines pytest | ||
RUN pip install \ | ||
git+https://github.com/dkpro/dkpro-pycas.git \ | ||
git+https://github.com/impresso/dask_k8.git \ | ||
boto \ | ||
boto3 \ | ||
bs4 \ | ||
docopt \ | ||
"kubernetes>=9.0.0,<10" \ | ||
kubernetes \ | ||
"urllib3>1.21.1<1.25" \ | ||
"opencv-python>=3.4,<=4" \ | ||
opencv-python \ | ||
smart_open \ | ||
jsonlines \ | ||
s3fs \ | ||
"s3fs>=2023.3.0" \ | ||
jupyter | ||
|
||
RUN python setup.py install | ||
EXPOSE 8080 | ||
EXPOSE 8786 | ||
EXPOSE 8787 | ||
|
||
# Set the working directory | ||
WORKDIR /home/$USER_NAME/impresso_pycommons | ||
|
||
# Add local impresso_pycommons | ||
COPY . . | ||
|
||
# Change ownership of the copied files to the new user and group | ||
RUN chown -R ${USER_NAME}:${GROUP_NAME} /home/${USER_NAME}/impresso_pycommons | ||
|
||
# Switch to the new user | ||
USER $USER_NAME | ||
|
||
RUN pip install -e . | ||
|
||
# Make sure the script launching the rebuilt is executable | ||
RUN chmod -x /home/${USER_NAME}/impresso_pycommons/scripts/start_rebuilt_runai.sh | ||
|
||
CMD ["sleep", "infinity"] |
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
Empty file.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: d5cdc2e340f0361617247c2bfe93c213 | ||
config: 52a307b7b889569b6d220f068464a8b3 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
Image handling | ||
============== | ||
================================ | ||
|
||
Image Utils | ||
----------- | ||
------------------------------------------ | ||
|
||
.. automodule:: impresso_commons.images.img_utils | ||
:members: | ||
|
||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Olive Boxes | ||
----------- | ||
-------------------------------------------- | ||
|
||
.. automodule:: impresso_commons.images.olive_boxes | ||
:members: | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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 |
---|---|---|
@@ -1,21 +1,28 @@ | ||
Input/Output | ||
============ | ||
============================== | ||
|
||
General | ||
------- | ||
--------------- | ||
|
||
.. automodule:: impresso_commons.path | ||
:members: | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
I/O from file system | ||
-------------------- | ||
-------------------------------------- | ||
|
||
.. automodule:: impresso_commons.path.path_fs | ||
:members: | ||
|
||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
I/O from S3 | ||
----------- | ||
-------------------------------------- | ||
|
||
.. automodule:: impresso_commons.path.path_s3 | ||
:members: | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
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 |
---|---|---|
@@ -1,42 +1,45 @@ | ||
Utilities | ||
######### | ||
=============================== | ||
|
||
Basic Utils Functions | ||
------------------------------------ | ||
|
||
Command Line interface | ||
---------------------- | ||
.. automodule:: impresso_commons.utils.utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
to come... | ||
|
||
|
||
Basic utils | ||
----------- | ||
S3 Utils Functions | ||
--------------------------------- | ||
|
||
.. autofunctions:: impresso_commons.utils.init_logger | ||
.. autofunctions:: impresso_commons.utils.user_confirmation | ||
.. autofunctions:: impresso_commons.utils.timestamp | ||
.. autofunctions:: impresso_commons.utils.Timer | ||
.. autofunctions:: impresso_commons.utils.chunk | ||
.. automodule:: impresso_commons.utils.s3 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Dask Utils Functions | ||
---------------------------------------- | ||
|
||
S3 Utils Functions | ||
------------------ | ||
.. automodule:: impresso_commons.utils.daskutils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Apache UIMA XMI Utils Functions | ||
----------------------------------- | ||
|
||
.. autofunctions:: impresso_commons.utils.s3.get_s3_client | ||
.. autofunctions:: impresso_commons.utils.s3.get_s3_resource | ||
.. autofunctions:: impresso_commons.utils.s3.get_s3_connection | ||
.. autofunctions:: impresso_commons.utils.s3.get_bucket | ||
.. autofunctions:: impresso_commons.utils.s3.get_bucket_boto3 | ||
.. autofunctions:: impresso_commons.utils.s3.s3_get_articles | ||
.. autofunctions:: impresso_commons.utils.s3.s3_get_pages | ||
.. autofunctions:: impresso_commons.utils.s3.get_s3_versions | ||
.. autofunctions:: impresso_commons.utils.s3.get_s3_versions_client | ||
.. autofunctions:: impresso_commons.utils.s3.read_jsonlines | ||
.. autofunctions:: impresso_commons.utils.s3.readtext_jsonlines | ||
.. autofunctions:: impresso_commons.utils.s3.upload | ||
.. automodule:: impresso_commons.utils.uima | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Config File Loader | ||
------------------ | ||
|
||
Dask Utils Functions | ||
-------------------- | ||
.. autofunctions:: impresso_commons.utils.daskutils.create_even_partitions | ||
.. automodule:: impresso_commons.utils.config_loader | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. include:: ../impresso_commons/config/config.loader.example.md | ||
:parser: myst_parser.sphinx_ |
Oops, something went wrong.